diff options
author | Case Duckworth | 2021-09-14 17:47:46 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-14 17:47:46 -0500 |
commit | f3c9b7c3d98b3227cef3aa9a51b8853f21ad2462 (patch) | |
tree | 29a82df76cc881b8b2bdec1127bcced149c6c585 /lisp/acdw-modeline.el | |
parent | Add default edit server mode (diff) | |
parent | ~mehehheheh (diff) | |
download | emacs-f3c9b7c3d98b3227cef3aa9a51b8853f21ad2462.tar.gz emacs-f3c9b7c3d98b3227cef3aa9a51b8853f21ad2462.zip |
Merge branch 'main' of https://tildegit.org/acdw/emacs
Diffstat (limited to 'lisp/acdw-modeline.el')
-rw-r--r-- | lisp/acdw-modeline.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 5aa0a18..6e5afb8 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el | |||
@@ -33,12 +33,16 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." | |||
33 | 33 | ||
34 | (defun acdw-modeline/buffer-name () ; gonsie | 34 | (defun acdw-modeline/buffer-name () ; gonsie |
35 | "Display the buffer name in a face reflecting its modified status." | 35 | "Display the buffer name in a face reflecting its modified status." |
36 | (propertize " %b " | 36 | (propertize (concat " " |
37 | (truncate-string (/ (window-total-width) 2) | ||
38 | (buffer-name) "~") | ||
39 | " ") | ||
37 | 'face | 40 | 'face |
38 | (if (buffer-modified-p) | 41 | (if (buffer-modified-p) |
39 | 'font-lock-warning-face | 42 | 'font-lock-warning-face |
40 | 'font-lock-type-face) | 43 | 'font-lock-type-face) |
41 | 'help-echo (buffer-file-name))) | 44 | 'help-echo (or (buffer-file-name) |
45 | (buffer-name)))) | ||
42 | 46 | ||
43 | (defun acdw-modeline/erc () | 47 | (defun acdw-modeline/erc () |
44 | "ERC indicator for the modeline." | 48 | "ERC indicator for the modeline." |
@@ -151,6 +155,10 @@ is, if point < mark." | |||
151 | (region-bounds)))) | 155 | (region-bounds)))) |
152 | 'font-lock-face 'font-lock-variable-name-face)))) | 156 | 'font-lock-face 'font-lock-variable-name-face)))) |
153 | 157 | ||
158 | (defun acdw-modeline/reading-mode () | ||
159 | "Display an indicator if currently in reading mode, mine or EWW's." | ||
160 | (concat (if reading-mode "R" "") (if eww-readable-p "w" ""))) | ||
161 | |||
154 | (defun acdw-modeline/text-scale () | 162 | (defun acdw-modeline/text-scale () |
155 | "Display the text scaling from the modeline, if scaled." | 163 | "Display the text scaling from the modeline, if scaled." |
156 | ;; adapted from https://github.com/seagle0128/doom-modeline | 164 | ;; adapted from https://github.com/seagle0128/doom-modeline |