X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/2c302df3a13236bfbf8ea1b771d13618fcda8d71..22bcf2046977620a7f37bbd4dff4be4a4fffc0ed:/lisp/epa-mail.el diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index ab47cbf60b..9d7542b398 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -1,5 +1,5 @@ -;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -*- lexical-binding: t -*- +;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Keywords: PGP, GnuPG, mail, message @@ -51,7 +51,8 @@ nil " epa-mail" epa-mail-mode-map) (defun epa-mail--find-usable-key (keys usage) - "Find a usable key from KEYS for USAGE." + "Find a usable key from KEYS for USAGE. +USAGE would be `sign' or `encrypt'." (catch 'found (while keys (let ((pointer (epg-key-sub-key-list (car keys)))) @@ -116,8 +117,9 @@ Don't use this command in Lisp programs!" (interactive (save-excursion (let ((verbose current-prefix-arg) + (config (epg-configuration)) (context (epg-make-context epa-protocol)) - recipients-string recipients recipient-key) + recipients-string recipients recipient-key sign) (goto-char (point-min)) (save-restriction (narrow-to-region (point) @@ -140,6 +142,17 @@ Don't use this command in Lisp programs!" (setq recipients (delete "" (split-string recipients "[ \t\n]*,[ \t\n]*")))) + + ;; Process all the recipients thru the list of GnuPG groups. + ;; Expand GnuPG group names to what they stand for. + (setq recipients + (apply #'nconc + (mapcar + (lambda (recipient) + (or (epg-expand-group config recipient) + (list recipient))) + recipients))) + (goto-char (point-min)) (if (search-forward mail-header-separator nil t) (forward-line)) @@ -197,5 +210,4 @@ Don't use this command in Lisp programs!" (provide 'epa-mail) -;; arch-tag: a6f82b3f-d177-4a11-af95-040da55927d2 ;;; epa-mail.el ends here