From c33198f7975b21fac0cf2075f075adb7ade688a5 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 17 Jul 2007 02:02:06 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 ++++++ epa-file.el | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) 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)) -- 1.7.10.4