diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2012-12-29 23:18:05 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2012-12-29 23:18:05 +0000 |
commit | 4d1d3f07a430aeca457a408c3fd5da65210962be (patch) | |
tree | b197beaa11ac72aff2931c6c0820b2e3cb397fe6 /lisp/gnus/nnfolder.el | |
parent | eff2eb5812e964024c3aa20197b21f12d37155dd (diff) | |
download | emacs-4d1d3f07a430aeca457a408c3fd5da65210962be.tar.gz |
lisp/gnus/nnfolder.el: Allow regenerating recursive nnfolder names
Diffstat (limited to 'lisp/gnus/nnfolder.el')
-rw-r--r-- | lisp/gnus/nnfolder.el | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index e93bd7f43e0..ae9e551c93a 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -1004,6 +1004,28 @@ deleted. Point is left where the deleted region was." (nnfolder-save-nov)) (current-buffer)))))) +(defun nnfolder-recursive-directory-files (dir prefix) + (let ((files nil)) + (dolist (file (directory-files dir)) + (cond + ((or (file-symlink-p (expand-file-name file dir)) + (member file '("." ".."))) + ;; Ignore + ) + ((file-directory-p (expand-file-name file dir)) + (setq files (nconc (nnfolder-recursive-directory-files + (expand-file-name file dir) + (if prefix + (concat prefix "." (directory-file-name file)) + (file-name-nondirectory file))) + files))) + ((file-regular-p (expand-file-name file dir)) + (push (if prefix + (concat prefix "." file) + file) + files)))) + files)) + ;;;###autoload (defun nnfolder-generate-active-file () "Look for mbox folders in the nnfolder directory and make them into groups. @@ -1020,10 +1042,13 @@ This command does not work if you use short group names." (when (not (message-mail-file-mbox-p file)) (ignore-errors (delete-file file))))) - (dolist (file (directory-files nnfolder-directory)) + (dolist (file (if nnmail-use-long-file-names + (directory-files nnfolder-directory) + (nnfolder-recursive-directory-files + nnfolder-directory nil))) (when (and (not (backup-file-name-p file)) (message-mail-file-mbox-p - (nnheader-concat nnfolder-directory file))) + (nnfolder-group-pathname file))) (let ((oldgroup (assoc file nnfolder-group-alist))) (if oldgroup (nnheader-message 5 "Refreshing group %s..." file) |