branch: externals/bufferlo
commit b477fa4e7d06a0a025b816d08b512487f683971b
Author: shipmints <[email protected]>
Commit: shipmints <[email protected]>
Add active session(s) mode line indicator, prefix, face
---
bufferlo.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/bufferlo.el b/bufferlo.el
index 9fa617c598..15153be828 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -581,11 +581,15 @@ suboptimal results for your platform."
:type 'boolean)
(defcustom bufferlo-mode-line-frame-prefix "Ⓕ"
- "Display bufferlo mode-line frame icon."
+ "Display bufferlo mode-line frame prefix."
:type 'string)
(defcustom bufferlo-mode-line-tab-prefix "Ⓣ"
- "Display bufferlo mode-line tab icon."
+ "Display bufferlo mode-line tab prefix."
+ :type 'string)
+
+(defcustom bufferlo-mode-line-session-active-prefix "Ⓢ"
+ "Display bufferlo mode-line frame prefix."
:type 'string)
(defvar bufferlo-mode) ; byte compiler
@@ -613,16 +617,19 @@ string, FACE is the face for STR."
(describe-function 'bufferlo-mode)))
map)))
+(defvar bufferlo--active-sessions) ; byte compiler
(defun bufferlo-mode-line-format ()
"Bufferlo mode-line format to display the current active frame or tab
bookmark."
(when bufferlo-mode
(let* ((fbm (frame-parameter nil 'bufferlo-bookmark-frame-name))
(tbm (alist-get 'bufferlo-bookmark-tab-name
(tab-bar--current-tab-find (frame-parameter nil 'tabs))))
(abm (or fbm tbm ""))
+ (sess-active (> (length bufferlo--active-sessions) 0))
(maybe-space (if (display-graphic-p) "" " "))) ; tty rendering can
be off for Ⓕ Ⓣ
(concat
(bufferlo--mode-line-format-helper abm bufferlo-mode-line-prefix
'bufferlo-mode-line-face)
(when bufferlo-mode-line-brackets (bufferlo--mode-line-format-helper
abm "[" 'bufferlo-mode-line-face))
+ (when sess-active (bufferlo--mode-line-format-helper abm
bufferlo-mode-line-session-active-prefix 'bufferlo-mode-line-session-face))
(when fbm (bufferlo--mode-line-format-helper
abm
(concat bufferlo-mode-line-frame-prefix maybe-space fbm)
'bufferlo-mode-line-frame-bookmark-face))
@@ -653,6 +660,10 @@ string, FACE is the face for STR."
'((t :inherit bufferlo-mode-line-face))
"`bufferlo-mode' mode-line tab bookmark indicator face.")
+(defface bufferlo-mode-line-session-face
+ '((t :inherit bufferlo-mode-line-face))
+ "`bufferlo-mode' mode-line session active indicator face.")
+
(defconst bufferlo--command-line-noload-prefix "--bufferlo-noload")
(defvar bufferlo--command-line-noload nil)