comparison lisp/gnus/gnus-util.el @ 90667:dbe3f29e61d6

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 505-522) - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: etc/TUTORIAL.cn: Updated. - Merge from erc--emacs--22 * gnus--rel--5.10 (patch 164-167) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-137
author Miles Bader <miles@gnu.org>
date Tue, 21 Nov 2006 08:56:38 +0000
parents 8dd8c8286063 234305495123
children 95d0cdf160ea
comparison
equal deleted inserted replaced
90666:00d54c8fa693 90667:dbe3f29e61d6
200 is slower." 200 is slower."
201 (let (name address) 201 (let (name address)
202 ;; First find the address - the thing with the @ in it. This may 202 ;; First find the address - the thing with the @ in it. This may
203 ;; not be accurate in mail addresses, but does the trick most of 203 ;; not be accurate in mail addresses, but does the trick most of
204 ;; the time in news messages. 204 ;; the time in news messages.
205 (when (string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from) 205 (cond (;; Check ``<foo@bar>'' first in order to handle the quite common
206 (setq address (substring from (match-beginning 0) (match-end 0)))) 206 ;; form ``"abc@xyz" <foo@bar>'' (i.e. ``@'' as part of a comment)
207 ;; correctly.
208 (string-match "<\\([^@ \t<>]+[!@][^@ \t<>]+\\)>" from)
209 (setq address (substring from (match-beginning 1) (match-end 1))))
210 ((string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
211 (setq address (substring from (match-beginning 0) (match-end 0)))))
207 ;; Then we check whether the "name <address>" format is used. 212 ;; Then we check whether the "name <address>" format is used.
208 (and address 213 (and address
209 ;; Linear white space is not required. 214 ;; Linear white space is not required.
210 (string-match (concat "[ \t]*<" (regexp-quote address) ">") from) 215 (string-match (concat "[ \t]*<" (regexp-quote address) ">") from)
211 (and (setq name (substring from 0 (match-beginning 0))) 216 (and (setq name (substring from 0 (match-beginning 0)))