From edb8cf17a9bad4e906406f9f9ce72d9c3b726d76 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 14 Feb 2023 23:38:24 +0200 Subject: [PATCH] mu4e-bookmarks: use mu4e-read-option Use the generic function. --- mu4e/mu4e-bookmarks.el | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/mu4e/mu4e-bookmarks.el b/mu4e/mu4e-bookmarks.el index b7a620c5..c7b418d1 100644 --- a/mu4e/mu4e-bookmarks.el +++ b/mu4e/mu4e-bookmarks.el @@ -87,20 +87,13 @@ query." Return the corresponding query. The bookmark are as defined in `mu4e-bookmarks'." (unless (mu4e-bookmarks) (mu4e-error "No bookmarks defined")) - (let* ((prompt (mu4e-format "%s" prompt)) - (bmarks - (mapconcat - (lambda (bm) - (concat - "[" - (propertize (make-string 1 (plist-get bm :key)) - 'face 'mu4e-highlight-face) - "]" - (plist-get bm :name))) - (mu4e-filter-single-key (mu4e-bookmarks)) - ", ")) - (kar (read-char (concat prompt bmarks)))) - (mu4e-get-bookmark-query kar))) + (let* ((bmarks (seq-map (lambda (bm) + (cons (format "%c%s" + (plist-get bm :key) + (plist-get bm :name)) + (plist-get bm :query))) + (mu4e-filter-single-key (mu4e-bookmarks))))) + (mu4e-read-option bmarks prompt))) (defun mu4e-get-bookmark-query (kar) "Get the corresponding bookmarked query for shortcut KAR.