Gnus development mailing list
 help / color / mirror / Atom feed
* mail-extract-address-components vs gnus-...
@ 1997-10-26  0:01 Justin Sheehy
  1997-10-30 13:00 ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Justin Sheehy @ 1997-10-26  0:01 UTC (permalink / raw)
  Cc: Gnus development list, info-bbdb

I have come across a few cases where gnus-extract-address-components
will DTRT when returning the full name part of a From: header, but
mail-extract-address-components does not.

Admittedly, these addresses are not stricly correct; the full name
should be quoted.  However, in the spirit of being strict in what you
produce and liberal in what you accept, I submit that
gnus-extract-address-components is the more correct function.

An example:

(gnus-extract-address-components "Dave & Becca <fte@montyweb.com>")
("Dave & Becca" "fte@montyweb.com")

(mail-extract-address-components "Dave & Becca <fte@montyweb.com>")
("Dave Fte Becca" "fte@montyweb.com")

The former is obviously what is intended to be seen.  The latter does
not deal well with this slightly malformed address.

This is being sent to bug-gnu-emacs because I think that th
emaintainers of Emacs ought to consider either incorporating the
function from Gnus or at least amending the one in mail-extr to deal
properly with this sort of thing.

This is being sent to info-bbdb because mail-extr is distributed and
heavily used by BBDB.  I would suggest that if the suggested change is
not made in Emacs, then gnus-bbdb-summary-get-author should be changed
to use gnus-extract-address-components instead of
mail-extract-address-components, a simple drop-in change as far as I
can see.  To save myself the annoyance of seeing such mangled names, I
have already patched my copy of BBDB to do this.

This is being sent to ding because... well, because.

-- 
Justin Sheehy

In a cloud bones of steel.
  


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-26  0:01 mail-extract-address-components vs gnus- Justin Sheehy
@ 1997-10-30 13:00 ` Hrvoje Niksic
  1997-10-30 14:36   ` Justin Sheehy
  0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1997-10-30 13:00 UTC (permalink / raw)


Justin Sheehy <justin@linus.mitre.org> writes:

> (gnus-extract-address-components "Dave & Becca <fte@montyweb.com>")
> ("Dave & Becca" "fte@montyweb.com")
> 
> (mail-extract-address-components "Dave & Becca <fte@montyweb.com>")
> ("Dave Fte Becca" "fte@montyweb.com")

Interestingly enough, this is intentional.  There has been a
discussion regarding this on xemacs-beta mailing list, and the
agreement (confirmed by Jamie Zawinski, the last maintainer of
mail-extr) was that the `&' character was used for denoting the
username.  For instance:

From: & Niksic <hrvoje@foo.bar>

...would be translated as

From: Hrvoje Niksic <hrvoje@foo.bar>

mail-extr does this "properly."

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
4.  Thou shalt not warlorde a sig if it bee the sig of Kibo, nor if
    it bee the sig of the Inner Circle.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 13:00 ` Hrvoje Niksic
@ 1997-10-30 14:36   ` Justin Sheehy
  1997-10-30 22:04     ` Joe Wells
       [not found]     ` <kigd8knjlnp.fsf@jagor.srce.hr>
  0 siblings, 2 replies; 10+ messages in thread
From: Justin Sheehy @ 1997-10-30 14:36 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> Interestingly enough, this is intentional.  

Yup.  I discovered this shortly after I sent that message.

> From: & Niksic <hrvoje@foo.bar>
> 
> ...would be translated as
> 
> From: Hrvoje Niksic <hrvoje@foo.bar>
> 
> mail-extr does this "properly."

I think that "intentional" and "proper" are not the same thing.

See discussion on gnu.emacs.bug.

Yes, I realize that it probably isn't going to change anytime soon, as
that behavior was intentionally caused.  I still think that it is a
rather boneheaded "feature".

-- 
Justin Sheehy

In a cloud bones of steel.
  



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 14:36   ` Justin Sheehy
@ 1997-10-30 22:04     ` Joe Wells
  1997-10-30 22:09       ` Justin Sheehy
                         ` (2 more replies)
       [not found]     ` <kigd8knjlnp.fsf@jagor.srce.hr>
  1 sibling, 3 replies; 10+ messages in thread
From: Joe Wells @ 1997-10-30 22:04 UTC (permalink / raw)
  Cc: ding

>>>>> "Justin" == Justin Sheehy <justin@linus.mitre.org> writes:

  >> From: & Niksic <hrvoje@foo.bar>
  >> 
  >> ...would be translated as
  >> 
  >> From: Hrvoje Niksic <hrvoje@foo.bar>
  >> 
  >> mail-extr does this "properly."

  Justin> I think that "intentional" and "proper" are not the same thing.

  Justin> See discussion on gnu.emacs.bug.

  Justin> Yes, I realize that it probably isn't going to change anytime
  Justin> soon, as that behavior was intentionally caused.  I still think
  Justin> that it is a rather boneheaded "feature".

There is an old UNIX quasi-standard that "&" in the GECOS (full name and
other random information) field of a user's passwd entry stands for their
username capitalized.  Unfortunately, sometimes these escape the local
system without having the "&" replaced.  This happens often enough to make
it worthwhile for mail-extract-address-components to handle it.  It would
be reasonable to restrict this to only do it when the "&" is either at the
beginning or end of the full name part.

-- 
Joe Wells <jbw@dcs.gla.ac.uk>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 22:04     ` Joe Wells
@ 1997-10-30 22:09       ` Justin Sheehy
  1997-10-30 23:10       ` Hrvoje Niksic
  1997-10-31  9:28       ` Per Abrahamsen
  2 siblings, 0 replies; 10+ messages in thread
From: Justin Sheehy @ 1997-10-30 22:09 UTC (permalink / raw)


Joe Wells <jbw@cs.bu.edu> writes:

> There is an old UNIX quasi-standard that "&" in the GECOS (full name and
> other random information) field of a user's passwd entry stands for their
> username capitalized.

Yup.  I am aware of this, I just think that it is a tradition that
should be considered deprecated.  There is no good reason for it
except that a few old systems have "Charlie &" as root's Full Name. 

I'd be more than willing to see the occasional ugly mail from Charlie
&, if it meant that the others looked right.

> It would be reasonable to restrict this to only do it when the "&"
> is either at the beginning or end of the full name part.

Now _that_ is a good idea.

I'm going to look and see within the next couple of days to see just
how hard it will be to fix this in mail-extract-address-components.
If I make a patch, it will definitely behave as you describe.

That ought to fix the ones that currently break without breaking the
older names like Charlie Root.

-- 
Justin Sheehy

In a cloud bones of steel.
  



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 22:04     ` Joe Wells
  1997-10-30 22:09       ` Justin Sheehy
@ 1997-10-30 23:10       ` Hrvoje Niksic
  1997-10-31 15:08         ` Joe Wells
  1997-10-31  9:28       ` Per Abrahamsen
  2 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1997-10-30 23:10 UTC (permalink / raw)


Joe Wells <jbw@cs.bu.edu> writes:

> There is an old UNIX quasi-standard that "&" in the GECOS (full name
> and other random information) field of a user's passwd entry stands
> for their username capitalized.  Unfortunately, sometimes these
> escape the local system without having the "&" replaced.  This
> happens often enough to make it worthwhile for
> mail-extract-address-components to handle it.

Why should `mail-extract-address-components' care about old UNIX
quasi-standards escaping from local systems, really?

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
The end of the world is coming...  SAVE YOUR BUFFERS!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 22:04     ` Joe Wells
  1997-10-30 22:09       ` Justin Sheehy
  1997-10-30 23:10       ` Hrvoje Niksic
@ 1997-10-31  9:28       ` Per Abrahamsen
  2 siblings, 0 replies; 10+ messages in thread
From: Per Abrahamsen @ 1997-10-31  9:28 UTC (permalink / raw)



Joe Wells <jbw@cs.bu.edu> writes:

> This happens often enough to make it worthwhile for
> mail-extract-address-components to handle it.

I don't think this is true.  I have been counting `&' in from headers
in both mail and news archives, and it is far more common that `&'
means `&' than the login name.  Even in older mail archives.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-30 23:10       ` Hrvoje Niksic
@ 1997-10-31 15:08         ` Joe Wells
  1997-10-31 15:13           ` Hrvoje Niksic
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Wells @ 1997-10-31 15:08 UTC (permalink / raw)
  Cc: ding

  >> There is an old UNIX quasi-standard that "&" in the GECOS (full name
  >> and other random information) field of a user's passwd entry stands
  >> for their username capitalized.  Unfortunately, sometimes these
  >> escape the local system without having the "&" replaced.  This
  >> happens often enough to make it worthwhile for
  >> mail-extract-address-components to handle it.

  Hrvoje> Why should `mail-extract-address-components' care about old UNIX
  Hrvoje> quasi-standards escaping from local systems, really?

That's really the main point of it --- to handle all of the weird things
that show up in mail addresses so that we can present this data to the
user in a uniform way, i.e., full name and mailbox address.  Handling just
one weird thing doesn't do much for the users, but the cumulative effect
of handling dozens of different weird things is quite helpful.

-- 
Joe Wells <jbw@dcs.gla.ac.uk>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
  1997-10-31 15:08         ` Joe Wells
@ 1997-10-31 15:13           ` Hrvoje Niksic
  0 siblings, 0 replies; 10+ messages in thread
From: Hrvoje Niksic @ 1997-10-31 15:13 UTC (permalink / raw)
  Cc: ding

Joe Wells <jbw@cs.bu.edu> writes:

>   Hrvoje> Why should `mail-extract-address-components' care about
>   Hrvoje> old UNIX quasi-standards escaping from local systems,
>   Hrvoje> really?
> 
> That's really the main point of it --- to handle all of the weird
> things that show up in mail addresses so that we can present this
> data to the user in a uniform way, i.e., full name and mailbox
> address.  Handling just one weird thing doesn't do much for the
> users, but the cumulative effect of handling dozens of different
> weird things is quite helpful.

Yes, but the `&' Unix "standard" is not supposed to escape from the
local system, is it?  Why should mail-extr damage good addresses, in
favor of buggy old Unix systems?

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Ask not for whom the <CONTROL-G> tolls.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mail-extract-address-components vs gnus-...
       [not found]     ` <kigd8knjlnp.fsf@jagor.srce.hr>
@ 1997-11-03 19:40       ` Justin Sheehy
  0 siblings, 0 replies; 10+ messages in thread
From: Justin Sheehy @ 1997-11-03 19:40 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> My conclusion, too.  If you can produce a patch to mail-extr.el that
> removes this "feature" without breaking anything else, the XEmacers
> will apply it, I think.

Done.  This will leave `&' alone in most cases, instead of
substituting.  In order to make anyone who thinks that we should
perpetuate old UNIX brokenness happy, it will do the substitution iff
the `&' is the last word in the Full Name.

e.g. (with this patch):

(mail-extract-address-components "Charlie & <root@notcom.com>")
("Charlie Root" "root@notcom.com")

(mail-extract-address-components "Charlie & Joe <root@notcom.com>")
("Charlie & Joe" "root@notcom.com")
 
If anyone sees anything wrong with this behavior, or with the patch
itself, please let me know.  Otherwise, I would like to suggest that
this be incorporated into Emacs and XEmacs.

*** mail-extr.el.orig	Mon Nov  3 12:59:15 1997
--- mail-extr.el	Mon Nov  3 14:37:12 1997
***************
*** 118,123 ****
--- 118,127 ----
  
  ;;; Change Log: 
  ;; 
+ ;; Mon Nov  3 14:35:24 1997  Justin Sheehy (justin@linus.mitre.org)
+ ;;
+ ;;      * only substitute for & when at end of Full Name
+ ;;
  ;; Thu Feb 17 17:57:33 1994  Jamie Zawinski (jwz@lucid.com)
  ;;
  ;;	* merged with jbw's latest version
***************
*** 1593,1606 ****
  	 ((and (or (bobp)
  		   (eq ?\  (preceding-char)))
  	       (looking-at "&\\( \\|\\'\\)"))
! 	  (mail-extr-delete-char 1)
! 	  (capitalize-region
! 	   (point)
! 	   (progn
! 	     (insert-buffer-substring canonicalization-buffer
! 				      mbox-beg mbox-end)
! 	     (point)))
! 	  (setq disable-initial-guessing-flag t)
  	  (setq word-found-flag t))
  	 
  	 ;; Handle *Stupid* VMS date stamps
--- 1597,1613 ----
  	 ((and (or (bobp)
  		   (eq ?\  (preceding-char)))
  	       (looking-at "&\\( \\|\\'\\)"))
!           (if (looking-at "&$")
!               (progn
!                 (mail-extr-delete-char 1)
!                 (capitalize-region
!                  (point)
!                  (progn
!                    (insert-buffer-substring canonicalization-buffer
!                                             mbox-beg mbox-end)
!                    (point)))
!                 (setq disable-initial-guessing-flag t))
!             (forward-char))
  	  (setq word-found-flag t))
  	 
  	 ;; Handle *Stupid* VMS date stamps


-- 
Justin Sheehy

In a cloud bones of steel.
  



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1997-11-03 19:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-26  0:01 mail-extract-address-components vs gnus- Justin Sheehy
1997-10-30 13:00 ` Hrvoje Niksic
1997-10-30 14:36   ` Justin Sheehy
1997-10-30 22:04     ` Joe Wells
1997-10-30 22:09       ` Justin Sheehy
1997-10-30 23:10       ` Hrvoje Niksic
1997-10-31 15:08         ` Joe Wells
1997-10-31 15:13           ` Hrvoje Niksic
1997-10-31  9:28       ` Per Abrahamsen
     [not found]     ` <kigd8knjlnp.fsf@jagor.srce.hr>
1997-11-03 19:40       ` Justin Sheehy

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).