]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove overly broad element from default mail-dont-reply-to-names
authorGlenn Morris <rgm@gnu.org>
Tue, 14 Feb 2017 07:36:17 +0000 (23:36 -0800)
committerGlenn Morris <rgm@gnu.org>
Tue, 14 Feb 2017 07:36:17 +0000 (23:36 -0800)
* 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.

doc/misc/message.texi
lisp/gnus/message.el
lisp/mail/mail-utils.el

index 27a159d4a9ad244d95b724ec1726db91d40011d2..bbdef4a8629754702718b883a3313348f37cd232 100644 (file)
@@ -185,8 +185,8 @@ but you can change the behavior to suit your needs by fiddling with the
 @vindex message-dont-reply-to-names
 Addresses that match the @code{message-dont-reply-to-names} regular
 expression (or list of regular expressions or a predicate function)
-will be removed from the @code{Cc} header. A value of @code{nil} means
-exclude your name only.
+will be removed from the @code{Cc} header.  A value of @code{nil} means
+to exclude only your email address.
 
 @vindex message-prune-recipient-rules
 @code{message-prune-recipient-rules} is used to prune the addresses
index ce0dad9cb0509d1a3e29ace8080d7003a38a2c1e..28192691228385f4cb154de6d98ff1aca95f38bd 100644 (file)
@@ -1358,7 +1358,7 @@ If nil, you might be asked to input the charset."
 (defcustom message-dont-reply-to-names mail-dont-reply-to-names
   "Addresses to prune when doing wide replies.
 This can be a regexp, a list of regexps or a predicate function.
-Also, a value of nil means exclude your own user name only.
+Also, a value of nil means exclude `user-mail-address' only.
 
 If a function email is passed as the argument."
   :version "24.3"
index 3cadf12af1f0fb5fa3c53971f023f691a968945a..c23af873650a63ca858a2f1fe90e8ada952a4aa1 100644 (file)
@@ -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))))