From 55cafd80895e71b128d5940d71a1e95a4e8d1ed9 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Tue, 15 Apr 2003 19:44:35 +0000 Subject: [PATCH] (spam-split): added save-restriction to save-excursion --- lisp/ChangeLog | 4 ++++ lisp/spam.el | 37 +++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f827b79a0..09c67a103 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2003-04-15 Teodor Zlatanov + + * spam.el (spam-split): added save-restriction to save-excursion + 2003-04-15 Reiner Steib From Julien Avarre diff --git a/lisp/spam.el b/lisp/spam.el index ff6302682..a286a16d7 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -596,24 +596,25 @@ example like this: (: spam-split) See the Info node `(gnus)Fancy Mail Splitting' for more details." (interactive) (save-excursion - (dolist (check spam-list-of-statistical-checks) - (when (symbol-value check) - (widen) - (gnus-message 8 "spam-split: widening the buffer (%s requires it)" - (symbol-name check)) - (return))) -;; (progn (widen) (debug (buffer-string))) - (let ((list-of-checks spam-list-of-checks) - decision) - (while (and list-of-checks (not decision)) - (let ((pair (pop list-of-checks))) - (when (symbol-value (car pair)) - (gnus-message 5 "spam-split: calling the %s function" (symbol-name (cdr pair))) - (setq decision (funcall (cdr pair)))))) - (if (eq decision t) - nil - decision)))) - + (save-restriction + (dolist (check spam-list-of-statistical-checks) + (when (symbol-value check) + (widen) + (gnus-message 8 "spam-split: widening the buffer (%s requires it)" + (symbol-name check)) + (return))) + ;; (progn (widen) (debug (buffer-string))) + (let ((list-of-checks spam-list-of-checks) + decision) + (while (and list-of-checks (not decision)) + (let ((pair (pop list-of-checks))) + (when (symbol-value (car pair)) + (gnus-message 5 "spam-split: calling the %s function" (symbol-name (cdr pair))) + (setq decision (funcall (cdr pair)))))) + (if (eq decision t) + nil + decision))))) + (defun spam-setup-widening () (dolist (check spam-list-of-statistical-checks) (when (symbol-value check) -- 2.25.1