branch: elpa/telephone-line
commit 324da1bbb699969d58026a6ad4bd0eaf259c0bae
Author: Daniel Bordak <[email protected]>
Commit: Daniel Bordak <[email protected]>
Add ryo-modal support
---
telephone-line-segments.el | 8 ++++++++
telephone-line.el | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/telephone-line-segments.el b/telephone-line-segments.el
index 656e85312e..211a39d713 100644
--- a/telephone-line-segments.el
+++ b/telephone-line-segments.el
@@ -113,6 +113,14 @@ mouse-3: Toggle minor modes"
(seq-take tag 1)
tag))))
+(eval-after-load 'ryo-modal
+ '(telephone-line-defsegment* telephone-line-ryo-modal-segment
+ (let ((tag (if ryo-modal-mode
+ "RYO" "EMACS")))
+ (if telephone-line-evil-use-short-tag
+ (seq-take tag 1)
+ tag))))
+
(eval-after-load 'workgroups2
'(telephone-line-defsegment telephone-line-workgroups2-segment
(wg-mode-line-string)))
diff --git a/telephone-line.el b/telephone-line.el
index c6153ba549..3823183c58 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -93,6 +93,7 @@
(defcustom telephone-line-faces
'((evil . telephone-line-modal-face)
(modal . telephone-line-modal-face)
+ (ryo . telephone-line-ryo-modal-face)
(accent . (telephone-line-accent-active . telephone-line-accent-inactive))
(nil . (mode-line . mode-line-inactive)))
"Alist providing all the available face symbols.
@@ -182,6 +183,12 @@ Secondary separators do not incur a background color
change."
(face-attribute (telephone-line-face-map sym) :foreground)
(face-attribute (telephone-line-face-map subseparator-sym)
:background))))
+(defun telephone-line-ryo-modal-face (active)
+ "Return an appropriate face depending whether ryo-modal is activated, given
whether frame is ACTIVE."
+ (cond ((not active) 'mode-line-inactive)
+ ((not (boundp 'ryo-modal-mode)) 'mode-line)
+ ((not ryo-modal-mode) 'telephone-line-evil-insert)
+ (t 'telephone-line-evil-normal)))
(defun telephone-line-modal-face (active)
"Return an appropriate face for the current mode, given whether the frame is
ACTIVE."