diff options
author | Glenn Morris <rgm@gnu.org> | 2017-02-13 23:36:17 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2017-02-13 23:36:17 -0800 |
commit | 3f383a4668e6b9e45067389c997a5b1f4cddd3fd (patch) | |
tree | e9027f087aef56d5a5ae731da7f5b7fa29ae3ea0 /lisp/mail | |
parent | 31b4d9a13741caae2422636d4944212e702b19c3 (diff) | |
download | emacs-3f383a4668e6b9e45067389c997a5b1f4cddd3fd.tar.gz |
Remove overly broad element from default mail-dont-reply-to-names
* lisp/mail/mail-utils.el (mail-dont-reply-to):
Do not include just "user@" in mail-dont-reply-to-names, and simplify.
Ref: lists.gnu.org/archive/html/help-gnu-emacs/2017-02/msg00049.html
* lisp/gnus/message.el (message-dont-reply-to-names): Doc fix.
* doc/misc/message.texi (Wide Reply): Tiny fix re dont-reply-to-names.
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/mail-utils.el | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 3cadf12af1f..c23af873650 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -237,21 +237,12 @@ comma-separated list, and return the pruned list." ;; Or just set the default directly in the defcustom. (if (null mail-dont-reply-to-names) (setq mail-dont-reply-to-names - (concat ;; `rmail-default-dont-reply-to-names' is obsolete. - (if (bound-and-true-p rmail-default-dont-reply-to-names) - (concat rmail-default-dont-reply-to-names "\\|") - "") - (if (and user-mail-address - (not (equal user-mail-address user-login-name))) - ;; Anchor the login name and email address so that we - ;; don't match substrings: if the login name is - ;; "foo", we shouldn't match "barfoo@baz.com". - (concat "\\`" - (regexp-quote user-mail-address) - "\\'\\|") - "") - (concat "\\`" (regexp-quote user-login-name) "@")))) + (let ((a (bound-and-true-p rmail-default-dont-reply-to-names)) + (b (if (> (length user-mail-address) 0) + (concat "\\`" (regexp-quote user-mail-address) "\\'")))) + (cond ((and a b) (concat a "\\|" b)) + ((or a b)))))) ;; Split up DESTINATIONS and match each element separately. (let ((start-pos 0) (cur-pos 0) (case-fold-search t)) @@ -271,7 +262,8 @@ comma-separated list, and return the pruned list." (setq cur-pos start-pos))) (let* ((address (substring destinations start-pos cur-pos)) (naked-address (mail-strip-quoted-names address))) - (if (string-match mail-dont-reply-to-names naked-address) + (if (and mail-dont-reply-to-names + (string-match mail-dont-reply-to-names naked-address)) (setq destinations (concat (substring destinations 0 start-pos) (and cur-pos (substring destinations (1+ cur-pos)))) |