From 25c7846b8f31386412884cded43b1f12d0835d17 Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Fri, 30 Dec 2022 21:03:29 -0800 Subject: [PATCH 1/3] Align mode-line-evil-state-alist --- mood-line.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mood-line.el b/mood-line.el index 0c5ff47..236ce04 100644 --- a/mood-line.el +++ b/mood-line.el @@ -247,13 +247,13 @@ found to be missing in `mood-line-glyph-alist'." :value-type (character :tag "Character to use"))) (defcustom mood-line-evil-state-alist - '((normal . ("" . font-lock-variable-name-face)) - (insert . ("" . font-lock-string-face)) - (visual . ("" . font-lock-keyword-face)) - (replace . ("" . font-lock-type-face)) - (motion . ("" . font-lock-constant-face)) + '((normal . ("" . font-lock-variable-name-face)) + (insert . ("" . font-lock-string-face)) + (visual . ("" . font-lock-keyword-face)) + (replace . ("" . font-lock-type-face)) + (motion . ("" . font-lock-constant-face)) (operator . ("" . font-lock-function-name-face)) - (emacs . ("" . font-lock-builtin-face))) + (emacs . ("" . font-lock-builtin-face))) "Set the string and corresponding face for any `evil-mode' state. The `Face' may be either a face symbol or a property list of key-value pairs e.g. (:foreground \"red\")." From 21e4addc9b3cef5cf32d282565990000b1a9c1a4 Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Sat, 31 Dec 2022 16:11:30 -0800 Subject: [PATCH 2/3] Added emacsclient indicator Closes feature request from #25 --- mood-line.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mood-line.el b/mood-line.el index 236ce04..28e712e 100644 --- a/mood-line.el +++ b/mood-line.el @@ -110,6 +110,8 @@ (:buffer-modified . ?*) (:buffer-read-only . ?#) + (:emacsclient . ?c) + (:count-separator . ?*)) "Set of ASCII glyphs for use with mood-line.") @@ -131,6 +133,8 @@ (:buffer-modified . ?●) (:buffer-read-only . ?■) + (:emacsclient . ?▶) + (:count-separator . ?×)) "Set of Fira Code-compatible glyphs for use with mood-line.") @@ -152,6 +156,8 @@ (:buffer-modified . ?●) (:buffer-read-only . ?■) + (:emacsclient . ?↹) + (:count-separator . ?✕)) "Set of Unicode glyphs for use with mood-line.") @@ -237,6 +243,8 @@ glyph. Glyphs used by mood-line include: `:buffer-modified' | File-backed buffer is modified `:buffer-read-only' | File-backed buffer is read-only +`:emacsclient' | Frame is a client for an Emacs daemon + `:count-separator' | Separates some indicator names from numerical counts `mood-line-glyphs-ascii' will be used as a fallback wherever the a glyph may be @@ -451,6 +459,17 @@ Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'." ((featurep 'god-mode) (mood-line-segment-modal-god)))) +;; ---------------------------------- ;; +;; Emacsclient segment function +;; ---------------------------------- ;; + +(defun mood-line-segment-emacsclient () + "Indicate whether or not the frame is an emacsclient." + (if (not (eq (format-mode-line mode-line-client) "")) + (format #("%s " 0 1 (face mood-line-status-info)) + (mood-line--get-glyph :emacsclient)) + "")) + ;; -------------------------------------------------------------------------- ;; ;; ;; Anzu segment @@ -903,6 +922,7 @@ Checkers checked, in order: `flycheck', `flymake'." (:eval (mood-line-segment-buffer-name)) (:eval (mood-line-segment-anzu)) (:eval (mood-line-segment-multiple-cursors)) + (:eval (mood-line-segment-emacsclient)) (:eval (mood-line-segment-cursor-position)))) ;; Right From 6e3f62f57c640724e5e7622ef138f62e33c6d221 Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Sat, 31 Dec 2022 16:19:32 -0800 Subject: [PATCH 3/3] Moved the emacsclient segment to before anzu --- mood-line.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mood-line.el b/mood-line.el index 28e712e..6654604 100644 --- a/mood-line.el +++ b/mood-line.el @@ -920,9 +920,9 @@ Checkers checked, in order: `flycheck', `flymake'." (:eval (mood-line-segment-modal)) (:eval (mood-line-segment-buffer-status)) (:eval (mood-line-segment-buffer-name)) + (:eval (mood-line-segment-emacsclient)) (:eval (mood-line-segment-anzu)) (:eval (mood-line-segment-multiple-cursors)) - (:eval (mood-line-segment-emacsclient)) (:eval (mood-line-segment-cursor-position)))) ;; Right