(spam-stat-buffer-words-with-scores): Don't narrow and change
authorJesper Harder <harder@ifa.au.dk>
Wed, 21 Jan 2004 03:04:16 +0000 (03:04 +0000)
committerJesper Harder <harder@ifa.au.dk>
Wed, 21 Jan 2004 03:04:16 +0000 (03:04 +0000)
syntax table here.  Reported by Andrew Cohen <cohen@andy.bu.edu>.

lisp/ChangeLog
lisp/spam-stat.el

index 3dba533..947021f 100644 (file)
@@ -3,6 +3,8 @@
        * spam-stat.el (spam-stat-test-directory): New optional argument
        displays a list of files detected.  Suggested by Andrew Cohen
        <cohen@andy.bu.edu>.
+       (spam-stat-buffer-words-with-scores): Don't narrow and change
+       syntax table here.  Reported by Andrew Cohen <cohen@andy.bu.edu>.
 
 2004-01-20  Teodor Zlatanov  <tzz@lifelogs.com>  
 
index 97aa160..3602a69 100644 (file)
@@ -433,17 +433,15 @@ The default score for unknown words is stored in
 These are the words whose spam-stat differs the most from 0.5.
 The list returned contains elements of the form \(WORD SCORE DIFF),
 where DIFF is the difference between SCORE and 0.5."
-  (with-spam-stat-max-buffer-size
-   (with-syntax-table spam-stat-syntax-table
-     (let (result word score)
-       (maphash        (lambda (word ignore)
-                 (setq score (spam-stat-score-word word)
-                       result (cons (list word score (abs (- score 0.5)))
-                                    result)))
-               (spam-stat-buffer-words))
-       (setq result (sort result (lambda (a b) (< (nth 2 b) (nth 2 a)))))
-       (setcdr (nthcdr 14 result) nil)
-       result))))
+  (let (result word score)
+    (maphash (lambda (word ignore)
+              (setq score (spam-stat-score-word word)
+                    result (cons (list word score (abs (- score 0.5)))
+                                 result)))
+            (spam-stat-buffer-words))
+    (setq result (sort result (lambda (a b) (< (nth 2 b) (nth 2 a)))))
+    (setcdr (nthcdr 14 result) nil)
+    result))
 
 (defun spam-stat-score-buffer ()
   "Return a score describing the spam-probability for this buffer."