Synch to Gnus 200312042316.
[elisp/gnus.git-] / texi / gnus.texi
index e593b03..7286e92 100644 (file)
@@ -13937,18 +13937,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
@@ -22299,10 +22301,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