diff --git a/mu4e/mu4e-context.el b/mu4e/mu4e-context.el index a61f7ef6..f5f8fff9 100644 --- a/mu4e/mu4e-context.el +++ b/mu4e/mu4e-context.el @@ -45,7 +45,8 @@ describing mu4e's contexts.") "Propertized string with the current context name, or \"\" if there is none." (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) "]") "")) (defstruct mu4e-context diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 352154f9..2446b4f8 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -999,7 +999,7 @@ the query history stack." '(:eval (concat (propertize - (replace-regexp-in-string "%" "%%" mu4e~headers-last-query t t) + (mu4e~quote-for-modeline mu4e~headers-last-query) 'face 'mu4e-modeline-face) " " (mu4e-context-label))))) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index f86cb948..e3c482a9 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -1207,5 +1207,10 @@ the view and compose modes." (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) ;;; End of mu4e-utils.el