From 5ea148d34e5028d56f7ec8639bece76b249e36e7 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Thu, 4 Dec 2003 16:32:41 +0000 Subject: [PATCH] (SpamAssassin, Fancy Mail Splitting): add save-restriction before (widen) in the example. From Kevin Ryde . --- texi/ChangeLog | 6 ++++++ texi/gnus.texi | 27 +++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/texi/ChangeLog b/texi/ChangeLog index 45cd99e20..4e552a972 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2003-12-04 Teodor Zlatanov + + * gnus.texi (SpamAssassin, Fancy Mail Splitting): add + save-restriction before (widen) in the example. From Kevin Ryde + . + 2003-12-03 Simon Josefsson * emacs-mime.texi (Flowed text): Fix. diff --git a/texi/gnus.texi b/texi/gnus.texi index a911ed0de..052051445 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -13936,18 +13936,20 @@ body of the messages: @lisp (defun split-on-body () (save-excursion - (widen) - (goto-char (point-min)) - (when (re-search-forward "Some.*string" nil t) - "string.group"))) + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward "Some.*string" nil t) + "string.group"))) @end lisp The buffer is narrowed to the message in question when @var{function} is run. That's why @code{(widen)} needs to be called after -@code{save-excursion} in the example above. Also note that with the -nnimap backend, message bodies will not be downloaded by default. You -need to set @code{nnimap-split-download-body} to t to do that -(@pxref{Splitting in IMAP}). +@code{save-excursion} and @code{save-restriction} in the example +above. Also note that with the nnimap backend, message bodies will +not be downloaded by default. You need to set +@code{nnimap-split-download-body} to t to do that (@pxref{Splitting in +IMAP}). @item (! @var{func} @var{split}) If the split is a list, and the first element is @code{!}, then @@ -22287,10 +22289,11 @@ call the external tools during splitting. Example fancy split method: ...)) (defun kevin-spamassassin () (save-excursion - (widen) - (if (eq 1 (call-process-region (point-min) (point-max) - "spamc" nil nil nil "-c")) - "spam"))) + (save-restriction + (widen) + (if (eq 1 (call-process-region (point-min) (point-max) + "spamc" nil nil nil "-c")) + "spam"))) @end lisp Note that with the nnimap backend, message bodies will not be -- 2.25.1