emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4de0737: Work for application/x-tar-gz and image/sv


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master 4de0737: Work for application/x-tar-gz and image/svg+xml
Date: Fri, 26 May 2017 04:09:08 -0400 (EDT)

branch: master
commit 4de0737c9b5ae8939763ad70085f02e1eace4032
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    Work for application/x-tar-gz and image/svg+xml
    
    ;; Try inlining the attachment in the article <address@hidden>
    ;; of bug#27078 in the Emacs bug list using Gnus.
    
    * lisp/gnus/mm-archive.el (mm-archive-decoders):
    Add a decoder for application/x-tar-gz.
    (mm-dissect-archive): Error out if a decoder is not found.
    
    * lisp/gnus/mm-decode.el (mm-get-image): Allow image/svg+xml.
---
 lisp/gnus/mm-archive.el | 11 +++++++----
 lisp/gnus/mm-decode.el  |  2 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el
index 5ac8761..103cc89 100644
--- a/lisp/gnus/mm-archive.el
+++ b/lisp/gnus/mm-archive.el
@@ -30,15 +30,18 @@
   '(("application/ms-tnef" t "tnef" "-f" "-" "-C")
     ("application/zip" nil "unzip" "-j" "-x" "%f" "-d")
     ("application/x-gtar-compressed" nil "tar" "xzf" "-" "-C")
+    ("application/x-tar-gz" nil "tar" "xzf" "-" "-C")
     ("application/x-tar" nil "tar" "xf" "-" "-C")))
 
 (defun mm-archive-decoders () mm-archive-decoders)
 
 (defun mm-dissect-archive (handle)
-  (let ((decoder (cddr (assoc (car (mm-handle-type handle))
-                             mm-archive-decoders)))
-       (dir (make-temp-file
-             (expand-file-name "emm." mm-tmp-directory) 'dir)))
+  (let* ((type (car (mm-handle-type handle)))
+        (decoder (cddr (assoc type mm-archive-decoders)))
+        dir)
+    (unless decoder
+      (error "No decoder found for %s" type))
+    (setq dir (make-temp-file (expand-file-name "emm." mm-tmp-directory) 'dir))
     (set-file-modes dir #o700)
     (unwind-protect
        (progn
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 5b8aeb3..c6a0be3 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1555,6 +1555,8 @@ be determined."
            "xbm")
           ((equal type "x-portable-bitmap")
            "pbm")
+          ((equal type "svg+xml")
+           "svg")
           (t type)))
     (or (mm-handle-cache handle)
        (mm-with-unibyte-buffer



reply via email to

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