Added emacsclient indicator

Closes feature request from #25
This commit is contained in:
Trevor Richards 2022-12-31 16:11:30 -08:00
parent 25c7846b8f
commit 21e4addc9b
No known key found for this signature in database
GPG Key ID: 8546CF84A13DD5EF

View File

@ -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