Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: ding@gnus.org
Subject: Re: widening in nnml split does not work
Date: Sat, 25 Jan 2003 15:48:50 +0100	[thread overview]
Message-ID: <ilu7kct1e0d.fsf@latte.josefsson.org> (raw)
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")

kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> Ted Zlatanov <tzz@lifelogs.com> 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.




  reply	other threads:[~2003-01-25 14:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-25  6:41 Ted Zlatanov
2003-01-25 10:24 ` Kai Großjohann
2003-01-25 12:35   ` Ted Zlatanov
2003-01-25 13:14     ` Kai Großjohann
2003-01-25 14:48       ` Simon Josefsson [this message]
2003-01-25 15:14         ` Kai Großjohann
2003-01-25 15:29           ` Ted Zlatanov
2003-01-25 15:41           ` Simon Josefsson
2003-01-25 16:18             ` Ted Zlatanov
2003-01-25 21:37               ` Kai Großjohann
2003-01-26  0:46                 ` Ted Zlatanov
2003-01-25 21:36             ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ilu7kct1e0d.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).