:type 'regexp
:group 'epa-file)
-(defvar epa-passphrase-alist nil)
+(defvar epa-file-passphrase-alist nil)
-(defun epa-file-passphrase-callback-function (key-id buffer)
+(defun epa-file-passphrase-callback-function (key-id file)
(if (eq key-id 'SYM)
- (let ((entry (assoc buffer epa-passphrase-alist))
+ (let ((entry (assoc file epa-file-passphrase-alist))
passphrase)
- (or (cdr entry)
+ (or (copy-sequence (cdr entry))
(progn
(unless entry
- (setq entry (list buffer)
- epa-passphrase-alist (cons entry
- epa-passphrase-alist)))
+ (setq entry (list file)
+ epa-file-passphrase-alist (cons entry
+ epa-file-passphrase-alist)))
(setq passphrase (epg-passphrase-callback-function key-id nil))
(setcdr entry (copy-sequence passphrase))
passphrase)))
(epg-context-set-passphrase-callback
context
(cons #'epa-file-passphrase-callback-function
- (current-buffer)))
+ file))
(unwind-protect
(progn
(if replace
(epg-context-set-passphrase-callback
context
(cons #'epa-file-passphrase-callback-function
- (current-buffer)))
+ file))
(epa-file-run-real-handler
#'write-region
(list (epg-encrypt-string
(encode-coding-string (buffer-string) coding-system)
(mapcar (lambda (key)
(epg-sub-key-id (car (epg-key-sub-key-list key))))
- (unless (assoc (current-buffer) epa-passphrase-alist)
+ (unless (assoc file epa-file-passphrase-alist)
(epa-select-keys
"Select recipents for encryption.
If no one is selected, symmetric encryption will be performed. "))))