From 17b01d3eb51f21e0e77ca699da1dee3ea7482c3f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 Sep 2021 17:21:01 -0500 Subject: Also show percentage of file in the modeline --- lisp/acdw-modeline.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp') 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." 'mouse-2 #'mode-line-widen)) 'mouse-face 'mode-line-highlight)))) +(define-minor-mode file-percentage-mode + "Toggle the percentage display in the mode line (File Percentage Mode)." + :init-value t :global t :group 'mode-line) + (defun acdw-modeline/position () "Displays the current cursor position in the mode-line. @@ -140,7 +144,10 @@ is, if point < mark." ((column-number-mode (column-number-indicator-zero-based (5 " C%c") - (5 " C%C"))))) + (5 " C%C"))) + " ")) + (file-percentage-mode + (7 "%p%% ")) ,(if (region-active-p) (propertize (format "%s%-5d" (if (and (mark) @@ -183,7 +190,7 @@ is, if point < mark." (defun acdw-modeline/wc () "Display current `wc-buffer-stats'." (when (bound-and-true-p wc-mode) - (or wc-buffer-stats "[w]"))) + (or wc-buffer-stats " [w]"))) (defun acdw-modeline/winum () "Show the `winum' number of the current window in the modeline. -- cgit 1.4.1-21-gabe81