mirror of https://github.com/djcb/mu.git
mu4e-context: improve mode-line item
This commit is contained in:
parent
3716e6da3b
commit
d7eed9e9ff
|
@ -214,12 +214,16 @@ as it is."
|
||||||
|
|
||||||
(defun mu4e--context-modeline-item ()
|
(defun mu4e--context-modeline-item ()
|
||||||
"Propertized string with the current context or nil."
|
"Propertized string with the current context or nil."
|
||||||
(when (mu4e-context-current)
|
(when-let* ((ctx (mu4e-context-current))
|
||||||
(concat
|
(name (and ctx (mu4e-context-name ctx))))
|
||||||
"["
|
(concat
|
||||||
(propertize (mu4e-quote-for-modeline
|
"<"
|
||||||
(mu4e-context-name (mu4e-context-current)))
|
(propertize
|
||||||
'face 'mu4e-context-face) "] " )))
|
name
|
||||||
|
'face 'mu4e-context-face
|
||||||
|
'help-echo
|
||||||
|
(format "mu4e context: %s" name))
|
||||||
|
">")))
|
||||||
|
|
||||||
(define-minor-mode mu4e-context-minor-mode
|
(define-minor-mode mu4e-context-minor-mode
|
||||||
"Mode for switching the mu4e context."
|
"Mode for switching the mu4e context."
|
||||||
|
@ -229,14 +233,12 @@ as it is."
|
||||||
:lighter ""
|
:lighter ""
|
||||||
(mu4e--modeline-register #'mu4e--context-modeline-item))
|
(mu4e--modeline-register #'mu4e--context-modeline-item))
|
||||||
|
|
||||||
|
|
||||||
(defvar mu4e--context-menu-items
|
(defvar mu4e--context-menu-items
|
||||||
'("--"
|
'("--"
|
||||||
["Switch-context" mu4e-context-switch
|
["Switch-context" mu4e-context-switch
|
||||||
:help "Switch the mu4e context"])
|
:help "Switch the mu4e context"])
|
||||||
"Easy menu items for mu4e-context.")
|
"Easy menu items for mu4e-context.")
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
(provide 'mu4e-context)
|
(provide 'mu4e-context)
|
||||||
;;; mu4e-context.el ends here
|
;;; mu4e-context.el ends here
|
||||||
|
|
Loading…
Reference in New Issue