diff options
| author | Glenn Morris | 2017-02-13 23:36:17 -0800 |
|---|---|---|
| committer | Glenn Morris | 2017-02-13 23:36:17 -0800 |
| commit | 3f383a4668e6b9e45067389c997a5b1f4cddd3fd (patch) | |
| tree | e9027f087aef56d5a5ae731da7f5b7fa29ae3ea0 | |
| parent | 31b4d9a13741caae2422636d4944212e702b19c3 (diff) | |
| download | emacs-3f383a4668e6b9e45067389c997a5b1f4cddd3fd.tar.gz emacs-3f383a4668e6b9e45067389c997a5b1f4cddd3fd.zip | |
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.
| -rw-r--r-- | doc/misc/message.texi | 4 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 2 | ||||
| -rw-r--r-- | lisp/mail/mail-utils.el | 22 |
3 files changed, 10 insertions, 18 deletions
diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 27a159d4a9a..bbdef4a8629 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi | |||
| @@ -185,8 +185,8 @@ but you can change the behavior to suit your needs by fiddling with the | |||
| 185 | @vindex message-dont-reply-to-names | 185 | @vindex message-dont-reply-to-names |
| 186 | Addresses that match the @code{message-dont-reply-to-names} regular | 186 | Addresses that match the @code{message-dont-reply-to-names} regular |
| 187 | expression (or list of regular expressions or a predicate function) | 187 | expression (or list of regular expressions or a predicate function) |
| 188 | will be removed from the @code{Cc} header. A value of @code{nil} means | 188 | will be removed from the @code{Cc} header. A value of @code{nil} means |
| 189 | exclude your name only. | 189 | to exclude only your email address. |
| 190 | 190 | ||
| 191 | @vindex message-prune-recipient-rules | 191 | @vindex message-prune-recipient-rules |
| 192 | @code{message-prune-recipient-rules} is used to prune the addresses | 192 | @code{message-prune-recipient-rules} is used to prune the addresses |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ce0dad9cb05..28192691228 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -1358,7 +1358,7 @@ If nil, you might be asked to input the charset." | |||
| 1358 | (defcustom message-dont-reply-to-names mail-dont-reply-to-names | 1358 | (defcustom message-dont-reply-to-names mail-dont-reply-to-names |
| 1359 | "Addresses to prune when doing wide replies. | 1359 | "Addresses to prune when doing wide replies. |
| 1360 | This can be a regexp, a list of regexps or a predicate function. | 1360 | This can be a regexp, a list of regexps or a predicate function. |
| 1361 | Also, a value of nil means exclude your own user name only. | 1361 | Also, a value of nil means exclude `user-mail-address' only. |
| 1362 | 1362 | ||
| 1363 | If a function email is passed as the argument." | 1363 | If a function email is passed as the argument." |
| 1364 | :version "24.3" | 1364 | :version "24.3" |
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." | |||
| 237 | ;; Or just set the default directly in the defcustom. | 237 | ;; Or just set the default directly in the defcustom. |
| 238 | (if (null mail-dont-reply-to-names) | 238 | (if (null mail-dont-reply-to-names) |
| 239 | (setq mail-dont-reply-to-names | 239 | (setq mail-dont-reply-to-names |
| 240 | (concat | ||
| 241 | ;; `rmail-default-dont-reply-to-names' is obsolete. | 240 | ;; `rmail-default-dont-reply-to-names' is obsolete. |
| 242 | (if (bound-and-true-p rmail-default-dont-reply-to-names) | 241 | (let ((a (bound-and-true-p rmail-default-dont-reply-to-names)) |
| 243 | (concat rmail-default-dont-reply-to-names "\\|") | 242 | (b (if (> (length user-mail-address) 0) |
| 244 | "") | 243 | (concat "\\`" (regexp-quote user-mail-address) "\\'")))) |
| 245 | (if (and user-mail-address | 244 | (cond ((and a b) (concat a "\\|" b)) |
| 246 | (not (equal user-mail-address user-login-name))) | 245 | ((or a b)))))) |
| 247 | ;; Anchor the login name and email address so that we | ||
| 248 | ;; don't match substrings: if the login name is | ||
| 249 | ;; "foo", we shouldn't match "barfoo@baz.com". | ||
| 250 | (concat "\\`" | ||
| 251 | (regexp-quote user-mail-address) | ||
| 252 | "\\'\\|") | ||
| 253 | "") | ||
| 254 | (concat "\\`" (regexp-quote user-login-name) "@")))) | ||
| 255 | ;; Split up DESTINATIONS and match each element separately. | 246 | ;; Split up DESTINATIONS and match each element separately. |
| 256 | (let ((start-pos 0) (cur-pos 0) | 247 | (let ((start-pos 0) (cur-pos 0) |
| 257 | (case-fold-search t)) | 248 | (case-fold-search t)) |
| @@ -271,7 +262,8 @@ comma-separated list, and return the pruned list." | |||
| 271 | (setq cur-pos start-pos))) | 262 | (setq cur-pos start-pos))) |
| 272 | (let* ((address (substring destinations start-pos cur-pos)) | 263 | (let* ((address (substring destinations start-pos cur-pos)) |
| 273 | (naked-address (mail-strip-quoted-names address))) | 264 | (naked-address (mail-strip-quoted-names address))) |
| 274 | (if (string-match mail-dont-reply-to-names naked-address) | 265 | (if (and mail-dont-reply-to-names |
| 266 | (string-match mail-dont-reply-to-names naked-address)) | ||
| 275 | (setq destinations (concat (substring destinations 0 start-pos) | 267 | (setq destinations (concat (substring destinations 0 start-pos) |
| 276 | (and cur-pos (substring destinations | 268 | (and cur-pos (substring destinations |
| 277 | (1+ cur-pos)))) | 269 | (1+ cur-pos)))) |