emacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-commit] emacs/lisp/mh-e ChangeLog mh-e.el mh-junk.el


From: Stephen Gildea
Subject: [Emacs-commit] emacs/lisp/mh-e ChangeLog mh-e.el mh-junk.el
Date: Sat, 11 Nov 2006 20:20:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Stephen Gildea <gildea> 06/11/11 20:20:28

Modified files:
        lisp/mh-e      : ChangeLog mh-e.el mh-junk.el 

Log message:
        mh-junk.el (mh-spamassassin-blacklist, mh-spamassassin-whitelist): 
        use mh-junk-background consistently in call-process calls.
        
        (mh-bogofilter-blacklist, mh-bogofilter-whitelist,
        mh-spamprobe-blacklist, mh-spamprobe-whitelist): use
        with-current-buffer so the right thing happens if
        mh-junk-background is t.  (closes SF #1594802).
        
        mh-e.el (mh-junk-background): document that On value is 0;
        t may be used for debugging.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mh-e/ChangeLog?cvsroot=emacs&r1=1.233&r2=1.234
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mh-e/mh-e.el?cvsroot=emacs&r1=1.104&r2=1.105
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mh-e/mh-junk.el?cvsroot=emacs&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mh-e/ChangeLog,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -b -r1.233 -r1.234
--- ChangeLog   10 Nov 2006 15:03:16 -0000      1.233
+++ ChangeLog   11 Nov 2006 20:20:28 -0000      1.234
@@ -1,3 +1,16 @@
+2006-11-11  Stephen Gildea  <address@hidden>
+
+       * mh-junk.el (mh-spamassassin-blacklist, mh-spamassassin-whitelist): 
+       use mh-junk-background consistently in call-process calls.
+
+       * (mh-bogofilter-blacklist, mh-bogofilter-whitelist,
+       mh-spamprobe-blacklist, mh-spamprobe-whitelist): use
+       with-current-buffer so the right thing happens if
+       mh-junk-background is t.  (closes SF #1594802).
+
+       * mh-e.el (mh-junk-background): document that On value is 0;
+       t may be used for debugging.
+       
 2006-11-10  Andreas Schwab  <address@hidden>
 
        * mh-e.el (mh-draft-folder): Avoid starting sentence with "nil".

Index: mh-e.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mh-e/mh-e.el,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -b -r1.104 -r1.105
--- mh-e.el     10 Nov 2006 15:03:06 -0000      1.104
+++ mh-e.el     11 Nov 2006 20:20:28 -0000      1.105
@@ -1690,7 +1690,9 @@
 By default, the programs are run in the foreground, but this can
 be slow when junking large numbers of messages. If you have
 enough memory or don't junk that many messages at the same time,
-you might try turning on this option."
+you might try turning on this option (that is, setting its value to 0).
+If the value is t, the programs' output is saved in the MH-E log buffer;
+this may be useful for debugging."
   :type '(choice (const :tag "Off" nil)
                  (const :tag "On" 0))
   :group 'mh-junk

Index: mh-junk.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mh-e/mh-junk.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- mh-junk.el  26 Sep 2006 02:40:50 -0000      1.20
+++ mh-junk.el  11 Nov 2006 20:20:28 -0000      1.21
@@ -195,30 +195,33 @@
   (let ((current-folder mh-current-folder)
         (msg-file (mh-msg-filename msg mh-current-folder))
         (sender))
-    (save-excursion
       (message "Reporting message %d..." msg)
       (mh-truncate-log-buffer)
-      (call-process mh-spamassassin-executable msg-file mh-log-buffer nil
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-spamassassin-executable msg-file mh-junk-background nil
                     ;;"--report" "--remove-from-whitelist"
                     "-r" "-R")          ; spamassassin V2.20
       (when mh-sa-learn-executable
-          (message "Recategorizing this message as spam...")
-          (call-process mh-sa-learn-executable msg-file mh-log-buffer nil
-                        "--single" "--spam" "--local" "--no-rebuild"))
-      (message "Blacklisting message %d..." msg)
-      (set-buffer (get-buffer-create mh-temp-buffer))
+      (message "Recategorizing message %d as spam..." msg)
+      (mh-truncate-log-buffer)
+      (call-process mh-sa-learn-executable msg-file mh-junk-background nil
+                    "--single" "--spam" "--local" "--no-rebuild")))
+    (message "Blacklisting sender of message %d..." msg)
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
       (call-process (expand-file-name mh-scan-prog mh-progs)
-                    nil mh-junk-background nil
-                    (format "%s" msg) current-folder
+                    nil t nil
+                    (format "%d" msg) current-folder
                     "-format" "%<(mymbox{from})%|%(addr{from})%>")
       (goto-char (point-min))
       (if (search-forward-regexp "^\\(.+\\)$" nil t)
           (progn
             (setq sender (match-string 0))
             (mh-spamassassin-add-rule "blacklist_from" sender)
-            (message "Blacklisting message %d...done" msg))
-        (message "Blacklisting message %d...not done (from my address)" 
msg)))))
+            (message "Blacklisting sender of message %d...done" msg))
+        (message "Blacklisting sender of message %d...not done (from my 
address)" msg)))))
 
 ;;;###mh-autoload
 (defun mh-spamassassin-whitelist (msg)
@@ -234,28 +237,31 @@
   (let ((msg-file (mh-msg-filename msg mh-current-folder))
         (show-buffer (get-buffer mh-show-buffer))
         from)
-    (save-excursion
-      (set-buffer (get-buffer-create mh-temp-buffer))
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
-      (message "Removing spamassassin markup from message...")
-      (call-process mh-spamassassin-executable msg-file mh-temp-buffer nil
+      (message "Removing spamassassin markup from message %d..." msg)
+      (call-process mh-spamassassin-executable msg-file t nil
                     ;; "--remove-markup"
                     "-d")               ; spamassassin V2.20
       (if show-buffer
           (kill-buffer show-buffer))
       (write-file msg-file)
       (when mh-sa-learn-executable
-        (message "Recategorizing this message as ham...")
-        (call-process mh-sa-learn-executable msg-file mh-temp-buffer nil
-                      "--single" "--ham" "--local" "--no-rebuild"))
-      (message "Whitelisting message %d..." msg)
+        (message "Recategorizing message %d as ham..." msg)
+        (mh-truncate-log-buffer)
+        ;; Put call-process output in log buffer if we are saving it
+        ;; (this happens if mh-junk-background is t).
+        (with-current-buffer mh-log-buffer
+          (call-process mh-sa-learn-executable msg-file mh-junk-background nil
+                        "--single" "--ham" "--local" "--no-rebuild")))
+      (message "Whitelisting sender of message %d..." msg)
       (setq from
             (car (mh-funcall-if-exists
                   ietf-drums-parse-address (mh-get-header-field "From:"))))
       (kill-buffer nil)
       (unless (or (null from) (equal from ""))
         (mh-spamassassin-add-rule "whitelist_from" from))
-      (message "Whitelisting message %d...done" msg))))
+      (message "Whitelisting sender of message %d...done" msg))))
 
 (defun mh-spamassassin-add-rule (rule body)
   "Add a new rule to \"~/.spamassassin/user_prefs\".
@@ -375,8 +381,12 @@
   (unless mh-bogofilter-executable
     (error "Unable to find the bogofilter executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
     (call-process mh-bogofilter-executable msg-file mh-junk-background
-                  nil "-s")))
+                    nil "-s"))))
 
 ;;;###mh-autoload
 (defun mh-bogofilter-whitelist (msg)
@@ -386,8 +396,12 @@
   (unless mh-bogofilter-executable
     (error "Unable to find the bogofilter executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
     (call-process mh-bogofilter-executable msg-file mh-junk-background
-                  nil "-n")))
+                    nil "-n"))))
 
 
 
@@ -423,8 +437,12 @@
   (unless mh-spamprobe-executable
     (error "Unable to find the spamprobe executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
     (call-process mh-spamprobe-executable msg-file mh-junk-background
-                  nil "spam")))
+                    nil "spam"))))
 
 ;;;###mh-autoload
 (defun mh-spamprobe-whitelist (msg)
@@ -434,8 +452,12 @@
   (unless mh-spamprobe-executable
     (error "Unable to find the spamprobe executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
     (call-process mh-spamprobe-executable msg-file mh-junk-background
-                  nil "good")))
+                    nil "good"))))
 
 (provide 'mh-junk)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]