[gnus git] branch master updated: m0-1-22-g5f311d5 =1= (mm-dissect-archive): Add support for zip files.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  5f311d5c254790ac0d0172f3ac17213ecd64595b (commit)
      from  c8262557b3e9277ce42d13affb13aa50b5ae85cb (commit)


- Log -----------------------------------------------------------------
commit 5f311d5c254790ac0d0172f3ac17213ecd64595b
Author: Lars Ingebrigtsen <[email protected]>
Date:   Wed Feb 1 02:44:01 2012 +0100

    (mm-dissect-archive): Add support for zip files.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6a0a306..b1a3ecb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
 
 	* mm-archive.el (mm-dissect-archive): Use it to get all file names.
 	Use recursive deletion.
+	(mm-dissect-archive): Add support for zip files.
 
 	* gnus-util.el (gnus-recursive-directory-files): New function.
 
diff --git a/lisp/mm-archive.el b/lisp/mm-archive.el
index d8f47df..69cbfb7 100644
--- a/lisp/mm-archive.el
+++ b/lisp/mm-archive.el
@@ -24,6 +24,7 @@
 
 (defvar mm-archive-decoders
   '(("application/ms-tnef" "tnef" "-f" "-" "-C")
+    ("application/zip" "unzip" "-j" "-x" "%f" "-d")
     ("application/x-gtar-compressed" "tar" "xzf" "-" "-C")
     ("application/x-tar" "tar" "xf" "-" "-C")))
 
@@ -37,9 +38,17 @@
 	(progn
 	  (mm-with-unibyte-buffer
 	    (mm-insert-part handle)
+	    (if (member "%f" decoder)
+		(let ((file (expand-file-name "mail.zip" dir)))
+		  (write-region (point-min) (point-max) file nil 'silent)
+		  (setq decoder (copy-sequence decoder))
+		  (setcar (member "%f" decoder) file)
+		  (apply 'call-process (car decoder) nil nil nil
+			 (append (cdr decoder) (list dir)))
+		  (delete-file file))
 	    (apply 'call-process-region (point-min) (point-max) (car decoder)
 		   nil (get-buffer-create "*tnef*")
-		   nil (append (cdr decoder) (list dir))))
+		     nil (append (cdr decoder) (list dir)))))
 	  `("multipart/mixed"
 	    ,handle
 	    ,@(mm-archive-list-files (gnus-recursive-directory-files dir))))

-----------------------------------------------------------------------
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     |    1 +
 lisp/mm-archive.el |   15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 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.