Gnus development mailing list
 help / color / mirror / Atom feed
From: Loren Schall <schall@saifr00.ateng.az.honeywell.com>
Subject: Summary name problem
Date: 18 Nov 1996 13:19:42 -0700	[thread overview]
Message-ID: <t7p6833p34x.fsf@saifr00.ateng.az.honeywell.com> (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))


             reply	other threads:[~1996-11-18 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-18 20:19 Loren Schall [this message]
1996-11-18 20:42 ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=t7p6833p34x.fsf@saifr00.ateng.az.honeywell.com \
    --to=schall@saifr00.ateng.az.honeywell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).