all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: emacs-devel@gnu.org
Subject: Problems in parsing message's "From" header
Date: Mon, 22 Jun 2009 10:56:13 +0300	[thread overview]
Message-ID: <877hz48zxe.fsf@iki.fi> (raw)

There's a small bug somewhere in parsing and handling messages' "From"
header. Here's some background information first. Function
mail-header-parse-address works like this:

    (mail-header-parse-address "Teemu Likonen <tlikonen@iki.fi>")
    => ("tlikonen@iki.fi" . "Teemu Likonen")

But if there are some non-latin letters it fails to parse the name part,
for example:

    (mail-header-parse-address "Γιώργος Σεφέρης <address@invalid>")
    => ("address@invalid")

If I put double quotes ("...") around the name it is parsed correctly:

    (mail-header-parse-address "\"Γιώργος Σεφέρης\" <address@invalid>")
    => ("address@invalid" . "Γιώργος Σεφέρης")

Maybe this is a feature but there is a little problem anyway: I use my
own function to insert citation line when replying to a message with
Gnus. The function is defined through variable
message-citation-line-function. To get person's name and address I have
this in my custom citation function:

    (mail-header-parse-address 
     (mail-header-from message-reply-headers))

Vector message-reply-headers has message's "From" field but person's
name is not enclosed in double quotes. Hence mail-header-parse-address
fails to parse the name.

So, is this bug or "non-ideal behaviour" (a) in the function
mail-header-parse-address (b) in the code which produces the vector
message-reply-headers or (c) in the code which puts the "From" field in
the buffer in the first place? About the item "c" I should add that in
Gnus's Article buffer there are no double quotes around person's name.

Thanks. I'm using up-to-date Emacs CVS/Git version:

    GNU Emacs 23.1.50.3 (i686-pc-linux-gnu, GTK+ Version 2.12.12) of
    2009-06-22 on mithlond




             reply	other threads:[~2009-06-22  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22  7:56 Teemu Likonen [this message]
2009-06-22 10:58 ` Problems in parsing message's "From" header Teemu Likonen

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=877hz48zxe.fsf@iki.fi \
    --to=tlikonen@iki.fi \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.