Mercurial > emacs
changeset 92879:4486b0175a46
(doc-view-doc->txt, doc-view-convert-current-doc):
Create cache dir only if it doesn't already exist.
author | Tassilo Horn <tassilo@member.fsf.org> |
---|---|
date | Thu, 13 Mar 2008 18:11:37 +0000 |
parents | 0d903db06886 |
children | e82973d88bca |
files | lisp/doc-view.el |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/doc-view.el Thu Mar 13 14:34:20 2008 +0000 +++ b/lisp/doc-view.el Thu Mar 13 18:11:37 2008 +0000 @@ -600,7 +600,8 @@ (defun doc-view-doc->txt (txt callback) "Convert the current document to text and call CALLBACK when done." - (make-directory (doc-view-current-cache-dir)) + (unless (file-exists-p (doc-view-current-cache-dir)) + (make-directory (doc-view-current-cache-dir))) (case doc-view-doc-type (pdf ;; Doc is a PDF, so convert it to TXT @@ -649,7 +650,8 @@ (setq doc-view-pending-cache-flush t) (let ((png-file (expand-file-name "page-%d.png" (doc-view-current-cache-dir)))) - (make-directory (doc-view-current-cache-dir)) + (unless (file-exists-p (doc-view-current-cache-dir)) + (make-directory (doc-view-current-cache-dir))) (case doc-view-doc-type (dvi ;; DVI files have to be converted to PDF before Ghostscript can process @@ -1036,7 +1038,7 @@ name-types content-types)) name-types content-types (error "Cannot determine the document type"))))) - + (doc-view-make-safe-dir doc-view-cache-directory) ;; Handle compressed files, remote files, files inside archives (set (make-local-variable 'doc-view-buffer-file-name)