Function: mh-read-folder-sequences

mh-read-folder-sequences is an autoloaded and byte-compiled function defined in mh-seq.el.gz.

Signature

(mh-read-folder-sequences FOLDER SAVE-REFILES)

Documentation

Read and return the predefined sequences for a FOLDER.

If SAVE-REFILES is non-nil, then keep the sequences that note messages to be refiled.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-seq.el.gz
;;;###mh-autoload
(defun mh-read-folder-sequences (folder save-refiles)
  "Read and return the predefined sequences for a FOLDER.
If SAVE-REFILES is non-nil, then keep the sequences
that note messages to be refiled."
  (let ((seqs ()))
    (cond (save-refiles
           (mapc (lambda (seq) ; Save the refiling sequences
                   (if (mh-folder-name-p (mh-seq-name seq))
                       (setq seqs (cons seq seqs))))
                 mh-seq-list)))
    (save-excursion
      (if (eq 0 (mh-exec-cmd-quiet nil "mark" folder "-list"))
          (progn
            ;; look for name in line of form "cur: 4" or "myseq (private): 23"
            (while (re-search-forward "^[^: ]+" nil t)
              (setq seqs (cons (mh-make-seq (intern (buffer-substring
                                                     (match-beginning 0)
                                                     (match-end 0)))
                                            (mh-read-msg-list))
                               seqs)))
            (delete-region (point-min) (point))))) ; avoid race with
                                        ; mh-process-daemon
    seqs))