summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze2020-05-12 23:28:29 -0400
committerJakob L. Kreuze2020-05-12 23:28:29 -0400
commit72f2877c0da6286c4030556f9d14f5d7119fe445 (patch)
tree55e2ea7ecffe6f9e7815961d32438fff45e789cc
parent4e8f3f73316296248a5c556c2a6e1a3ae1400444 (diff)
modeline: Remove unicode characters in `exwm-title'.
For characters not covered by Terminus, Emacs will default to a font with a different glyph size, making the modeline undreadable.
-rw-r--r--init.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.el b/init.el
index 59eee42..cff580e 100644
--- a/init.el
+++ b/init.el
@@ -678,11 +678,15 @@ RIGHT aligned respectively."
(escape-mode-line-construct (concat " " left padding right))
(concat " " left right))))
+(defun remove-unicode (s)
+ "Remove non-ASCII or non-printable ASCII characters from `S'."
+ (apply #'string (seq-filter #'(lambda (c) (and (>= c ? ) (<= c ?~))) s)))
+
(setq-default mode-line-format
'((:eval
(mode-line-render
(cond ((eq major-mode 'exwm-mode)
- (concat "%b: " exwm-title))
+ (concat "%b: " (remove-unicode exwm-title)))
((eq major-mode 'pdf-view-mode)
(concat "%b ["
(number-to-string (pdf-view-current-page))

© 2015 - 2026 Jakob L. Kreuze