[gnus git] branch master updated: m0-1-21-gc826255 =2= Display archives that have directory structures better in mm-archive ; * gnus-util.el (gnus-recursive-directory-files): New function.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  c8262557b3e9277ce42d13affb13aa50b5ae85cb (commit)
       via  829671e7c629e44696cd15b9c910c9b24295241b (commit)
      from  9a274e2717761b1e96dfd82c66a0133fe31c3315 (commit)


- Log -----------------------------------------------------------------
commit c8262557b3e9277ce42d13affb13aa50b5ae85cb
Author: Lars Ingebrigtsen <[email protected]>
Date:   Wed Feb 1 02:36:41 2012 +0100

    Display archives that have directory structures better in mm-archive
    
    * mm-archive.el (mm-dissect-archive): Use it to get all file names.
    Use recursive deletion.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0a3b6a3..6a0a306 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2012-02-01  Lars Ingebrigtsen  <[email protected]>
 
+	* mm-archive.el (mm-dissect-archive): Use it to get all file names.
+	Use recursive deletion.
+
 	* gnus-util.el (gnus-recursive-directory-files): New function.
 
 	* mm-archive.el (mm-archive-list-files): Inline text and image parts.
diff --git a/lisp/mm-archive.el b/lisp/mm-archive.el
index c141fdb..d8f47df 100644
--- a/lisp/mm-archive.el
+++ b/lisp/mm-archive.el
@@ -42,19 +42,13 @@
 		   nil (append (cdr decoder) (list dir))))
 	  `("multipart/mixed"
 	    ,handle
-	    ,@(mm-archive-list-files dir)))
-      (dolist (file (directory-files dir))
-	(unless (member file '("." ".."))
-	  (ignore-errors
-	    (delete-file (expand-file-name file dir)))))
-      (ignore-errors
-	(delete-directory dir)))))
+	    ,@(mm-archive-list-files (gnus-recursive-directory-files dir))))
+      (delete-directory dir t))))
 
-(defun mm-archive-list-files (dir)
+(defun mm-archive-list-files (files)
   (let ((handles nil)
 	type disposition)
-    (dolist (file (directory-files dir))
-      (unless (member file '("." ".."))
+    (dolist (file files)
 	(with-temp-buffer
 	  (when (string-match "\\.\\([^.]+\\)$" file)
 	    (setq type (mailcap-extension-to-mime (match-string 1 file))))
@@ -73,7 +67,7 @@
 			   '8bit nil
 			   `(,disposition (filename . ,file))
 			   nil nil nil)
-	   handles))))
+	 handles)))
     handles))
 
 (provide 'mm-archive)

commit 829671e7c629e44696cd15b9c910c9b24295241b
Author: Lars Ingebrigtsen <[email protected]>
Date:   Wed Feb 1 02:33:31 2012 +0100

    * gnus-util.el (gnus-recursive-directory-files): New function.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1f550af..0a3b6a3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2012-02-01  Lars Ingebrigtsen  <[email protected]>
 
+	* gnus-util.el (gnus-recursive-directory-files): New function.
+
 	* mm-archive.el (mm-archive-list-files): Inline text and image parts.
 	(mm-archive-decoders): Add tgz support.
 
diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el
index da899f4..fef67cd 100644
--- a/lisp/gnus-util.el
+++ b/lisp/gnus-util.el
@@ -1927,6 +1927,19 @@ Sizes are in pixels."
                    image)))
       image)))
 
+(defun gnus-recursive-directory-files (dir)
+  "Return all regular files below DIR."
+  (let (files)
+    (dolist (file (directory-files dir t))
+      (when (and (not (member (file-name-nondirectory file) '("." "..")))
+		 (file-readable-p file))
+	(cond
+	 ((file-regular-p file)
+	  (push file files))
+	 ((file-directory-p file)
+	  (setq files (append (gnus-recursive-directory-files file) files))))))
+    files))
+
 (defun gnus-list-memq-of-list (elements list)
   "Return non-nil if any of the members of ELEMENTS are in LIST."
   (let ((found nil))

-----------------------------------------------------------------------
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     |    5 +++++
 lisp/gnus-util.el  |   13 +++++++++++++
 lisp/mm-archive.el |   52 +++++++++++++++++++++++-----------------------------
 3 files changed, 41 insertions(+), 29 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.