(cl-incf start-pos))
(let* ((name (buffer-substring start-pos has-pos))
(first-char (aref name 0))
+ (second-char (and (length> name 1) (aref name 1)))
(last-char (aref name (1- (length name)))))
(unless (member first-char '(?. ?# ?,))
(when (and (equal last-char ?+) (equal name current-folder))
(setq name (substring name 0 (1- (length name)))))
+ ;; nmh outputs double slash in root folder, e.g., "//tmp"
+ (when (and (equal first-char ?/) (equal second-char ?/))
+ (setq name (substring name 1)))
(push
(cons name
(search-forward "(others)" (line-end-position) t))
(when (stringp folder)
(setq results (cdr results))
(let ((folder-name-len (length (format "%s/" (substring folder 1)))))
+ (when (equal "+/" folder)
+ ;; folder "+/" includes a trailing slash
+ (cl-decf folder-name-len))
(setq results (mapcar (lambda (f)
(cons (substring (car f) folder-name-len)
(cdr f)))
"Test `mh-sub-folders-parse' with root folder."
(with-temp-buffer
(insert "/+ has no messages.\n")
+ (insert "/ has no messages.\n")
(insert "//nmh-style has no messages.\n")
+ (insert "/mu-style has no messages.\n")
(should (equal
(mh-sub-folders-parse "+/" "inbox+")
- '(("nmh-style"))))))
+ '(("") ("nmh-style") ("mu-style"))))))
;; Folder names that are used by the following tests.
"/abso-folder/food has no messages."))
(("folders" "-noheader" "-norecurse" "-nototal" "+/") .
("/+ has no messages ; (others)."
- "//abso-folder has no messages ; (others)."
- "//tmp has no messages ; (others)."))
+ "/abso-folder has no messages ; (others)."
+ "/tmp has no messages ; (others)."))
))
(arglist (cons (file-name-base program) args)))
(let ((response-list-cons (assoc arglist argument-responses)))
Mailutils 3.5, 3.7, and 3.13 are known not to."
(cond ((not (stringp variant))) ;our mock handles it
((string-search "GNU Mailutils" variant)
- nil)
+ (let ((mu-version (string-remove-prefix "GNU Mailutils " variant)))
+ (version<= "3.13.91" mu-version)))
(t))) ;no other known failures