mu4e: also quote the context label in the modeline

This commit is contained in:
Yuri D'Elia
2016-02-15 22:49:26 +01:00
committed by djcb
parent 08d955e432
commit 6337151918
3 changed files with 8 additions and 2 deletions

View File

@ -45,7 +45,8 @@ describing mu4e's contexts.")
"Propertized string with the current context name, or \"\" if "Propertized string with the current context name, or \"\" if
there is none." there is none."
(if (mu4e-context-current) (if (mu4e-context-current)
(concat "[" (propertize (mu4e-context-name (mu4e-context-current)) (concat "[" (propertize (mu4e~quote-for-modeline
(mu4e-context-name (mu4e-context-current)))
'face 'mu4e-title-face) "]") "")) 'face 'mu4e-title-face) "]") ""))
(defstruct mu4e-context (defstruct mu4e-context

View File

@ -999,7 +999,7 @@ the query history stack."
'(:eval '(:eval
(concat (concat
(propertize (propertize
(replace-regexp-in-string "%" "%%" mu4e~headers-last-query t t) (mu4e~quote-for-modeline mu4e~headers-last-query)
'face 'mu4e-modeline-face) 'face 'mu4e-modeline-face)
" " " "
(mu4e-context-label))))) (mu4e-context-label)))))

View File

@ -1207,5 +1207,10 @@ the view and compose modes."
(add-text-properties p (point-max) '(face mu4e-footer-face))))))) (add-text-properties p (point-max) '(face mu4e-footer-face)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e~quote-for-modeline (str)
"Quote a string to be used literally in the modeline."
(replace-regexp-in-string "%" "%%" str t t))
(provide 'mu4e-utils) (provide 'mu4e-utils)
;;; End of mu4e-utils.el ;;; End of mu4e-utils.el