emacs-commit
[Top][All Lists]
Advanced

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

[Emacs-commit] emacs/lisp/mh-e mh-utils.el ChangeLog


From: Bill Wohler
Subject: [Emacs-commit] emacs/lisp/mh-e mh-utils.el ChangeLog
Date: Tue, 28 Feb 2006 23:54:53 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         
Changes by:     Bill Wohler <address@hidden>    06/02/28 23:54:53

Modified files:
        lisp/mh-e      : mh-utils.el ChangeLog 

Log message:
        (mh-folder-list): Fix problem with passing in a folder and getting
        nothing back. Fix problem with passing in empty string and getting the
        entire filesystem (or infinite loop). Don't append slash to folder.
        These fixes fix problems observed with the pick search. Thanks to
        Thomas Baumann for the help (closes SF #1435381).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-utils.el.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.164&tr2=1.165&r1=text&r2=text

Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.164 emacs/lisp/mh-e/ChangeLog:1.165
--- emacs/lisp/mh-e/ChangeLog:1.164     Tue Feb 28 21:47:19 2006
+++ emacs/lisp/mh-e/ChangeLog   Tue Feb 28 23:54:53 2006
@@ -4,6 +4,11 @@
        mh-image-directory.
        (mh-image-load-path): Access mh-image-directory instead of
        mh-image-load-path.
+       (mh-folder-list): Fix problem with passing in a folder and getting
+       nothing back. Fix problem with passing in empty string and getting
+       the entire filesystem (or infinite loop). Don't append slash to
+       folder. These fixes fix problems observed with the pick search.
+       Thanks to Thomas Baumann for the help (closes SF #1435381).
 
 2006-02-27  Bill Wohler  <address@hidden>
 
Index: emacs/lisp/mh-e/mh-utils.el
diff -u emacs/lisp/mh-e/mh-utils.el:1.54 emacs/lisp/mh-e/mh-utils.el:1.55
--- emacs/lisp/mh-e/mh-utils.el:1.54    Tue Feb 28 21:47:19 2006
+++ emacs/lisp/mh-e/mh-utils.el Tue Feb 28 23:54:53 2006
@@ -526,14 +526,19 @@
 ;;;###mh-autoload
 (defun mh-folder-list (folder)
   "Return FOLDER and its descendents.
-Returns a list of strings. For example,
-
-  '(\"inbox\" \"lists\" \"lists/mh-e\").
-
-If folder is nil, then all folders are considered. Respects the
-value of `mh-recursive-folders-flag'. If this flag is nil, and
-the sub-folders have not been explicitly viewed, then they will
-not be returned."
+FOLDER may have a + prefix. Returns a list of strings without the
++ prefix. If FOLDER is nil, then all folders are considered. For
+example, if your Mail directory only contains the folders +inbox,
++outbox, +lists, and +lists/mh-e, then
+
+  (mh-folder-list nil)
+       => (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\")
+  (mh-folder-list \"+lists\")
+       => (\"lists/mh-e\")
+
+Respects the value of `mh-recursive-folders-flag'. If this flag
+is nil, and the sub-folders have not been explicitly viewed, then
+they will not be returned."
   (let ((folder-list))
     ;; Normalize folder. Strip leading +. Add trailing slash (done in
     ;; two steps to avoid infinite loops when replacing "/*$" with "/"
@@ -542,16 +547,16 @@
     ;; returns all the files in / if given an empty string or +.
     (when folder
       (setq folder (mh-replace-regexp-in-string "^\+" "" folder))
-      (setq folder (mh-replace-regexp-in-string "/+$" "" folder))
-      (setq folder (concat folder "/"))
-      (if (equal folder "")
-        (setq folder nil)))
+      (setq folder (mh-replace-regexp-in-string "/+$" "" folder)))
+    ;; Add provided folder to list, unless all folders are asked for.
+    (unless (null folder)
+      (setq folder-list (list folder)))
     (loop for f in (mh-sub-folders folder) do
-          (setq folder-list (append folder-list (list (concat folder (car 
f)))))
-          (if (mh-children-p f)
-              (setq folder-list
-                    (append folder-list
-                            (mh-folder-list (concat folder (car f)))))))
+          (setq folder-list
+                (append folder-list
+                        (if (mh-children-p f)
+                            (mh-folder-list (concat folder "/" (car f)))
+                          (list (concat folder "/" (car f)))))))
     folder-list))
 
 ;;;###mh-autoload




reply via email to

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