T-gnus 6.14.4.
[elisp/gnus.git-] / lisp / gnus-art.el
index d5cf865..02ccf53 100644 (file)
 (eval-when-compile (require 'static))
 
 (require 'path-util)
-(require 'custom)
 (require 'gnus)
 (require 'gnus-sum)
 (require 'gnus-spec)
 (require 'gnus-int)
-(require 'browse-url)
 (require 'alist)
 (require 'mime-view)
 
@@ -211,16 +209,24 @@ regexp.  If it matches, the text in question is not a signature."
   :group 'gnus-article-hiding)
 
 (defcustom gnus-article-x-face-command
-  (if (and (not gnus-xemacs)
-          window-system
-          (module-installed-p 'x-face-mule))
-      'x-face-mule-gnus-article-display-x-face
-    "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | display -"
-    )
+  (cond
+   ((and (fboundp 'image-type-available-p)
+        (or (image-type-available-p 'xpm)
+            (image-type-available-p 'xbm)))
+    'gnus-article-display-xface)
+   ((and (not gnus-xemacs)
+        window-system
+        (module-installed-p 'x-face-mule))
+    'x-face-mule-gnus-article-display-x-face)
+   (t
+    "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | display -"))
   "*String or function to be executed to display an X-Face header.
 If it is a string, the command will be executed in a sub-shell
 asynchronously.         The compressed face will be piped to this command."
-  :type 'string                                ;Leave function case to Lisp.
+  :type '(choice string
+                (function-item gnus-article-display-xface)
+                (function-item x-face-mule-gnus-article-display-x-face)
+                function)
   :group 'gnus-article-washing)
 
 (defcustom gnus-article-x-face-too-ugly nil
@@ -3193,7 +3199,7 @@ value of the variable `gnus-show-mime' is non-nil."
                                           (cons (caddr c) (car c)))
                                         gnus-mime-button-commands))))))
        (if response
-           (funcall response))))))
+           (call-interactively response))))))
 
 (defun gnus-mime-view-all-parts (&optional handles)
   "View all the MIME parts."
@@ -5121,8 +5127,11 @@ For example:
     (gnus-run-hooks 'gnus-part-display-hook)
     (unless gnus-inhibit-treatment
       (while (setq elem (pop alist))
-       (with-current-buffer gnus-summary-buffer
-         (setq val (symbol-value (car elem))))
+       (setq val
+             (save-excursion
+               (if (gnus-buffer-live-p gnus-summary-buffer)
+                   (set-buffer gnus-summary-buffer))
+               (symbol-value (car elem))))
        (when (and (or (consp val)
                       treated-type)
                   (gnus-treat-predicate val)