From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Evil Boris Newsgroups: gmane.emacs.devel Subject: Re: automatic MIME decoding in rmail Date: Sun, 09 Apr 2006 17:32:18 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144618370 12072 80.91.229.2 (9 Apr 2006 21:32:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Apr 2006 21:32:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 09 23:32:48 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FShWZ-0004iR-TD for ged-emacs-devel@m.gmane.org; Sun, 09 Apr 2006 23:32:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FShWZ-0001L8-7U for ged-emacs-devel@m.gmane.org; Sun, 09 Apr 2006 17:32:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FShWN-0001L2-En for emacs-devel@gnu.org; Sun, 09 Apr 2006 17:32:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FShWK-0001Kn-TN for emacs-devel@gnu.org; Sun, 09 Apr 2006 17:32:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FShWK-0001Kg-Np for emacs-devel@gnu.org; Sun, 09 Apr 2006 17:32:32 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FShap-00079F-Ek for emacs-devel@gnu.org; Sun, 09 Apr 2006 17:37:11 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FShWC-0004fu-9s for emacs-devel@gnu.org; Sun, 09 Apr 2006 23:32:24 +0200 Original-Received: from 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com ([207.38.193.43]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Apr 2006 23:32:24 +0200 Original-Received: from evilborisnet by 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Apr 2006 23:32:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:fvGLUmuVNXqdlUYql7mbDg5M3pM= 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:52568 Archived-At: > Stefan Monnier writes: > As far as I know, it's is prefectly valid to add any random number of > arbitrary non-standard args. So "format=[a-z]+" is too restrictive. The RFC (3676) that defines format=fixed or format=flowed also mentions delsp=yes or delsp=no. Looking around, but not too carefully, I have not found any other allowed arguments, for text/plain. I think there are two alternatives. One is to try and enumerate the allowed args explicitly (please do not forget to surround the argument values with optional quotes, as they are commonly used, e.g., allowing both format=flowed and format="flowed". (I.e., modify Richard's expression by allowing quotes and delsp=... .) Alternatively, some sensible expression that would match a general set of arguments such as what Stefan suggests. I tried the first alternative with expression: (concat "^content-type:[ ]*text/plain;\\(?:[ \t\n]*format=\"?[a-z]+\"?;\\)?" "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?") and had no trouble so far, though I receive very few msgs in this format and perhaps the regex only got exercised once or twice for the class of msgs we are discussing. A more general expression including delsp would look something like this: (concat "^content-type:[ ]*text/plain;" "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[a-z]+\"?;\\)?" "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?") One could imagine even specifying the two legal values for formal and delsp, but this seems like overkill... Should one of the above versions be incorporated in CVS? If it already has been, my apologies... --Boris