emacs-devel
[Top][All Lists]
Advanced

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

Re: Displaying MIME parts internally/externally in Gnus


From: Stefan Monnier
Subject: Re: Displaying MIME parts internally/externally in Gnus
Date: Thu, 04 May 2006 08:04:59 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> In `mm-inlinable-p', TYPE is the value of (mm-handle-media-type handle):
[...]
> Stefan, maybe you forgot to send a patch for `mm-decode.el' as well?

Oops, looks like you're right.  The patch is the obvious one.
Sorry 'bout that.


        Stefan


--- orig/lisp/gnus/mm-decode.el
+++ mod/lisp/gnus/mm-decode.el
@@ -562,7 +562,7 @@
           description)
        (setq type (split-string (car ctl) "/"))
        (setq subtype (cadr type)
-             type (pop type))
+             type (car type))
        (setq
         result
         (cond
@@ -641,16 +641,15 @@
 
 (defun mm-copy-to-buffer ()
   "Copy the contents of the current buffer to a fresh buffer."
-  (save-excursion
     (let ((obuf (current-buffer))
          beg)
       (goto-char (point-min))
       (search-forward-regexp "^\n" nil t)
       (setq beg (point))
-      (set-buffer
+    (with-current-buffer
        ;; Preserve the data's unibyteness (for url-insert-file-contents).
        (let ((default-enable-multibyte-characters (mm-multibyte-p)))
-        (generate-new-buffer " *mm*")))
+          (generate-new-buffer " *mm*"))
       (insert-buffer-substring obuf beg)
       (current-buffer))))
 
@@ -701,7 +701,8 @@
                  (forward-line 1)
                  (mm-insert-inline handle (mm-get-part handle))
                  'inline)
-             (if (and method ;; If nil, we always use "save".
+             (setq external
+                    (and method ;; If nil, we always use "save".
                       (stringp method) ;; 'mailcap-save-binary-file
                       (or (eq mm-enable-external t)
                           (and (eq mm-enable-external 'ask)
@@ -714,9 +715,7 @@
                                      (concat
                                       " \"" (format method filename) "\"")
                                    "")
-                                 "? ")))))
-                 (setq external t)
-               (setq external nil))
+                                    "? "))))))
              (if external
                  (mm-display-external
                   handle (or method 'mailcap-save-binary-file))
@@ -1019,10 +1017,10 @@
              methods nil)))
     result))
 
-(defun mm-inlinable-p (handle)
+(defun mm-inlinable-p (handle &optional type)
   "Say whether HANDLE can be displayed inline."
+  (unless type (setq type (mm-handle-media-type handle)))
   (let ((alist mm-inline-media-tests)
-       (type (mm-handle-media-type handle))
        test)
     (while alist
       (when (string-match (caar alist) type)




reply via email to

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