mirror of https://github.com/djcb/mu.git
mu4e-bookmarks: use mu4e-read-option
Use the generic function.
This commit is contained in:
parent
0354fa4fac
commit
edb8cf17a9
|
@ -87,20 +87,13 @@ query."
|
||||||
Return the corresponding query. The bookmark are as defined in
|
Return the corresponding query. The bookmark are as defined in
|
||||||
`mu4e-bookmarks'."
|
`mu4e-bookmarks'."
|
||||||
(unless (mu4e-bookmarks) (mu4e-error "No bookmarks defined"))
|
(unless (mu4e-bookmarks) (mu4e-error "No bookmarks defined"))
|
||||||
(let* ((prompt (mu4e-format "%s" prompt))
|
(let* ((bmarks (seq-map (lambda (bm)
|
||||||
(bmarks
|
(cons (format "%c%s"
|
||||||
(mapconcat
|
(plist-get bm :key)
|
||||||
(lambda (bm)
|
(plist-get bm :name))
|
||||||
(concat
|
(plist-get bm :query)))
|
||||||
"["
|
(mu4e-filter-single-key (mu4e-bookmarks)))))
|
||||||
(propertize (make-string 1 (plist-get bm :key))
|
(mu4e-read-option bmarks prompt)))
|
||||||
'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)))
|
|
||||||
|
|
||||||
(defun mu4e-get-bookmark-query (kar)
|
(defun mu4e-get-bookmark-query (kar)
|
||||||
"Get the corresponding bookmarked query for shortcut KAR.
|
"Get the corresponding bookmarked query for shortcut KAR.
|
||||||
|
|
Loading…
Reference in New Issue