From 2f9f5f37f5ccdd20cacdc99429945af7403e0055 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Fri, 30 Dec 2022 12:03:10 -0500 Subject: [PATCH] Add option to disable major mode segment --- mood-line.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mood-line.el b/mood-line.el index bce0ee8..0c5ff47 100644 --- a/mood-line.el +++ b/mood-line.el @@ -198,6 +198,11 @@ :group 'mood-line :type 'boolean) +(defcustom mood-line-show-major-mode t + "When non-nil, show the name of the major mode of the current buffer." + :group 'mood-line + :type 'boolean) + (defcustom mood-line-glyph-alist mood-line-glyphs-ascii "Alist mapping glyph names to characters used to draw some mode line segments. @@ -812,10 +817,11 @@ Checkers checked, in order: `flycheck', `flymake'." ;; ---------------------------------- ;; (defun mood-line-segment-major-mode () - "Display the name of the current major mode." - (concat (propertize (substring-no-properties (format-mode-line mode-name)) - 'face 'mood-line-major-mode) - " ")) + "Display the name of the major mode of the current buffer." + (when mood-line-show-major-mode + (concat (propertize (substring-no-properties (format-mode-line mode-name)) + 'face 'mood-line-major-mode) + " "))) ;; ---------------------------------- ;; ;; Misc. info segment