* spam.el (spam-check-spamoracle, spam-spamoracle-learn): Don't
authorJesper Harder <harder@ifa.au.dk>
Sun, 7 Dec 2003 15:33:48 +0000 (15:33 +0000)
committerJesper Harder <harder@ifa.au.dk>
Sun, 7 Dec 2003 15:33:48 +0000 (15:33 +0000)
use = or zerop to test the return value of call-process, because
it can be a string.

* mail-source.el (mail-source-fetch-with-program): do.

* mailcap.el (mailcap-viewer-passes-test): do.

* gnus-uu.el (gnus-uu-treat-archive, gnus-uu-post-encode-mime)
(gnus-uu-post-encode-file): do.

* gnus-soup.el (gnus-soup-pack, gnus-soup-unpack-packet): do.

lisp/ChangeLog
lisp/gnus-soup.el
lisp/gnus-uu.el
lisp/mail-source.el
lisp/mailcap.el
lisp/spam.el

index 99c5cbd..58ee59b 100644 (file)
@@ -1,5 +1,18 @@
 2003-12-07  Jesper Harder  <harder@ifa.au.dk>
 
+       * spam.el (spam-check-spamoracle, spam-spamoracle-learn): Don't
+       use = or zerop to test the return value of call-process, because
+       it can be a string.
+
+       * mail-source.el (mail-source-fetch-with-program): do.
+
+       * mailcap.el (mailcap-viewer-passes-test): do.
+
+       * gnus-uu.el (gnus-uu-treat-archive, gnus-uu-post-encode-mime)
+       (gnus-uu-post-encode-file): do.
+
+       * gnus-soup.el (gnus-soup-pack, gnus-soup-unpack-packet): do.
+
        * message.el (message-fix-before-sending): Fix detection of
        non-printables.  Don't replace unencodable utf-8.
 
index b5f1368..b7c1a23 100644 (file)
@@ -357,9 +357,9 @@ If NOT-ALL, don't pack ticked articles."
     (gnus-make-directory dir)
     (setq gnus-soup-areas nil)
     (gnus-message 4 "Packing %s..." packer)
-    (if (zerop (call-process shell-file-name
-                            nil nil nil shell-command-switch
-                            (concat "cd " dir " ; " packer)))
+    (if (eq 0 (call-process shell-file-name
+                           nil nil nil shell-command-switch
+                           (concat "cd " dir " ; " packer)))
        (progn
          (call-process shell-file-name nil nil nil shell-command-switch
                        (concat "cd " dir " ; rm " files))
@@ -496,10 +496,10 @@ Return whether the unpacking was successful."
   (gnus-make-directory dir)
   (gnus-message 4 "Unpacking: %s" (format unpacker packet))
   (prog1
-      (zerop (call-process
-             shell-file-name nil nil nil shell-command-switch
-             (format "cd %s ; %s" (expand-file-name dir)
-                     (format unpacker packet))))
+      (eq 0 (call-process
+            shell-file-name nil nil nil shell-command-switch
+            (format "cd %s ; %s" (expand-file-name dir)
+                    (format unpacker packet))))
     (gnus-message 4 "Unpacking...done")))
 
 (defun gnus-soup-send-packet (packet)
index 245b5ba..7a1ae40 100644 (file)
@@ -1630,7 +1630,7 @@ Gnus might fail to display all of it.")
 
     (gnus-message 5 "Unpacking: %s..." (gnus-uu-command action file-path))
 
-    (if (= 0 (call-process shell-file-name nil
+    (if (eq 0 (call-process shell-file-name nil
                           (gnus-get-buffer-create gnus-uu-output-buffer-name)
                           nil shell-command-switch command))
        (message "")
@@ -1912,8 +1912,8 @@ The user will be asked for a file name."
 
 ;; Encodes with base64 and adds MIME headers
 (defun gnus-uu-post-encode-mime (path file-name)
-  (when (zerop (call-process shell-file-name nil t nil shell-command-switch
-                            (format "%s %s -o %s" "mmencode" path file-name)))
+  (when (eq 0 (call-process shell-file-name nil t nil shell-command-switch
+                           (format "%s %s -o %s" "mmencode" path file-name)))
     (gnus-uu-post-make-mime file-name "base64")
     t))
 
@@ -1938,8 +1938,8 @@ The user will be asked for a file name."
 ;; Encodes a file PATH with COMMAND, leaving the result in the
 ;; current buffer.
 (defun gnus-uu-post-encode-file (command path file-name)
-  (= 0 (call-process shell-file-name nil t nil shell-command-switch
-                    (format "%s %s %s" command path file-name))))
+  (eq 0 (call-process shell-file-name nil t nil shell-command-switch
+                     (format "%s %s %s" command path file-name))))
 
 (defun gnus-uu-post-news-inews ()
   "Posts the composed news article and encoded file.
index 3f6fe7d..6186f3c 100644 (file)
@@ -648,8 +648,8 @@ Pass INFO on to CALLBACK."
       (delete-file from)))
 
 (defun mail-source-fetch-with-program (program)
-  (zerop (call-process shell-file-name nil nil nil
-                      shell-command-switch program)))
+  (eq 0 (call-process shell-file-name nil nil nil
+                     shell-command-switch program)))
 
 (defun mail-source-run-script (script spec &optional delay)
   (when script
index e38adcb..e6aa0cc 100644 (file)
@@ -656,7 +656,7 @@ to supply to the test."
               test (list shell-file-name nil nil nil
                          shell-command-switch test)
               status (apply 'call-process test))
-        (= 0 status))))
+        (eq 0 status))))
       (push (list otest result) mailcap-viewer-test-cache)
       result)))
 
index 97192eb..ffb6431 100644 (file)
@@ -781,7 +781,7 @@ spam-use-* variable.")
     nil))
 
 (defun spam-fetch-field-message-id-fast (article)
-  "Fetch the `Message-ID' field quickly, using the internal
+  "Fetch the `subject' field quickly, using the internal
   gnus-data-list function"
   (if (and (numberp article)
           (assoc article (gnus-data-list nil)))
@@ -1539,8 +1539,8 @@ REMOVE not nil, remove the ADDRESSES."
                 (point-min) (point-max) 
                 spam-bogofilter-path
                 nil temp-buffer-name nil
-                (if db `("-d" ,db "-v") `("-v"))))
-       (setq return (spam-check-bogofilter-headers score))))
+                (if db `("-d" ,db "-v") `("-v")))
+         (setq return (spam-check-bogofilter-headers score)))))
     return))
 
 (defun spam-bogofilter-register-with-bogofilter (articles 
@@ -1597,7 +1597,7 @@ REMOVE not nil, remove the ADDRESSES."
                        (if spam-spamoracle-database
                            `("-f" ,spam-spamoracle-database "mark")
                          '("mark")))))
-           (if (zerop status)
+           (if (eq 0 status)
                (progn
                  (set-buffer temp-buffer-name)
                  (goto-char (point-min))
@@ -1625,7 +1625,7 @@ REMOVE not nil, remove the ADDRESSES."
                           `("-f" ,spam-spamoracle-database 
                             "add" ,arg)
                         `("add" ,arg)))))
-         (when (not (zerop status))
+         (when (not (eq 0 status))
            (error "Error running spamoracle" status)))))))
 
 (defun spam-spamoracle-learn-ham (articles &optional unregister)