diff --git a/mu4e/mu4e-bookmarks.el b/mu4e/mu4e-bookmarks.el index c25b42f5..36117e54 100644 --- a/mu4e/mu4e-bookmarks.el +++ b/mu4e/mu4e-bookmarks.el @@ -81,7 +81,7 @@ query." :type '(repeat (plist)) :group 'mu4e-bookmarks) - + (defun mu4e-ask-bookmark (prompt) "Ask user for bookmark using PROMPT. Return the corresponding query. The bookmark are as defined in @@ -96,7 +96,9 @@ Return the corresponding query. The bookmark are as defined in (propertize (make-string 1 (plist-get bm :key)) 'face 'mu4e-highlight-face) "]" - (plist-get bm :name))) (mu4e-bookmarks) ", ")) + (plist-get bm :name))) + (mu4e-filter-single-key (mu4e-bookmarks)) + ", ")) (kar (read-char (concat prompt bmarks)))) (mu4e-get-bookmark-query kar))) diff --git a/mu4e/mu4e-folders.el b/mu4e/mu4e-folders.el index 43dd0e8a..34a7a04e 100644 --- a/mu4e/mu4e-folders.el +++ b/mu4e/mu4e-folders.el @@ -280,8 +280,9 @@ from all maildirs under `mu4e-maildir'." (if (not (mu4e-maildir-shortcuts)) (substring-no-properties (funcall mu4e-completing-read-function prompt (mu4e-get-maildirs))) - (let* ((mlist (append (mu4e-maildir-shortcuts) - '((:maildir "ther" :key ?o)))) + (let* ((mlist (append + (mu4e-filter-single-key (mu4e-maildir-shortcuts)) + '((:maildir "ther" :key ?o)))) (fnames (mapconcat (lambda (item) diff --git a/mu4e/mu4e-helpers.el b/mu4e/mu4e-helpers.el index 5ee2ad17..5b26fa1a 100644 --- a/mu4e/mu4e-helpers.el +++ b/mu4e/mu4e-helpers.el @@ -212,6 +212,13 @@ Function returns the cdr of the list element." (cdr chosen) (mu4e-warn "Unknown shortcut '%c'" response)))) +(defun mu4e-filter-single-key (lst) + "Return a list consisting of LST items with a `characterp' :key prop." + ;; This works for bookmarks and maildirs. + (seq-filter (lambda (item) + (characterp (plist-get item :key))) + lst)) + ;;; Logging / debugging diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index 2de97dae..d56a07f0 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -216,7 +216,10 @@ character of the keyboard shortcut 'help-echo query))) (format "%s%s\n" (make-string (- max-length (string-width name)) ?\s) - (mu4e--query-item-display-counts item)))))) data "")) + (mu4e--query-item-display-counts item)))))) + ;; only item which have a single-character :key + (mu4e-filter-single-key data) + "")) (defun mu4e--key-val (key val &optional unit) "Show a KEY / VAL pair, with optional UNIT."