From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.devel Subject: Problems in parsing message's "From" header Date: Mon, 22 Jun 2009 10:56:13 +0300 Message-ID: <877hz48zxe.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1245657395 10538 80.91.229.12 (22 Jun 2009 07:56:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 07:56:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 22 09:56:32 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIeOD-0007g9-6m for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 09:56:29 +0200 Original-Received: from localhost ([127.0.0.1]:51067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIeOC-0005I4-N5 for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 03:56:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIeO7-0005HJ-3U for emacs-devel@gnu.org; Mon, 22 Jun 2009 03:56:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIeO2-0005EZ-Ex for emacs-devel@gnu.org; Mon, 22 Jun 2009 03:56:22 -0400 Original-Received: from [199.232.76.173] (port=59892 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIeO2-0005EW-B8 for emacs-devel@gnu.org; Mon, 22 Jun 2009 03:56:18 -0400 Original-Received: from mta-out.inet.fi ([195.156.147.13]:34872 helo=kirsi1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIeO1-0004Q2-Nu for emacs-devel@gnu.org; Mon, 22 Jun 2009 03:56:18 -0400 Original-Received: from mithlond.arda.local (80.220.180.181) by kirsi1.inet.fi (8.5.014) id 49F6055A0202C1AB for emacs-devel@gnu.org; Mon, 22 Jun 2009 10:56:14 +0300 Original-Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1MIeNx-0003Vu-Oj for emacs-devel@gnu.org; Mon, 22 Jun 2009 10:56:13 +0300 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111629 Archived-At: 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 ") =3D> ("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 "=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82= =CE=A3=CE=B5=CF=86=CE=AD=CF=81=CE=B7=CF=82 ") =3D> ("address@invalid") If I put double quotes ("...") around the name it is parsed correctly: (mail-header-parse-address "\"=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF= =82 =CE=A3=CE=B5=CF=86=CE=AD=CF=81=CE=B7=CF=82\" ") =3D> ("address@invalid" . "=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82= =CE=A3=CE=B5=CF=86=CE=AD=CF=81=CE=B7=CF=82") 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=20 (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