From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65828 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: More liberal MIME decoding (unencoded question marks in encoded words) Date: Sat, 01 Dec 2007 14:17:36 +0100 Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196515160 9648 80.91.229.12 (1 Dec 2007 13:19:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 13:19:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14323@lists.math.uh.edu Sat Dec 01 14:19:30 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IySFk-0007pe-2M for ding-account@gmane.org; Sat, 01 Dec 2007 14:19:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IySF9-0002we-Ug; Sat, 01 Dec 2007 07:18:51 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IySF8-0002wK-El for ding@lists.math.uh.edu; Sat, 01 Dec 2007 07:18:50 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IySF1-0001bK-Nr for ding@lists.math.uh.edu; Sat, 01 Dec 2007 07:18:50 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IySEy-0002XI-00 for ; Sat, 01 Dec 2007 14:18:40 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IySEh-0007OX-Lt for ding@gnus.org; Sat, 01 Dec 2007 13:18:23 +0000 Original-Received: from p54a94bf7.dip.t-dialin.net ([84.169.75.247]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Dec 2007 13:18:23 +0000 Original-Received: from Reiner.Steib by p54a94bf7.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Dec 2007 13:18:23 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 85 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p54a94bf7.dip.t-dialin.net X-Face: :6KQZ[nyoS_edmB.%gw-=)BYth^|2+Y+^cu%I$FSx!&>-'om>3H7A|M&n(V7fIo3P.;yo.b yq4$p;ZaBtkv)\}biaiBQe"mD}iib1AA@99-fZ7i*bLhNRVC&0Wkxg9)SH?oWc@{ Mail-Copies-To: nobody User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:z4cex3o1Ns1JeXTZkGhRTgKiLM4= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65828 Archived-At: On Tue, Nov 27 2007, Katsumi Yamaoka wrote: >>>>>> Reiner Steib wrote: >> On Mon, Nov 26 2007, Katsumi Yamaoka wrote: >>> Would we be able to make complete test cases? I don't think providing *complete* test cases is possible. But regression tests would be very nice to have. How about defining a variable containing list of (decoded . encoded) pairs, decode/encode the strings and put the results in a buffer (or file) and compare them? [...] >> +\\|Q\\?\\(?:\\?+[ -<>@-~]\\)?\\(?:[ ->@-~]+\\?+[ -<>@-~]\\)*[ ->@-~]*\\?*\ >> +\\)\\?=")) > > This pattern is similar to: > > "Q\\?\\(\\?+[^\n=?]\\)?\\([^\n?]+\\?+[^\n=?]\\)*[^\n?]*\\?*" > <--------1-------><----------2,3----------><--4--><-5-> > > 1. After "Q?", allow "?"s that follow a character other than "=". > 2. Allow "=" after "Q?"; it isn't regarded as the terminator. > 3. In the middle of an encoded word, allow "?"s that follow a > character other than "=". > 4. Allow any characters other than "?" in the middle of an > encoded word. > 5. At the end, allow "?"s. Could you please add such explanations as comments in `rfc2047.el'? >> And we probably should have an option to toggle strict/loose >> decoding. > > I've introduced the `rfc2047-allow-irregular-q-encoded-words' > option. I wish that it is tested widely, so I've set the default > value to t. But it might have to be nil when it is imported into > the stable branch. I see that we already have quite a few of these variables: At least `rfc2047-allow-irregular-q-encoded-words', `rfc2047-allow-incomplete-encoded-text' and finally `gnus-article-loose-mime'. How about deriving the defaults from a single variable `rfc2047-allow-loose-mime' (or `rfc2047-loose-mime-decoding'): (defcustom rfc2047-allow-loose-mime t "Allow loose MIME decoding. ...") (devar rfc2047-allow-irregular-q-encoded-words rfc2047-allow-loose-mime ...) (devar rfc2047-allow-incomplete-encoded-text rfc2047-allow-loose-mime ...) (defcustom gnus-article-loose-mime rfc2047-allow-loose-mime "... See also `rfc2047-allow-loose-mime'.") Or even, if we don't need such a fine tuning, use `rfc2047-allow-loose-mime' directly. > Now there are two regexps; one is `rfc2047-encoded-word-regexp' for > strict decoding, the other is `rfc2047-encoded-word-regexp-loose'. You you explain the purpose of using `eval-and-compile'? > I agree with you. I've made `rfc2047-encodable-p' use > `rfc2047-encoded-word-regexp' instead of "=?". The defconst needs to be before `rfc2047-encodable-p': In rfc2047-encodable-p: rfc2047.el:302:37:Warning: reference to free variable `rfc2047-encoded-word-regexp' > It will be hard to be found out even if this change causes another > trouble, though. Yes. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/