From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alexander Pohoyda Newsgroups: gmane.emacs.devel Subject: Re: New mail-related routines Date: 19 Oct 2004 19:47:18 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <87sm8azjkp.fsf@oak.pohoyda.family> References: <200410182157.i9ILvjln000739@oak.pohoyda.family> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098208076 24304 80.91.229.6 (19 Oct 2004 17:47:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Oct 2004 17:47:56 +0000 (UTC) Cc: Emacs development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 19 19:47:47 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CJy5L-0003cf-00 for ; Tue, 19 Oct 2004 19:47:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJyCg-0001Vr-TE for ged-emacs-devel@m.gmane.org; Tue, 19 Oct 2004 13:55:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CJyCS-0001VJ-RS for emacs-devel@gnu.org; Tue, 19 Oct 2004 13:55:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CJyCR-0001V6-0o for emacs-devel@gnu.org; Tue, 19 Oct 2004 13:55:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJyCQ-0001V3-ES for emacs-devel@gnu.org; Tue, 19 Oct 2004 13:55:06 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CJy4x-0006DI-Am for emacs-devel@gnu.org; Tue, 19 Oct 2004 13:47:23 -0400 Original-Received: (qmail 24218 invoked by uid 65534); 19 Oct 2004 17:47:21 -0000 Original-Received: from p50843176.dip0.t-ipconnect.de (EHLO www2.gmx.net) (80.132.49.118) by mail.gmx.net (mp027) with SMTP; 19 Oct 2004 19:47:21 +0200 X-Authenticated: #14602519 Original-Received: from oak.pohoyda.family (localhost [127.0.0.1]) by www2.gmx.net (8.12.10/8.12.10) with ESMTP id i9JHlJs0000525; Tue, 19 Oct 2004 19:47:19 +0200 (CEST) (envelope-from alexander.pohoyda@gmx.net) Original-Received: (from apog@localhost) by oak.pohoyda.family (8.12.10/8.12.10/Submit) id i9JHlIFp000522; Tue, 19 Oct 2004 19:47:18 +0200 (CEST) (envelope-from alexander.pohoyda@gmx.net) X-Authentication-Warning: oak.pohoyda.family: apog set sender to alexander.pohoyda@gmx.net using -f Original-To: Reiner Steib In-Reply-To: Original-Lines: 43 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28618 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28618 Reiner Steib writes: > > +;;; The -hf suffix means Header Field. > > IIRC, the coding conventions (in Emacs Lisp) say not to abbreviate > function and variable names. I have no problems with that. If required, I will expand all names. > > +(defun mail-unfold-region (from to) > > + "Unfold header fields in the region between FROM and TO, > > +as defined by RFC 2822." > [...] > > + (while (re-search-forward > > + (format "%s%s+" mail-crlf-regexp mail-wsp-regexp) nil t) > > + (replace-match " " nil t)))))) > > I didn't look at the other functions, but this one is incorrect, > AFAICS: Yes, you're right, the function does not conform strictly. However, many MUAs insert either TAB or few SPACE characters during header field folding, so this kind of "loose" unfolding is also desired, I think. I'll add an optional argument to control this behaviour. > The result with > `rfc2047-unfold-region' is correct: Funny that the RFC 2047 itself does not define header field folding/unfolding, so rfc2047-unfold-region is rather confusing name for this function. However, let's talk about RFC 2047 functions later :-) Thank you very much for your comments! -- Alexander Pohoyda PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44