emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/telephone-line 502285b6bc 077/195: Add support for xah-fly


From: ELPA Syncer
Subject: [nongnu] elpa/telephone-line 502285b6bc 077/195: Add support for xah-fly-keys
Date: Wed, 5 Jan 2022 02:59:28 -0500 (EST)

branch: elpa/telephone-line
commit 502285b6bc20b1c5929048794b092c3c8e8090b0
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>

    Add support for xah-fly-keys
---
 telephone-line-segments.el | 8 ++++++++
 telephone-line.el          | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/telephone-line-segments.el b/telephone-line-segments.el
index 501929b9cc..b75967c7dd 100644
--- a/telephone-line-segments.el
+++ b/telephone-line-segments.el
@@ -96,6 +96,14 @@ mouse-3: Toggle minor modes"
            (seq-take tag 2)
          tag))))
 
+(eval-after-load 'xah-fly-keys
+  '(telephone-line-defsegment* telephone-line-xah-fly-keys-segment
+     (let ((tag (if xah-fly-insert-state-q
+                    "INSERT" "COMMAND")))
+       (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 58db17922d..5456e54bfd 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -161,6 +161,10 @@ Secondary separators do not incur a background color 
change."
 (defun telephone-line-evil-face (active)
   "Return an appropriate face for the current evil mode, given whether the 
frame is ACTIVE."
   (cond ((not active) 'mode-line-inactive)
+        ((and (boundp 'xah-fly-keys) xah-fly-keys)
+         (if xah-fly-insert-state-q
+             'telephone-line-evil-insert
+           'telephone-line-evil-normal))
         ((not (boundp 'evil-state)) 'mode-line)
         (t (intern (concat "telephone-line-evil-" (symbol-name evil-state))))))
 
@@ -223,7 +227,7 @@ separators, as they are conditional, are evaluated 
on-the-fly."
         '(nil . nil))))
 
 (defun telephone-line-width (values num-separators separator)
-  "Get the column-length of VALUES, with NUM-SEPARATORS interposed."
+  "Get the column-length of VALUES, with NUM-SEPARATORS SEPARATORs interposed."
   (let ((base-width (string-width (format-mode-line values)))
         (separator-width (/ (telephone-line-separator-width separator)
                             (float (frame-char-width)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]