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.
(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))
(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)
(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 "")
;; 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))
;; 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.
(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
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)))
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)))
(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
(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))
`("-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)