[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-art.el,v

From: Katsumi Yamaoka
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/gnus-art.el,v
Date: Tue, 09 Sep 2008 22:48:47 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Katsumi Yamaoka <yamaoka>       08/09/09 22:48:46

Index: gnus-art.el
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-art.el,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -b -r1.168 -r1.169
--- gnus-art.el 9 Sep 2008 06:23:40 -0000       1.168
+++ gnus-art.el 9 Sep 2008 22:48:45 -0000       1.169
@@ -5138,11 +5138,14 @@
           (mm-string-to-multibyte contents)))
        (goto-char b)))))
-(defun gnus-mime-set-charset-parameters (handle)
-  "Set charset to parameters in HANDLE.
-The value of `gnus-newsgroup-charset' is used as a charset."
+(defun gnus-mime-set-charset-parameters (handle charset)
+  "Set CHARSET to parameters in HANDLE.
+CHARSET may either be a string or a symbol."
+  (unless (stringp charset)
+    (setq charset (symbol-name charset)))
   (if (stringp (car handle))
-      (mapc #'gnus-mime-strip-charset-parameters (cdr handle))
+      (dolist (h (cdr handle))
+       (gnus-mime-set-charset-parameters h charset))
     (let* ((type (mm-handle-type (if (equal (mm-handle-media-type handle)
@@ -5150,11 +5153,10 @@
                                         (mm-extern-cache-contents handle))
                                       (mm-handle-cache handle))
-          (charset (assq 'charset (cdr type))))
-      (if charset
-         (setcdr charset (symbol-name gnus-newsgroup-charset))
-       (setcdr type (cons (cons 'charset (symbol-name gnus-newsgroup-charset))
-                          (cdr type)))))))
+          (param (assq 'charset (cdr type))))
+      (if param
+         (setcdr param charset)
+       (setcdr type (cons (cons 'charset charset) (cdr type)))))))
 (defun gnus-mime-view-part-as-charset (&optional handle arg)
   "Insert the MIME part under point into the current buffer using the
@@ -5164,18 +5166,18 @@
   (let ((handle (or handle (get-text-property (point) 'gnus-data)))
        (fun (get-text-property (point) 'gnus-callback))
        (gnus-newsgroup-ignored-charsets 'gnus-all)
-       gnus-newsgroup-charset form preferred parts)
+       charset form preferred parts)
     (when handle
       (when (prog1
                (and fun
-                    (setq gnus-newsgroup-charset
+                    (setq charset
                           (or (cdr (assq
                               (mm-read-coding-system "Charset: "))))
              (if (mm-handle-undisplayer handle)
                  (mm-remove-part handle)))
-       (gnus-mime-set-charset-parameters handle)
+       (gnus-mime-set-charset-parameters handle charset)
        (when (and (consp (setq form (cdr-safe fun)))
                   (setq form (ignore-errors
                                (assq 'gnus-mime-display-alternative form)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]