From 6b355568b075c1cb90c622299c4edba4e65e98dd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 25 Jan 2022 16:55:44 -0600 Subject: Customize jabber --- lisp/+modeline.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lisp/+modeline.el') diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 7683269..4217d13 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el @@ -57,16 +57,22 @@ This function makes a lambda, so you can throw it straight into ;;; Modeline segments +(defun +modeline-sanitize-string (string) + "Sanitize a string for `format-mode-line'." + (when string + (string-replace "%" "%%" string))) + (defun +modeline-buffer-name (&optional spacer) ; gonsie "Display the buffer name." - (concat (or spacer +modeline-default-spacer) - (propertize - (truncate-string-to-width (buffer-name) - (min 24 (/ (window-width) 3)) - nil ?\ t) - 'help-echo (or (buffer-file-name) - (buffer-name)) - 'mouse-face 'mode-line-highlight))) + (let ((bufname (string-replace "%" "" (buffer-name)))) + (concat (or spacer +modeline-default-spacer) + (propertize + (truncate-string-to-width bufname + (min 24 (/ (window-width) 3)) + nil ?\ t) + 'help-echo (or (buffer-file-name) + (buffer-name)) + 'mouse-face 'mode-line-highlight)))) (defcustom +modeline-minions-icon "&" "The \"icon\" for `+modeline-minions' button." -- cgit 1.4.1-21-gabe81