diff options
author | Case Duckworth | 2021-09-29 17:21:01 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-29 17:21:01 -0500 |
commit | 17b01d3eb51f21e0e77ca699da1dee3ea7482c3f (patch) | |
tree | 7763e1df6ea6f9fc9ce667544a1f698ecb2ec792 | |
parent | Move stuff to executable setup form (diff) | |
download | emacs-17b01d3eb51f21e0e77ca699da1dee3ea7482c3f.tar.gz emacs-17b01d3eb51f21e0e77ca699da1dee3ea7482c3f.zip |
Also show percentage of file in the modeline
-rw-r--r-- | init.el | 3 | ||||
-rw-r--r-- | lisp/acdw-modeline.el | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/init.el b/init.el index 04b50aa..c3cbb68 100644 --- a/init.el +++ b/init.el | |||
@@ -1081,7 +1081,8 @@ specific to most general, they are these: | |||
1081 | word-wrap t | 1081 | word-wrap t |
1082 | wrap-prefix (repeat-string acdw-irc/left-margin " ") | 1082 | wrap-prefix (repeat-string acdw-irc/left-margin " ") |
1083 | line-number-mode nil | 1083 | line-number-mode nil |
1084 | column-number-mode nil) | 1084 | column-number-mode nil |
1085 | file-percentage-mode nil) | ||
1085 | 1086 | ||
1086 | (:hook #'enable-lui-track))) | 1087 | (:hook #'enable-lui-track))) |
1087 | 1088 | ||
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 25502ec..9963309 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el | |||
@@ -125,6 +125,10 @@ indicator in the mode-line." | |||
125 | 'mouse-2 #'mode-line-widen)) | 125 | 'mouse-2 #'mode-line-widen)) |
126 | 'mouse-face 'mode-line-highlight)))) | 126 | 'mouse-face 'mode-line-highlight)))) |
127 | 127 | ||
128 | (define-minor-mode file-percentage-mode | ||
129 | "Toggle the percentage display in the mode line (File Percentage Mode)." | ||
130 | :init-value t :global t :group 'mode-line) | ||
131 | |||
128 | (defun acdw-modeline/position () | 132 | (defun acdw-modeline/position () |
129 | "Displays the current cursor position in the mode-line. | 133 | "Displays the current cursor position in the mode-line. |
130 | 134 | ||
@@ -140,7 +144,10 @@ is, if point < mark." | |||
140 | ((column-number-mode | 144 | ((column-number-mode |
141 | (column-number-indicator-zero-based | 145 | (column-number-indicator-zero-based |
142 | (5 " C%c") | 146 | (5 " C%c") |
143 | (5 " C%C"))))) | 147 | (5 " C%C"))) |
148 | " ")) | ||
149 | (file-percentage-mode | ||
150 | (7 "%p%% ")) | ||
144 | ,(if (region-active-p) | 151 | ,(if (region-active-p) |
145 | (propertize (format "%s%-5d" | 152 | (propertize (format "%s%-5d" |
146 | (if (and (mark) | 153 | (if (and (mark) |
@@ -183,7 +190,7 @@ is, if point < mark." | |||
183 | (defun acdw-modeline/wc () | 190 | (defun acdw-modeline/wc () |
184 | "Display current `wc-buffer-stats'." | 191 | "Display current `wc-buffer-stats'." |
185 | (when (bound-and-true-p wc-mode) | 192 | (when (bound-and-true-p wc-mode) |
186 | (or wc-buffer-stats "[w]"))) | 193 | (or wc-buffer-stats " [w]"))) |
187 | 194 | ||
188 | (defun acdw-modeline/winum () | 195 | (defun acdw-modeline/winum () |
189 | "Show the `winum' number of the current window in the modeline. | 196 | "Show the `winum' number of the current window in the modeline. |