(gnus-extract-address-components): Work with address in which the name portion
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Nov 2006 23:41:07 +0000 (23:41 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Nov 2006 23:41:07 +0000 (23:41 +0000)
 contains @.

lisp/ChangeLog
lisp/gnus-util.el

index 322e894..607b28a 100644 (file)
@@ -1,5 +1,8 @@
 2006-11-14  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * gnus-util.el (gnus-extract-address-components): Work with address in
+       which the name portion contains @.
+
        * lpath.el: Fbind custom-autoload.
 
 2006-11-14  Reiner Steib  <Reiner.Steib@gmx.de>
index b8a8d98..4f5d108 100644 (file)
@@ -173,8 +173,12 @@ is slower."
     ;; First find the address - the thing with the @ in it.  This may
     ;; not be accurate in mail addresses, but does the trick most of
     ;; the time in news messages.
-    (when (string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
-      (setq address (substring from (match-beginning 0) (match-end 0))))
+    (cond (;; Special case: "foo@bar" <foo@bar>, i.e. one @ in the comment
+          ;; and one in the address.
+          (string-match "<\\([^@ \t<>]+[!@][^@ \t<>]+\\)>" from)
+          (setq address (substring from (match-beginning 1) (match-end 1))))
+         ((string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
+          (setq address (substring from (match-beginning 0) (match-end 0)))))
     ;; Then we check whether the "name <address>" format is used.
     (and address
         ;; Linear white space is not required.