From 279188136c694166072226802dd4631e9f00a322 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Tue, 14 Nov 2006 23:41:07 +0000 Subject: [PATCH] (gnus-extract-address-components): Work with address in which the name portion contains @. --- lisp/ChangeLog | 3 +++ lisp/gnus-util.el | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 322e8949a..607b28a96 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2006-11-14 Katsumi Yamaoka + * 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 diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index b8a8d9820..4f5d108aa 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -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" , 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
" format is used. (and address ;; Linear white space is not required. -- 2.25.1