mirror of https://github.com/djcb/mu.git
mu4e-search: improve search modeline item
This commit is contained in:
parent
74fb72035a
commit
891c5838da
|
@ -482,20 +482,44 @@ the mode-line.")
|
||||||
|
|
||||||
(defun mu4e--search-modeline-item ()
|
(defun mu4e--search-modeline-item ()
|
||||||
"Get mu4e-search modeline item."
|
"Get mu4e-search modeline item."
|
||||||
(let* ((flagstr
|
(let* ((label (lambda (label-cons)
|
||||||
(mapconcat
|
(if mu4e-use-fancy-chars
|
||||||
(lambda (flag-cell)
|
(cdr label-cons) (car label-cons))))
|
||||||
(if (car flag-cell)
|
(props
|
||||||
(if mu4e-use-fancy-chars
|
`((,mu4e-search-full ,mu4e-search-full-label
|
||||||
(cddr flag-cell) (cadr flag-cell) ) ""))
|
"Full search")
|
||||||
`((,mu4e-search-full . ,mu4e-search-full-label)
|
(,mu4e-search-include-related
|
||||||
(,mu4e-search-include-related . ,mu4e-search-related-label)
|
,mu4e-search-related-label
|
||||||
(,mu4e-search-threads . ,mu4e-search-threaded-label)
|
"Include related messages")
|
||||||
(,mu4e-search-skip-duplicates
|
(,mu4e-search-threads
|
||||||
. ,mu4e-search-skip-duplicates-label)
|
,mu4e-search-threaded-label
|
||||||
(,mu4e-search-hide-enabled . ,mu4e-search-hide-label))
|
"Show message threads")
|
||||||
"")))
|
(,mu4e-search-skip-duplicates
|
||||||
(concat flagstr " " mu4e--search-last-query)))
|
,mu4e-search-skip-duplicates-label
|
||||||
|
"Skip duplicate messages")
|
||||||
|
(,mu4e-search-hide-enabled
|
||||||
|
,mu4e-search-hide-label
|
||||||
|
"Enable message hide predicate"))))
|
||||||
|
(concat
|
||||||
|
(propertize
|
||||||
|
(mapconcat
|
||||||
|
(lambda (cell)
|
||||||
|
(when (nth 0 cell) (funcall label (nth 1 cell))))
|
||||||
|
props "")
|
||||||
|
'help-echo (concat "mu4e search properties legend\n\n"
|
||||||
|
(mapconcat
|
||||||
|
(lambda (cell)
|
||||||
|
(format "%s %s (%s)"
|
||||||
|
(funcall label (nth 1 cell))
|
||||||
|
(nth 2 cell)
|
||||||
|
(if (nth 0 cell) "yes" : "no")))
|
||||||
|
props "\n")))
|
||||||
|
" ["
|
||||||
|
(propertize
|
||||||
|
mu4e--search-last-query
|
||||||
|
'face 'mu4e-title-face
|
||||||
|
'help-echo (format "mu4e query:\n\t%s" mu4e--search-last-query))
|
||||||
|
"]")))
|
||||||
|
|
||||||
(define-minor-mode mu4e-search-minor-mode
|
(define-minor-mode mu4e-search-minor-mode
|
||||||
"Mode for searching for messages."
|
"Mode for searching for messages."
|
||||||
|
|
Loading…
Reference in New Issue