+2007-07-17 Daiki Ueno <ueno@unixuser.org>
+
+ * 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 <jgresula@gmail.com>
+
2007-07-10 Daiki Ueno <ueno@unixuser.org>
* epa.el: Removed -face suffix from face names;
(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
(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))