diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-06-30 19:24:06 +0300 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-06-30 19:24:06 +0300 |
| commit | 9763ca0830b4bb908a074ebcc2bcaf2b56528568 (patch) | |
| tree | 44756be33a87f096a54c8550a02639a3dddeff06 /mu4e | |
| parent | 97fbaf1771d717cdc9d4edaf47c40f5537421ffd (diff) | |
mu4e-folder: don't offer "other" if there are none
When mu4e is not started yet, we don't have "other" maildirs; document and don't
add the 'other' option.
Fixes #2855.
Diffstat (limited to 'mu4e')
| -rw-r--r-- | mu4e/mu4e-folders.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mu4e/mu4e-folders.el b/mu4e/mu4e-folders.el index 3050132..36b3cb8 100644 --- a/mu4e/mu4e-folders.el +++ b/mu4e/mu4e-folders.el @@ -262,12 +262,14 @@ just the query-string. If the special shortcut \"o\" (for _o_ther) is used, or if there a no single-key elements in (mu4e-maildir-shortcuts), let user -choose from all maildirs under `mu4e-maildir'. +choose from all maildirs under `mu4e-maildir'. This is only +available if mu4e is already running. The names of the maildirs are displayed in the minibuffer, suffixed with the short version of the unread counts, as per `mu4e--query-item-display-short-counts'." - (let* ((mdirs + (let* ((other-dirs (mu4e-get-maildirs)) + (mdirs (seq-map (lambda (md) (let* ((qitem (mu4e--query-item-for-maildir-shortcut md)) @@ -280,14 +282,16 @@ suffixed with the short version of the unread counts, as per unreads) md))) (mu4e-filter-single-key (mu4e-maildir-shortcuts)))) ;; special case: handle pseudo-maildir 'other - (mdirs (and mdirs (append mdirs '(("oOther..." . other))))) + (mdirs (if (and mdirs other-dirs) + (append mdirs '(("oOther..." . other))) + mdirs)) (chosen (and mdirs (mu4e-read-option prompt mdirs))) ;; if chosen nothing or other, ask for more. (chosen (if (or (not chosen) (eq chosen 'other)) (list :maildir (substring-no-properties (funcall mu4e-completing-read-function prompt - (mu4e-get-maildirs) nil nil + other-dirs nil nil mu4e-maildir-initial-input))) chosen))) ;; return either the maildir (as a string), or the corresponding |
