(if (fboundp 'epa-file-name-regexp-update)
(epa-file-name-regexp-update)))
-(defcustom epa-file-name-regexp "\\.gpg\\(~\\|\\.~[.0-9]+~\\)?\\'"
+(defcustom epa-file-name-regexp "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'"
"Regexp which matches filenames to be encrypted with GnuPG.
If you set this outside Custom while epa-file is already enabled, you
(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
+ (condition-case inl
+ (epa-file-run-real-handler #'file-local-copy (list file))
+ (error)))
+ (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))