2007-01-05 Daiki Ueno <ueno@unixuser.org>
+ * pgg-epg.el (pgg-epg-encrypt-region): Ask a user whether to skip a
+ recipient whose public key is not available.
* epa.el (epa-encrypt-mail): Ask a user whether to skip a
recipient whose public key is not available.
passphrase cache or user."
(let ((context (epg-make-context))
(inhibit-redisplay t) ;Gnus users don't like flickering
- cipher)
+ cipher recipient-keys)
(epg-context-set-armor context t)
(epg-context-set-textmode context pgg-text-mode)
(epg-context-set-passphrase-callback context #'pgg-epg-passphrase-callback)
(erase-buffer))
(condition-case error
(setq cipher
- (epg-encrypt-string context
- (buffer-substring start end)
- (mapcar
- (lambda (recipient)
- (car (epg-list-keys context recipient)))
- (if pgg-encrypt-for-me
- (cons pgg-default-user-id recipients)
- recipients))
- sign t)
+ (epg-encrypt-string
+ context
+ (buffer-substring start end)
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (setq recipient-keys
+ (epg-list-keys context recipient))
+ (unless (or recipient-keys
+ (y-or-n-p
+ (format "No public key for %s; skip it? "
+ recipient)))
+ (error "No public key for %s" recipient))
+ recipient-keys)
+ (if pgg-encrypt-for-me
+ (cons pgg-default-user-id recipients)
+ recipients)))
+ sign t)
pgg-epg-secret-key-id-list nil)
(error
(while pgg-epg-secret-key-id-list