* Summary name problem
@ 1996-11-18 20:19 Loren Schall
1996-11-18 20:42 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Loren Schall @ 1996-11-18 20:19 UTC (permalink / raw)
Hi,
I found a minor glitch in the way gnus-sum parses the From line of a
message to fill in the name part of a summary line. If the From line
looks like:
From: "Loren Schall (x5994)" <schall@ateng.honeywell.com>
the summary line looks something like:
[ 0: +x5994 ] Re: Summary name problem
This is because it does a real simple address parse, looking first for
parentheses then for angle brackets. I inverted the test (checking for
angle brackets first, then parentheses). I'm not sure this is the Right
Thing (tm), but it seems to work for me.
Loren Schall
schall@ateng.az.honeywell.com
My patch follows:
*** lisp/gnus-sum.el.orig Tue Oct 15 16:34:48 1996
--- lisp/gnus-sum.el Wed Oct 16 14:06:04 1996
***************
*** 2468,2482 ****
(gnus-tmp-from (mail-header-from gnus-tmp-header))
(gnus-tmp-name
(cond
- ((string-match "(.+)" gnus-tmp-from)
- (substring gnus-tmp-from
- (1+ (match-beginning 0)) (1- (match-end 0))))
((string-match "<[^>]+> *$" gnus-tmp-from)
(let ((beg (match-beginning 0)))
(or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
(substring gnus-tmp-from (1+ (match-beginning 0))
(1- (match-end 0))))
(substring gnus-tmp-from 0 beg))))
(t gnus-tmp-from)))
(gnus-tmp-subject (mail-header-subject gnus-tmp-header))
(gnus-tmp-number (mail-header-number gnus-tmp-header))
--- 2468,2482 ----
(gnus-tmp-from (mail-header-from gnus-tmp-header))
(gnus-tmp-name
(cond
((string-match "<[^>]+> *$" gnus-tmp-from)
(let ((beg (match-beginning 0)))
(or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
(substring gnus-tmp-from (1+ (match-beginning 0))
(1- (match-end 0))))
(substring gnus-tmp-from 0 beg))))
+ ((string-match "(.+)" gnus-tmp-from)
+ (substring gnus-tmp-from
+ (1+ (match-beginning 0)) (1- (match-end 0))))
(t gnus-tmp-from)))
(gnus-tmp-subject (mail-header-subject gnus-tmp-header))
(gnus-tmp-number (mail-header-number gnus-tmp-header))
***************
*** 3543,3557 ****
gnus-tmp-from (mail-header-from gnus-tmp-header)
gnus-tmp-name
(cond
- ((string-match "(.+)" gnus-tmp-from)
- (substring gnus-tmp-from
- (1+ (match-beginning 0)) (1- (match-end 0))))
((string-match "<[^>]+> *$" gnus-tmp-from)
(setq beg-match (match-beginning 0))
(or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
(substring gnus-tmp-from (1+ (match-beginning 0))
(1- (match-end 0))))
(substring gnus-tmp-from 0 beg-match)))
(t gnus-tmp-from)))
(when (string= gnus-tmp-name "")
(setq gnus-tmp-name gnus-tmp-from))
--- 3543,3557 ----
gnus-tmp-from (mail-header-from gnus-tmp-header)
gnus-tmp-name
(cond
((string-match "<[^>]+> *$" gnus-tmp-from)
(setq beg-match (match-beginning 0))
(or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
(substring gnus-tmp-from (1+ (match-beginning 0))
(1- (match-end 0))))
(substring gnus-tmp-from 0 beg-match)))
+ ((string-match "(.+)" gnus-tmp-from)
+ (substring gnus-tmp-from
+ (1+ (match-beginning 0)) (1- (match-end 0))))
(t gnus-tmp-from)))
(when (string= gnus-tmp-name "")
(setq gnus-tmp-name gnus-tmp-from))
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Summary name problem
1996-11-18 20:19 Summary name problem Loren Schall
@ 1996-11-18 20:42 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-11-18 20:42 UTC (permalink / raw)
Loren Schall <schall@saifr00.ateng.az.honeywell.com> writes:
> I found a minor glitch in the way gnus-sum parses the From line of a
> message to fill in the name part of a summary line. If the From line
> looks like:
>
> From: "Loren Schall (x5994)" <schall@ateng.honeywell.com>
>
> the summary line looks something like:
>
> [ 0: +x5994 ] Re: Summary name problem
If you want proper parsing, then set `gnus-extract-address-components'
to `mail-extract-address-components'.
> This is because it does a real simple address parse, looking first for
> parentheses then for angle brackets. I inverted the test (checking for
> angle brackets first, then parentheses). I'm not sure this is the Right
> Thing (tm), but it seems to work for me.
Well, why not? I've applied your patch to 0.64.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@ifi.uio.no * Lars Ingebrigtsen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-11-18 20:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-18 20:19 Summary name problem Loren Schall
1996-11-18 20:42 ` Lars Magne Ingebrigtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).