[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 676b57d819 081/195: Made subseparator color
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 676b57d819 081/195: Made subseparator colors customizeable |
Date: |
Wed, 5 Jan 2022 02:59:28 -0500 (EST) |
branch: elpa/telephone-line
commit 676b57d819ece27270920eea04ae08c20ea3ef01
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Made subseparator colors customizeable
---
telephone-line.el | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/telephone-line.el b/telephone-line.el
index f129792a08..64337e3a74 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -101,6 +101,18 @@ to a function which takes ACTIVE as a parameter."
:group 'telephone-line
:type '(alist :key-type color-symbol :value-type pair-or-function))
+(defcustom telephone-line-subseparator-faces
+ '((evil . nil)
+ (accent . nil)
+ (nil . accent))
+ "Alist pairing segment color-syms to subseparator color-syms.
+
+If any sym is paired to itself, the subseparator will use the
+foreground color for that segment. Otherwise, it will use the
+background color from the paired sym."
+ :group 'telephone-line
+ :type '(alist :key-type color-symbol :value-type color-symbol))
+
(defcustom telephone-line-primary-left-separator 'telephone-line-abs-left
"The primary separator to use on the left-hand side."
:group 'telephone-line
@@ -161,11 +173,13 @@ Secondary separators do not incur a background color
change."
(active (car pair-or-func))
(t (cdr pair-or-func)))))
-(defun telephone-line-opposite-face-sym (sym)
- "Return the 'opposite' of the given SYM."
- (alist-get sym '((evil . nil)
- (accent . nil)
- (nil . accent))))
+(defun telephone-line-subseparator-foreground (sym)
+ "Get the foreground color for a subseparator on a given SYM."
+ (let ((subseparator-sym (alist-get sym telephone-line-subseparator-faces)))
+ (if (equal sym subseparator-sym)
+ (face-attribute (telephone-line-face-map sym) :foreground)
+ (face-attribute (telephone-line-face-map subseparator-sym)
:background))))
+
(defun telephone-line-evil-face (active)
"Return an appropriate face for the current evil mode, given whether the
frame is ACTIVE."
@@ -206,9 +220,8 @@ Secondary separators do not incur a background color
change."
;;TODO: Clean this up
(defun telephone-line-add-subseparators (subsegments sep-func color-sym)
(let* ((cur-face (telephone-line-face-map color-sym))
- (opposite-face (telephone-line-face-map
- (telephone-line-opposite-face-sym color-sym)))
- (subseparator (telephone-line-separator-render sep-func cur-face
opposite-face)))
+ (subseparator-foreground (telephone-line-subseparator-foreground
color-sym))
+ (subseparator (telephone-line-separator-render sep-func cur-face
subseparator-foreground)))
(telephone-line-propertize-segment
color-sym cur-face
(cdr (seq-mapcat
- [nongnu] elpa/telephone-line b6dcd27331 025/195: Add install instructions, (continued)
- [nongnu] elpa/telephone-line b6dcd27331 025/195: Add install instructions, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 502285b6bc 077/195: Add support for xah-fly-keys, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 315054ffb4 068/195: Minor fixes, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 48f2894e95 046/195: Add initial support for multiple frames, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1f2389212b 024/195: Remove -enable and -disable entirely, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line de93becc18 039/195: Merge pull request #12 from bjpbakker/fix/erc-segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5ccd246d25 049/195: Documentation update, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line ae636f7ca2 041/195: Version bump, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 8bc83573c3 061/195: Fix unicode separators, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1b52832b44 054/195: Nameless indentation, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 676b57d819 081/195: Made subseparator colors customizeable,
ELPA Syncer <=
- [nongnu] elpa/telephone-line 00600d46c9 042/195: Merge branch 'master' of github.com:dbordak/telephone-line, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 3bb5cee841 074/195: Update readme.org, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line f5a1d0cbd2 057/195: Move over to new OO separators, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line cac54930a1 115/195: Improve even heights., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 105defac6e 100/195: Remove telephone-line-trim, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 0fec3265a0 118/195: Fix terminology before it's too late., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line bf0e4394ec 104/195: Previous fix didn't account for hollow separators, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 2906d39401 116/195: Oops, don't want accidental rounding., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 909c1779e4 089/195: Fixed rainbow face examples, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line aa2c6840c9 107/195: Add separator gallery, ELPA Syncer, 2022/01/05