From 37d97586e5ab723158857ed1a46bb741bc557cfd Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 15 Apr 2024 14:50:58 +0800 Subject: modeline: `modeline-right-offset` * modeline.el (modeline-right-offset): Add a variable to control the right padding in the mode line. (modeline-format-main, modeline-format-dashboard): Use the above variable to leave a small space at the right-hand side. --- modeline.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modeline.el') diff --git a/modeline.el b/modeline.el index 49c5f38..ee2c0fd 100644 --- a/modeline.el +++ b/modeline.el @@ -24,6 +24,9 @@ ;;; Code: +(defvar modeline-right-offset 6 + "An offset to adjust the modeline alignment.") + ;;;###autoload (defun modeline-format-main () "The main mode line format." @@ -38,7 +41,8 @@ 'space :width (list - (- (window-pixel-width) left-len right-len)))))) + (- (window-pixel-width) left-len right-len + (- modeline-right-offset))))))) (concat left middle right))) (setq-default mode-line-format '("%e" (:eval (modeline-format-main)))) @@ -57,7 +61,8 @@ 'space :width (list - (- (window-pixel-width) left-len right-len)))))) + (- (window-pixel-width) left-len right-len + (- modeline-right-offset))))))) (concat left middle right))) ;;;###autoload -- cgit v1.2.3-18-g5258