summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2024-07-31 16:39:00 +0800
committerJSDurand <mmemmew@gmail.com>2024-07-31 16:39:00 +0800
commit003c0cf29a8e8f5edb9c30964b3c76b3acdbf6f6 (patch)
treee06b343303c838b1e428b7000a61af5b9594cf38
parenteac0b7a1dae4d3af314321bba5eed33e9a408bcb (diff)
modeline: Add a simplified format for GNUS.
* modeline.el (modeline-format-gnus, modeline-gnus-format-left): A format for GNUS that does not display some unnecessary information.
-rw-r--r--modeline.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/modeline.el b/modeline.el
index ee2c0fd..3f98d77 100644
--- a/modeline.el
+++ b/modeline.el
@@ -90,6 +90,35 @@
(format-mode-line global-mode-string face)))))
;;;###autoload
+(defun modeline-format-gnus ()
+ "The mode line format for GNUS."
+ (let* ((left (modeline-gnus-format-left))
+ (right (string-trim-right (modeline-format-right)))
+ (left-len (string-pixel-width left))
+ (right-len (string-pixel-width right))
+ (middle (propertize
+ (string 32)
+ 'display
+ (list
+ 'space
+ :width
+ (list
+ (- (window-pixel-width) left-len right-len
+ (- modeline-right-offset)))))))
+ (concat left middle right)))
+
+(defun modeline-gnus-format-left ()
+ "The left part of the mode line for GNUS."
+ (declare (side-effect-free t) (pure t))
+ (concat
+ (modeline-spc)
+ (modeline-format-buffer-name)
+ (modeline-spc)
+ (modeline-format-keycast)
+ (modeline-spc)
+ (modeline-format-minor-modes)))
+
+;;;###autoload
(defun modeline-format-left ()
"The left mode line format."
(concat