(SpamAssassin, Fancy Mail Splitting): add
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 4 Dec 2003 16:32:41 +0000 (16:32 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 4 Dec 2003 16:32:41 +0000 (16:32 +0000)
save-restriction before (widen) in the example.  From Kevin Ryde
<user42@zip.com.au>.

texi/ChangeLog
texi/gnus.texi

index 45cd99e..4e552a9 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-04  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus.texi (SpamAssassin, Fancy Mail Splitting): add
+       save-restriction before (widen) in the example.  From Kevin Ryde
+       <user42@zip.com.au>.
+
 2003-12-03  Simon Josefsson  <jas@extundo.com>
 
        * emacs-mime.texi (Flowed text): Fix.
index a911ed0..0520514 100644 (file)
@@ -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