about summary refs log tree commit diff stats
path: root/lisp/+modeline.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+modeline.el')
-rw-r--r--lisp/+modeline.el22
1 files changed, 14 insertions, 8 deletions
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
57 57
58;;; Modeline segments 58;;; Modeline segments
59 59
60(defun +modeline-sanitize-string (string)
61 "Sanitize a string for `format-mode-line'."
62 (when string
63 (string-replace "%" "%%" string)))
64
60(defun +modeline-buffer-name (&optional spacer) ; gonsie 65(defun +modeline-buffer-name (&optional spacer) ; gonsie
61 "Display the buffer name." 66 "Display the buffer name."
62 (concat (or spacer +modeline-default-spacer) 67 (let ((bufname (string-replace "%" "" (buffer-name))))
63 (propertize 68 (concat (or spacer +modeline-default-spacer)
64 (truncate-string-to-width (buffer-name) 69 (propertize
65 (min 24 (/ (window-width) 3)) 70 (truncate-string-to-width bufname
66 nil ?\ t) 71 (min 24 (/ (window-width) 3))
67 'help-echo (or (buffer-file-name) 72 nil ?\ t)
68 (buffer-name)) 73 'help-echo (or (buffer-file-name)
69 'mouse-face 'mode-line-highlight))) 74 (buffer-name))
75 'mouse-face 'mode-line-highlight))))
70 76
71(defcustom +modeline-minions-icon "&" 77(defcustom +modeline-minions-icon "&"
72 "The \"icon\" for `+modeline-minions' button." 78 "The \"icon\" for `+modeline-minions' button."