From: ueno Date: Tue, 17 Jul 2007 02:02:06 +0000 (+0000) Subject: * epa-file.el (epa-file-insert-file-contents): If a file is not X-Git-Tag: epg-0_0_14~5 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c33198f7975b21fac0cf2075f075adb7ade688a5;p=elisp%2Fepg.git * epa-file.el (epa-file-insert-file-contents): If a file is not directly accessible, use the local copy of the file. Reported by Jaroslav Gresula --- diff --git a/ChangeLog b/ChangeLog index 11688a5..fb25d2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-17 Daiki Ueno + + * epa-file.el (epa-file-insert-file-contents): If a file is not + directly accessible, use the local copy of the file. + Reported by Jaroslav Gresula + 2007-07-10 Daiki Ueno * epa.el: Removed -face suffix from face names; diff --git a/epa-file.el b/epa-file.el index 7eae34e..66ed5b9 100644 --- a/epa-file.el +++ b/epa-file.el @@ -152,15 +152,16 @@ May either be a string or a list of strings.") (if (and visit (or beg end)) (error "Attempt to visit less than an entire file")) (setq file (expand-file-name file)) - (let ((local-copy (epa-file-run-real-handler #'file-local-copy (list file))) - (context (epg-make-context)) - string length entry) + (let* ((local-copy (epa-file-run-real-handler #'file-local-copy (list file))) + (local-file (or local-copy file)) + (context (epg-make-context)) + string length entry) (if visit (setq buffer-file-name file)) (epg-context-set-passphrase-callback context (cons #'epa-file-passphrase-callback-function - file)) + local-file)) (epg-context-set-progress-callback context #'epa-progress-callback-function) (unwind-protect @@ -168,7 +169,7 @@ May either be a string or a list of strings.") (if replace (goto-char (point-min))) (condition-case error - (setq string (epg-decrypt-file context file nil)) + (setq string (epg-decrypt-file context local-file nil)) (error (if (setq entry (assoc file epa-file-passphrase-alist)) (setcdr entry nil))