diff lisp/gnus/gnus-art.el @ 31785:51cea22fd2aa

Merge from Gnus trunk.
author Dave Love <fx@gnu.org>
date Wed, 20 Sep 2000 16:54:57 +0000
parents 9968f55ad26e
children 88dc0e5a0061
line wrap: on
line diff
--- a/lisp/gnus/gnus-art.el	Wed Sep 20 16:52:10 2000 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Sep 20 16:54:57 2000 +0000
@@ -871,8 +871,11 @@
   :type gnus-article-treat-custom)
 (put 'gnus-treat-overstrike 'highlight t)
 
-(defcustom gnus-treat-display-xface (if (and gnus-xemacs (featurep 'xface))
-					'head nil)
+(defcustom gnus-treat-display-xface 
+  (and (or (and (fboundp 'image-type-available-p)
+		(image-type-available-p 'xbm))
+	   (and gnus-xemacs (featurep 'xface)))
+       'head)
   "Display X-Face headers.
 Valid values are nil, t, `head', `last', an integer or a predicate.
 See the manual for details."
@@ -1510,9 +1513,21 @@
 or not."
   (interactive (list 'force))
   (save-excursion
-    (let ((buffer-read-only nil)
-	  (type (gnus-fetch-field "content-transfer-encoding"))
-	  (charset gnus-newsgroup-charset))
+    (let ((buffer-read-only nil) type charset)
+      (if (gnus-buffer-live-p gnus-original-article-buffer)
+	  (with-current-buffer gnus-original-article-buffer
+	    (setq type
+		  (gnus-fetch-field "content-transfer-encoding"))
+	    (let* ((ct (gnus-fetch-field "content-type"))
+		   (ctl (and ct 
+			     (ignore-errors
+			       (mail-header-parse-content-type ct)))))
+	      (setq charset (and ctl
+				 (mail-content-type-get ctl 'charset)))
+	      (if (stringp charset)
+		  (setq charset (intern (downcase charset)))))))
+      (unless charset 
+	(setq charset gnus-newsgroup-charset))
       (when (or force
 		(and type (string-match "quoted-printable" (downcase type))))
 	(article-goto-body)
@@ -1523,9 +1538,21 @@
 If FORCE, decode the article whether it is marked as base64 not."
   (interactive (list 'force))
   (save-excursion
-    (let ((buffer-read-only nil)
-	  (type (gnus-fetch-field "content-transfer-encoding"))
-	  (charset gnus-newsgroup-charset))
+    (let ((buffer-read-only nil) type charset)
+      (if (gnus-buffer-live-p gnus-original-article-buffer)
+	  (with-current-buffer gnus-original-article-buffer
+	    (setq type
+		  (gnus-fetch-field "content-transfer-encoding"))
+	    (let* ((ct (gnus-fetch-field "content-type"))
+		   (ctl (and ct 
+			     (ignore-errors
+			       (mail-header-parse-content-type ct)))))
+	      (setq charset (and ctl
+				 (mail-content-type-get ctl 'charset)))
+	      (if (stringp charset)
+		  (setq charset (intern (downcase charset)))))))
+      (unless charset 
+	(setq charset gnus-newsgroup-charset))
       (when (or force
 		(and type (string-match "base64" (downcase type))))
 	(article-goto-body)
@@ -1551,7 +1578,19 @@
   (interactive)
   (save-excursion
     (let ((buffer-read-only nil)
-	  (charset gnus-newsgroup-charset))
+	  charset)
+      (if (gnus-buffer-live-p gnus-original-article-buffer)
+	  (with-current-buffer gnus-original-article-buffer
+	    (let* ((ct (gnus-fetch-field "content-type"))
+		   (ctl (and ct 
+			     (ignore-errors
+			       (mail-header-parse-content-type ct)))))
+	      (setq charset (and ctl
+				 (mail-content-type-get ctl 'charset)))
+	      (if (stringp charset)
+		  (setq charset (intern (downcase charset)))))))
+      (unless charset 
+	(setq charset gnus-newsgroup-charset))
       (article-goto-body)
       (save-window-excursion
 	(save-restriction