aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2008-03-13 18:12:28 +0000
committerTassilo Horn2008-03-13 18:12:28 +0000
commit5986c5c6ad02ecd052cbb4c8e581cb4bccd2e624 (patch)
treebe6b7242920671fe1bb2cb8093c183004c0dbe35
parent23ae1f25aa2070d7a3d0d28ca95897b2e4747baa (diff)
downloademacs-5986c5c6ad02ecd052cbb4c8e581cb4bccd2e624.tar.gz
emacs-5986c5c6ad02ecd052cbb4c8e581cb4bccd2e624.zip
(doc-view-doc->txt, doc-view-convert-current-doc):
Create cache dir only if it doesn't already exist.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/doc-view.el8
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7d3a16bde9b..93edc4addcd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-03-13 Tassilo Horn <tassilo@member.fsf.org>
2
3 * doc-view.el (doc-view-doc->txt, doc-view-convert-current-doc):
4 Create cache dir only if it doesn't already exist.
5
12008-03-13 Stefan Monnier <monnier@iro.umontreal.ca> 62008-03-13 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * progmodes/sh-script.el (sh-font-lock-quoted-subshell): Fix handling 8 * progmodes/sh-script.el (sh-font-lock-quoted-subshell): Fix handling
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 0ffc0471024..8c5fad4c3f0 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -600,7 +600,8 @@ Should be invoked when the cached images aren't up-to-date."
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 (make-directory (doc-view-current-cache-dir)) 603 (unless (file-exists-p (doc-view-current-cache-dir))
604 (make-directory (doc-view-current-cache-dir)))
604 (case doc-view-doc-type 605 (case doc-view-doc-type
605 (pdf 606 (pdf
606 ;; Doc is a PDF, so convert it to TXT 607 ;; Doc is a PDF, so convert it to TXT
@@ -649,7 +650,8 @@ Those files are saved in the directory given by the function
649 (setq doc-view-pending-cache-flush t) 650 (setq doc-view-pending-cache-flush t)
650 (let ((png-file (expand-file-name "page-%d.png" 651 (let ((png-file (expand-file-name "page-%d.png"
651 (doc-view-current-cache-dir)))) 652 (doc-view-current-cache-dir))))
652 (make-directory (doc-view-current-cache-dir)) 653 (unless (file-exists-p (doc-view-current-cache-dir))
654 (make-directory (doc-view-current-cache-dir)))
653 (case doc-view-doc-type 655 (case doc-view-doc-type
654 (dvi 656 (dvi
655 ;; DVI files have to be converted to PDF before Ghostscript can process 657 ;; DVI files have to be converted to PDF before Ghostscript can process
@@ -1036,7 +1038,7 @@ toggle between displaying the document or editing it as text.
1036 name-types content-types)) 1038 name-types content-types))
1037 name-types content-types 1039 name-types content-types
1038 (error "Cannot determine the document type"))))) 1040 (error "Cannot determine the document type")))))
1039 1041
1040 (doc-view-make-safe-dir doc-view-cache-directory) 1042 (doc-view-make-safe-dir doc-view-cache-directory)
1041 ;; Handle compressed files, remote files, files inside archives 1043 ;; Handle compressed files, remote files, files inside archives
1042 (set (make-local-variable 'doc-view-buffer-file-name) 1044 (set (make-local-variable 'doc-view-buffer-file-name)