]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-extr-ignore-realname-equals-mailbox-name): New defcustom.
authorEli Zaretskii <eliz@gnu.org>
Fri, 8 Oct 2004 17:53:18 +0000 (17:53 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 8 Oct 2004 17:53:18 +0000 (17:53 +0000)
(extract-address-components): Use it.

lisp/ChangeLog
lisp/mail/mail-extr.el

index 5f6bdb7f99ce2da2d317c55ed544f0e24d47455e..99e32010afd274320c9cb20a9acf6b3a4e1d3e66 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-08  Sebastien Kirche  <seki@seki.fr>  (tiny change)
+
+       * mail/mail-extr.el (mail-extr-ignore-realname-equals-mailbox-name):
+       New defcustom.
+       (extract-address-components): Use it.
+
 2004-10-08  Paul Pogonyshev  <pogonyshev@gmx.net>
 
        * subr.el (make-progress-reporter, progress-reporter-update)
index 675444d7ba4dc9099281a98f721d61214a9665b4..b7521ad8e915b1ea7805f758336160b049d6c205 100644 (file)
@@ -234,6 +234,13 @@ we will act as though we couldn't find a full name in the address."
   :version "21.4"
   :group 'mail-extr)
 
+(defcustom mail-extr-ignore-realname-equals-mailbox-name t
+"*Whether to ignore a name that is equal to the mailbox name.
+If true, then when the address is like \"Single <single@address.com>\"
+we will act as though we couldn't find a full name in the address."
+  :type 'boolean
+  :group 'mail-extr)
+
 ;; Matches a leading title that is not part of the name (does not
 ;; contribute to uniquely identifying the person).
 (defcustom mail-extr-full-name-prefixes
@@ -694,7 +701,7 @@ Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
   "Given an RFC-822 address ADDRESS, extract full name and canonical address.
 Returns a list of the form (FULL-NAME CANONICAL-ADDRESS).
 If no name can be extracted, FULL-NAME will be nil.  Also see
-`mail-extr-ignore-single-names'.
+`mail-extr-ignore-single-names' and `mail-extr-ignore-realname-equals-mailbox-name'.
 
 If the optional argument ALL is non-nil, then ADDRESS can contain zero
 or more recipients, separated by commas, and we return a list of
@@ -1404,8 +1411,9 @@ consing a string.)"
                    (setq names-match-flag nil))
                (setq i (1+ i)))
              (delete-region (+ (point-min) buffer-length) (point-max))
-             (if names-match-flag
-                 (narrow-to-region (point) (point)))))
+             (and names-match-flag 
+                          mail-extr-ignore-realname-equals-mailbox-name
+                          (narrow-to-region (point) (point)))))
 
          ;; Nuke name if it's just one word.
          (goto-char (point-min))