unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Reiner Steib <4uce.02.r.steib@gmx.net>
Subject: Bug in mail-extract-address-components (mail-extr.el)?
Date: Mon, 23 Sep 2002 14:25:35 +0200	[thread overview]
Message-ID: <v9n0q8riyo.fsf@marauder.physik.uni-ulm.de> (raw)

In Gnus, I use a `message-citation-line-function' that extracts the
full name of the previous poster with the function
`mail-extract-address-components' [1]:

,----[ C-h f mail-extract-address-components RET ]
| mail-extract-address-components is a compiled Lisp function in `mail-extr'.
| (mail-extract-address-components ADDRESS &optional ALL)
|
| Given an RFC-822 address ADDRESS, extract full name and canonical address.
| Returns a list of the form (FULL-NAME CANONICAL-ADDRESS).
| If no name can be extracted, FULL-NAME will be nil.
| [...]
`----

Recently I noticed, that the function fails for the following From:
line (which seem to be correct according to RFC-822):

| From: "Harald H.-J. Bongartz" <bongie@gmx.net>

Instead of "Harald H.-J. Bongartz" I get "Harald H.":

ELISP> (require 'mail-extr)
mail-extr
ELISP> (setq email "\"Harald H.-J. Bongartz\" <bongie@gmx.net>")
"\"Harald H.-J. Bongartz\" <bongie@gmx.net>"
ELISP> (setq data (mail-extract-address-components email))
("Harald H." "bongie@gmx.net")
ELISP> (car data)
"Harald H."

The error is reproducible with Emacs 21.1 and Emacs from CVS (last
week). The problem seems to be the "-":

ELISP> (car (mail-extract-address-components
  "\"Harald H. J. Bongartz\" <bongie@gmx.net>")
"Harald H. J. Bongartz"

Is this a bug in `mail-extract-address-components' or should I use a
different function to get the full name?

Bye, Reiner.

[1] My function is based on a suggestion of François Fleuret in
    news:<s02pu3weovk.fsf@wasabi.inria.fr>
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

             reply	other threads:[~2002-09-23 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-23 12:25 Reiner Steib [this message]
2002-09-23 12:57 ` Bug in mail-extract-address-components (mail-extr.el)? Jesper Harder
2002-09-23 14:29   ` Reiner Steib
2002-09-23 14:48     ` lawrence mitchell
2002-09-24 21:30       ` Simon Josefsson
2002-09-24 22:06 ` Simon Josefsson

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=v9n0q8riyo.fsf@marauder.physik.uni-ulm.de \
    --to=4uce.02.r.steib@gmx.net \
    --cc=reiner.steib@gmx.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).