Synch to No Gnus 200501120840.
[elisp/gnus.git-] / lisp / mm-decode.el
index 020a065..7f97dad 100644 (file)
@@ -149,12 +149,14 @@ when displaying the image.  The default value is \"\\\\`cid:\" which only
 matches parts embedded to the Multipart/Related type MIME contents and
 Gnus will never connect to the spammer's site arbitrarily.  You may
 set this variable to nil if you consider all urls to be safe."
+  :version "21.4"
   :type '(choice (regexp :tag "Regexp")
                 (const :tag "All URLs are safe" nil))
   :group 'mime-display)
 
 (defcustom mm-inline-text-html-with-w3m-keymap t
   "If non-nil, use emacs-w3m command keys in the article buffer."
+  :version "21.4"
   :type 'boolean
   :group 'mime-display)
 
@@ -378,6 +380,7 @@ If not set, `default-directory' will be used."
 
 (defcustom mm-attachment-file-modes 384
   "Set the mode bits of saved attachments to this integer."
+  :version "21.4"
   :type 'integer
   :group 'mime-display)
 
@@ -435,6 +438,7 @@ If not set, `default-directory' will be used."
   "Option of decrypting encrypted parts.
 `never', not decrypt; `always', always decrypt;
 `known', only decrypt known protocols.  Otherwise, ask user."
+  :version "21.4"
   :type '(choice (item always)
                 (item never)
                 (item :tag "only known protocols" known)
@@ -579,11 +583,7 @@ Postpone undisplaying of viewers for types in
 (defun mm-dissect-singlepart (ctl cte &optional force cdl description id)
   (when (or force
            (if (equal "text/plain" (car ctl))
-               ;; FIXME: This is a kludge.  Proper fix is to make
-               ;; gnus-display-mime invoke mm-uu-dissect on all
-               ;; textual MIME parts, and stop using mm-fill-flowed
-               ;; here.
-               (and mm-fill-flowed (assoc 'format ctl))
+               (assoc 'format ctl)
              t))
     (mm-make-handle
      (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
@@ -621,14 +621,14 @@ Postpone undisplaying of viewers for types in
   "Copy the contents of the current buffer to a fresh buffer."
   (save-excursion
     (let ((obuf (current-buffer))
-         (multibyte enable-multibyte-characters)
          beg)
       (goto-char (point-min))
       (search-forward-regexp "^\n" nil t)
       (setq beg (point))
-      (set-buffer (generate-new-buffer " *mm*"))
-      ;; Preserve the data's unibyteness (for url-insert-file-contents).
-      (set-buffer-multibyte multibyte)
+      (set-buffer
+       ;; Preserve the data's unibyteness (for url-insert-file-contents).
+       (let ((default-enable-multibyte-characters (mm-multibyte-p)))
+        (generate-new-buffer " *mm*")))
       (insert-buffer-substring obuf beg)
       (current-buffer))))