[gnus git] branch master updated: m0-3-9-g1bf64ef =1= Add automatic application/octet-stream type guessing

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  1bf64efec25111758f836e83572efb62b5d94c35 (commit)
      from  d30ad4e7f9924a45d2c428420a7ea71e36d94a60 (commit)


- Log -----------------------------------------------------------------
commit 1bf64efec25111758f836e83572efb62b5d94c35
Author: Lars Ingebrigtsen <[email protected]>
Date:   Thu Feb 16 06:42:00 2012 +0100

    Add automatic application/octet-stream type guessing
    
    * mm-decode.el (mm-dissect-singlepart): Guess what the type of
    application/octet-stream parts really is.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 43b4a38..742beea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2012-02-16  Lars Ingebrigtsen  <[email protected]>
 
+	* mm-decode.el (mm-dissect-singlepart): Guess what the type of
+	application/octet-stream parts really is.
+
 	* gnus-sum.el (gnus-propagate-marks): Remove.
 
 2012-02-15  Lars Ingebrigtsen  <[email protected]>
diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el
index 03bcaa1..5f5d06d 100644
--- a/lisp/mm-decode.el
+++ b/lisp/mm-decode.el
@@ -659,6 +659,15 @@ Postpone undisplaying of viewers for types in
 	    (if (equal "text/plain" (car ctl))
 		(assoc 'format ctl)
 	      t))
+    ;; Guess what the type of application/octet-stream parts should
+    ;; really be.
+    (let ((filename (cdr (assq 'filename (cdr cdl)))))
+      (when (and (equal (car ctl) "application/octet-stream")
+		 filename
+		 (string-match "\\.\\([^.]+\\)$" filename))
+	(let ((new-type (mailcap-extension-to-mime (match-string 1 filename))))
+	  (when new-type
+	    (setcar ctl new-type)))))
     (let ((handle
 	   (mm-make-handle
 	    (mm-copy-to-buffer) ctl cte nil cdl description nil id))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog    |    3 +++
 lisp/mm-decode.el |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.