comparison lisp/doc-view.el @ 93004:c378e060aab3

(doc-view-doc->txt, doc-view-convert-current-doc): Use non-nil PARENTS attribute of make-directory instead of explicitly checking existence the current cache directory.
author Tassilo Horn <tassilo@member.fsf.org>
date Sun, 16 Mar 2008 09:24:02 +0000
parents 4486b0175a46
children 7a4d478a79d1
comparison
equal deleted inserted replaced
93003:d22a1707eab3 93004:c378e060aab3
598 (process-put doc-view-current-converter-process 'buffer (current-buffer)) 598 (process-put doc-view-current-converter-process 'buffer (current-buffer))
599 (process-put doc-view-current-converter-process 'callback callback)) 599 (process-put doc-view-current-converter-process 'callback callback))
600 600
601 (defun doc-view-doc->txt (txt callback) 601 (defun doc-view-doc->txt (txt callback)
602 "Convert the current document to text and call CALLBACK when done." 602 "Convert the current document to text and call CALLBACK when done."
603 (unless (file-exists-p (doc-view-current-cache-dir)) 603 (make-directory (doc-view-current-cache-dir) t)
604 (make-directory (doc-view-current-cache-dir)))
605 (case doc-view-doc-type 604 (case doc-view-doc-type
606 (pdf 605 (pdf
607 ;; Doc is a PDF, so convert it to TXT 606 ;; Doc is a PDF, so convert it to TXT
608 (doc-view-pdf->txt doc-view-buffer-file-name txt callback)) 607 (doc-view-pdf->txt doc-view-buffer-file-name txt callback))
609 (ps 608 (ps
648 ;; preserves the horizontal/vertical scroll settings (which are otherwise 647 ;; preserves the horizontal/vertical scroll settings (which are otherwise
649 ;; resets during the redisplay). 648 ;; resets during the redisplay).
650 (setq doc-view-pending-cache-flush t) 649 (setq doc-view-pending-cache-flush t)
651 (let ((png-file (expand-file-name "page-%d.png" 650 (let ((png-file (expand-file-name "page-%d.png"
652 (doc-view-current-cache-dir)))) 651 (doc-view-current-cache-dir))))
653 (unless (file-exists-p (doc-view-current-cache-dir)) 652 (make-directory (doc-view-current-cache-dir) t)
654 (make-directory (doc-view-current-cache-dir)))
655 (case doc-view-doc-type 653 (case doc-view-doc-type
656 (dvi 654 (dvi
657 ;; DVI files have to be converted to PDF before Ghostscript can process 655 ;; DVI files have to be converted to PDF before Ghostscript can process
658 ;; it. 656 ;; it.
659 (lexical-let 657 (lexical-let