From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49611 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: widening in nnml split does not work Date: Sat, 25 Jan 2003 15:48:50 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <84lm19cys8.fsf@lucy.is.informatik.uni-duisburg.de> <84r8b1nzgg.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1043506372 1409 80.91.224.249 (25 Jan 2003 14:52:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 25 Jan 2003 14:52:52 +0000 (UTC) Cc: ding@gnus.org Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18cRfu-0000MC-00 for ; Sat, 25 Jan 2003 15:52:50 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18cRcU-00077n-00; Sat, 25 Jan 2003 08:49:18 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 25 Jan 2003 08:50:14 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id IAA08695 for ; Sat, 25 Jan 2003 08:49:57 -0600 (CST) Original-Received: (qmail 71749 invoked by alias); 25 Jan 2003 14:48:53 -0000 Original-Received: (qmail 71744 invoked from network); 25 Jan 2003 14:48:53 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by 66.230.238.6 with SMTP; 25 Jan 2003 14:48:53 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id h0PEmoeE029898 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 25 Jan 2003 15:48:51 +0100 Original-To: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Mail-Copies-To: nobody X-Payment: hashcash 1.1 0:030125:kai.grossjohann@uni-duisburg.de:01850b2d75e52b6c X-Hashcash: 0:030125:kai.grossjohann@uni-duisburg.de:01850b2d75e52b6c X-Payment: hashcash 1.1 0:030125:ding@gnus.org:03880f24ea6fd499 X-Hashcash: 0:030125:ding@gnus.org:03880f24ea6fd499 In-Reply-To: <84r8b1nzgg.fsf@lucy.is.informatik.uni-duisburg.de> (kai.grossjohann@uni-duisburg.de's message of "Sat, 25 Jan 2003 14:14:39 +0100") User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.3.50 (i686-pc-linux-gnu) X-Face: )=Tu!-Q9f9BQASOHl~_&4r0`,OQD2*=;cm+4]m[twz:8t5yt@xQW+:T$K%AdKq)`"g;C%>s /8w~Upcau`W2wh$=#"g7]"[2c;1Z/S:B49XEy$-YlaAGc'ZM&U*el'yQAD"c):Lc:fUD-S=\!EV;n@ 1Jff} Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49611 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49611 kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes: > Ted Zlatanov writes: > >> OK, but it doesn't. (widen) just gives me the headers of the >> message. >> >> This is incorrect behavior according to the manual, so I'd say it's a >> legitimate bug. Yay. > > Well, I've now looked at the code. It seems it's intentional, and > not easy to fix. Here is how it goes: > > nnmail-process-unix-mail-format calls nnmail-check-duplication on > each message. That function calls nnmail-article-group, which copies > the headers to a temp buffer and does some MIMEy decoding on them > before doing the splitting dance. > > So I'm afraid that maybe the manual needs to be fixed, rather than > the code. > > Or nnmail-article-group could be augmented to optionally do some work > on the body, too. > > Hm. Sounds like real work. Augmenting n-a-g doesn't sound too hard. Wouldn't something like the following work? --- nnmail.el.~6.57.~ Sun Jan 19 11:31:14 2003 +++ nnmail.el Sat Jan 25 15:47:38 2003 @@ -998,8 +998,7 @@ FUNC will be called with the group name to determine the article number." (let ((methods (or nnmail-split-methods '(("bogus" "")))) (obuf (current-buffer)) - (beg (point-min)) - end group-art method grp) + group-art method grp) (if (and (sequencep methods) (= (length methods) 1)) ;; If there is only just one group to put everything in, we @@ -1008,13 +1007,12 @@ (list (cons (caar methods) (funcall func (caar methods))))) ;; We do actual comparison. (save-excursion - ;; Find headers. - (goto-char beg) - (setq end (if (search-forward "\n\n" nil t) (point) (point-max))) + ;; Copy the article into the work buffer. (set-buffer nntp-server-buffer) (erase-buffer) - ;; Copy the headers into the work buffer. - (insert-buffer-substring obuf beg end) + (insert-buffer obuf) + ;; Narrow to headers. + (mail-narrow-to-head) ;; Decode MIME headers and charsets. (when nnmail-mail-splitting-decodes (let ((mail-parse-charset nnmail-mail-splitting-charset)) @@ -1115,7 +1113,8 @@ (let (elem) (while (setq elem (car (memq 'junk group-art))) (setq group-art (delq elem group-art))) - (nreverse group-art))))))) + (nreverse group-art)))) + (widen)))) (defun nnmail-insert-lines () "Insert how many lines there are in the body of the mail.