Function: mh-sub-folders-actual

mh-sub-folders-actual is a byte-compiled function defined in mh-utils.el.gz.

Signature

(mh-sub-folders-actual FOLDER)

Documentation

Execute the command folders to return the sub-folders of FOLDER.

Filters out the folder names that start with "." so that directories that aren't usually mail folders are hidden. Expects FOLDER to have already been normalized with
  (mh-normalize-folder-name folder nil nil t)

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-utils.el.gz
;; FIXME: This function does not do well if FOLDER does not exist. It
;; then changes the context to that folder which causes problems down
;; the line. Since a folder in the cache could later be deleted, it
;; would be good for mh-sub-folders-actual to return nil in this case
;; so that mh-sub-folders could delete it from the cache. This
;; function could protect itself by using a temporary context.
(defun mh-sub-folders-actual (folder)
  "Execute the command folders to return the sub-folders of FOLDER.
Filters out the folder names that start with \".\" so that
directories that aren't usually mail folders are hidden.
Expects FOLDER to have already been normalized with
  (mh-normalize-folder-name folder nil nil t)"
  (let ((arg-list `(,(expand-file-name "folders" mh-progs)
                    nil (t nil) nil "-noheader" "-norecurse" "-nototal"
                    ,@(if (stringp folder) (list folder) ())))
        (current-folder (concat
                         (with-temp-buffer
                           (call-process (expand-file-name "folder" mh-progs)
                                         nil '(t nil) nil "-fast")
                           (buffer-substring (point-min) (1- (point-max))))
                         "+")))
    (with-temp-buffer
      (apply #'call-process arg-list)
      (mh-sub-folders-parse folder current-folder))))