Gnus development mailing list
 help / color / mirror / Atom feed
* letting split rules have access to the message body...
@ 2001-05-10 21:30 Josh Huber
  2001-05-11 13:20 ` Josh Huber
  2001-05-11 22:50 ` Kai Großjohann
  0 siblings, 2 replies; 8+ messages in thread
From: Josh Huber @ 2001-05-10 21:30 UTC (permalink / raw)


This was brought up a week or two ago, and people (Kai?) just said,
well...why don't you just do:

(save-restriction
    (widen)
    ...
    )

well, that didn't work for me, and I'm not quite sure how it would
work due to this little snippit of code in nnmail-article-group, which
does this:

	;; Find headers.
	(goto-char beg)
	(setq end (if (search-forward "\n\n" nil t) (point) (point-max)))
	(set-buffer nntp-server-buffer)
	(erase-buffer)
	;; Copy the headers into the work buffer.
	(insert-buffer-substring obuf beg end)

thus, the original contents of the message are NOT accessible to the
split rules, even if you (widen).  Unless that is, I'm missing
something, which I could be...this is my first gnus source hack, so
here it goes.  I tested this on the re-spooling of *one* (1) message,
and disabled it, because I want to see if there could be any unwanted
side-effects, and how to fix them if there are problems:

Index: nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 6.13
diff -u -r6.13 nnmail.el
--- nnmail.el   2001/04/29 12:36:09     6.13
+++ nnmail.el   2001/05/10 21:23:41
@@ -941,8 +941,9 @@
        (setq end (if (search-forward "\n\n" nil t) (point) (point-max)))
        (set-buffer nntp-server-buffer)
        (erase-buffer)
-       ;; Copy the headers into the work buffer.
-       (insert-buffer-substring obuf beg end)
+       ;; Copy the whole buffer in, and narrow to the headers...
+       (insert-buffer obuf)
+       (narrow-to-region beg end)
        ;; Fold continuation lines.
        (goto-char (point-min))
        (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)


This seems sane to me, but I'm looking for comments.  I don't want my
mail to blow up due to this small change :)

Thanks,

-- 
Josh Huber


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-05-15 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-10 21:30 letting split rules have access to the message body Josh Huber
2001-05-11 13:20 ` Josh Huber
2001-05-11 22:50 ` Kai Großjohann
2001-05-14 19:13   ` Josh Huber
2001-05-14 20:16     ` Kai Großjohann
2001-05-14 21:18       ` Josh Huber
2001-05-15  9:24         ` Kai Großjohann
2001-05-15 16:33           ` Josh Huber

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).