From bfd024dd2b2e3a3e180eb541852968d3e18e0d6d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 11 Oct 2021 18:09:13 -0500 Subject: Change up the modeline - Constant width for buffer name - Re-think nyan-mode minimum window width --- init.el | 2 +- lisp/acdw-modeline.el | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 421bf9c..e24e971 100644 --- a/init.el +++ b/init.el @@ -1943,7 +1943,7 @@ browser defined in `browse-url-secondary-browser-function'." :files ("nyan-mode.el" "img"))) (:option nyan-animate-nyancat nil nyan-bar-length 20 - nyan-minimum-window-width fill-column) + nyan-minimum-window-width (+ fill-column (/ nyan-bar-length 2))) (nyan-mode +1) (defun disable-nyan-mode () "Disable `nyan-mode' in current buffer." diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index a9020c5..adfcb44 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -33,9 +33,7 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (defun acdw-modeline/buffer-name () ; gonsie "Display the buffer name in a face reflecting its modified status." - (propertize (concat " " - (truncate-string (/ (window-total-width) 2) - (buffer-name) "~")) + (propertize (concat (format " %-20s" (truncate-string 20 (buffer-name) "~"))) 'face 'bold ;; (if (buffer-modified-p) ;; 'font-lock-warning-face -- cgit 1.4.1-21-gabe81