summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2024-04-15 14:50:58 +0800
committerJSDurand <mmemmew@gmail.com>2024-04-15 14:50:58 +0800
commit37d97586e5ab723158857ed1a46bb741bc557cfd (patch)
tree3b00e8c1e91943759b44a460df7f31ee88e637a8
parent9728bb8605265b7f5c32eeb26360543c3bcae72a (diff)
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.
-rw-r--r--modeline.el9
1 files changed, 7 insertions, 2 deletions
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