(article-display-x-face): Make it possible to set the
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 29 Aug 2003 04:58:38 +0000 (04:58 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 29 Aug 2003 04:58:38 +0000 (04:58 +0000)
 gnus-article-x-face-command variable to the lambda form.

lisp/ChangeLog
lisp/gnus-art.el

index 886e7b6..0756435 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-29  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (article-display-x-face): Make it possible to set
+       the gnus-article-x-face-command variable to the lambda form.
+
 2003-08-27  Simon Josefsson  <jas@extundo.com>
 
        * mm-decode.el (mm-remove-part): Try to kill external displayers
index fd79df0..c92f394 100644 (file)
@@ -2077,23 +2077,25 @@ unfolded."
                               (not (string-match gnus-article-x-face-too-ugly
                                                  from)))))
            ;; We display the face.
-           (if (symbolp gnus-article-x-face-command)
-               ;; The command is a lisp function, so we call it.
-               (if (functionp gnus-article-x-face-command)
-                   (funcall gnus-article-x-face-command face)
-                 (error "%s is not a function" gnus-article-x-face-command))
-             ;; The command is a string, so we interpret the command
-             ;; as a, well, command, and fork it off.
-             (let ((process-connection-type nil))
-               (process-kill-without-query
-                (start-process
-                 "article-x-face" nil shell-file-name shell-command-switch
-                 gnus-article-x-face-command))
-               (with-temp-buffer
-                 (insert face)
-                 (process-send-region "article-x-face"
-                                      (point-min) (point-max)))
-               (process-send-eof "article-x-face")))))))))
+           (cond ((stringp gnus-article-x-face-command)
+                  ;; The command is a string, so we interpret the command
+                  ;; as a, well, command, and fork it off.
+                  (let ((process-connection-type nil))
+                    (process-kill-without-query
+                     (start-process
+                      "article-x-face" nil shell-file-name
+                      shell-command-switch gnus-article-x-face-command))
+                    (with-temp-buffer
+                      (insert face)
+                      (process-send-region "article-x-face"
+                                           (point-min) (point-max)))
+                    (process-send-eof "article-x-face")))
+                 ((functionp gnus-article-x-face-command)
+                  ;; The command is a lisp function, so we call it.
+                  (funcall gnus-article-x-face-command face))
+                 (t
+                  (error "%s is not a function"
+                         gnus-article-x-face-command)))))))))
 
 (defun article-decode-mime-words ()
   "Decode all MIME-encoded words in the article."