diff options
| author | Daiki Ueno | 2010-10-26 10:31:27 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2010-10-26 10:31:27 +0900 |
| commit | 6ee7927589ecc3e7fa058e1d2d9e3ae299ea068b (patch) | |
| tree | 7d29c27e8343878661fa319e105d4584aeebfbe8 | |
| parent | 77ec02d8fdf1da79e1774dc6e20dedabd065bbe9 (diff) | |
| download | emacs-6ee7927589ecc3e7fa058e1d2d9e3ae299ea068b.tar.gz emacs-6ee7927589ecc3e7fa058e1d2d9e3ae299ea068b.zip | |
Make epa-mail-encrypt expand mail aliases.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/epa-mail.el | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 723bb8d5c1b..4e9b62ed200 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | 2010-10-26 Daiki Ueno <ueno@unixuser.org> | 1 | 2010-10-26 Daiki Ueno <ueno@unixuser.org> |
| 2 | 2 | ||
| 3 | * epa-mail.el (epa-mail-encrypt): Handle local-part only | 3 | * epa-mail.el (epa-mail-encrypt): Handle local-part only |
| 4 | recipients (Bug#7280). | 4 | recipients; expand mail aliases (Bug#7280). |
| 5 | 5 | ||
| 6 | 2010-10-25 Glenn Morris <rgm@gnu.org> | 6 | 2010-10-25 Glenn Morris <rgm@gnu.org> |
| 7 | 7 | ||
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index 2b29e80daa5..ab47cbf60bc 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el | |||
| @@ -117,23 +117,29 @@ Don't use this command in Lisp programs!" | |||
| 117 | (save-excursion | 117 | (save-excursion |
| 118 | (let ((verbose current-prefix-arg) | 118 | (let ((verbose current-prefix-arg) |
| 119 | (context (epg-make-context epa-protocol)) | 119 | (context (epg-make-context epa-protocol)) |
| 120 | recipients recipient-key) | 120 | recipients-string recipients recipient-key) |
| 121 | (goto-char (point-min)) | 121 | (goto-char (point-min)) |
| 122 | (save-restriction | 122 | (save-restriction |
| 123 | (narrow-to-region (point) | 123 | (narrow-to-region (point) |
| 124 | (if (search-forward mail-header-separator nil 0) | 124 | (if (search-forward mail-header-separator nil 0) |
| 125 | (match-beginning 0) | 125 | (match-beginning 0) |
| 126 | (point))) | 126 | (point))) |
| 127 | (setq recipients-string | ||
| 128 | (mapconcat #'identity | ||
| 129 | (nconc (mail-fetch-field "to" nil nil t) | ||
| 130 | (mail-fetch-field "cc" nil nil t) | ||
| 131 | (mail-fetch-field "bcc" nil nil t)) | ||
| 132 | ",")) | ||
| 127 | (setq recipients | 133 | (setq recipients |
| 128 | (mail-strip-quoted-names | 134 | (mail-strip-quoted-names |
| 129 | (mapconcat #'identity | 135 | (with-temp-buffer |
| 130 | (nconc (mail-fetch-field "to" nil nil t) | 136 | (insert "to: " recipients-string "\n") |
| 131 | (mail-fetch-field "cc" nil nil t) | 137 | (expand-mail-aliases (point-min) (point-max)) |
| 132 | (mail-fetch-field "bcc" nil nil t)) | 138 | (car (mail-fetch-field "to" nil nil t)))))) |
| 133 | ",")))) | ||
| 134 | (if recipients | 139 | (if recipients |
| 135 | (setq recipients (delete "" | 140 | (setq recipients (delete "" |
| 136 | (split-string recipients "[ \t\n]+")))) | 141 | (split-string recipients |
| 142 | "[ \t\n]*,[ \t\n]*")))) | ||
| 137 | (goto-char (point-min)) | 143 | (goto-char (point-min)) |
| 138 | (if (search-forward mail-header-separator nil t) | 144 | (if (search-forward mail-header-separator nil t) |
| 139 | (forward-line)) | 145 | (forward-line)) |