[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 23195b81b4 112/195: Add support for subsegm
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 23195b81b4 112/195: Add support for subsegment modifiers; add :active modifier |
Date: |
Wed, 5 Jan 2022 02:59:33 -0500 (EST) |
branch: elpa/telephone-line
commit 23195b81b49c8c3577617a1b525168d78c70fa22
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Add support for subsegment modifiers; add :active modifier
---
telephone-line.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/telephone-line.el b/telephone-line.el
index 3823183c58..43777ca6ce 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -240,6 +240,20 @@ Secondary separators do not incur a background color
change."
(mapcar (lambda (f) (funcall f cur-face))
subsegments))))))
+(defun telephone-line-preprocess-subsegments (subsegments)
+ "Normalize SUBSEGMENTS to create a strict list of functions."
+ (mapcar (lambda (subsegment)
+ (if (functionp subsegment)
+ subsegment
+ (seq-let (segment-func &rest modifiers) subsegment
+ (if (seq-contains modifiers ':active)
+ `(lambda (face)
+ (if (telephone-line-selected-window-active)
+ (,segment-func face)
+ nil))
+ segment-func))))
+ subsegments))
+
;;TODO: Clean this up
(defun telephone-line-add-separators (segments primary-sep secondary-sep)
"Interpolates SEGMENTS with PRIMARY-SEP and SECONDARY-SEP.
@@ -253,7 +267,9 @@ separators, as they are conditional, are evaluated
on-the-fly."
(cons color-sym
`(:eval
(telephone-line-add-subseparators
- ',subsegments ,secondary-sep ',color-sym)))))
+ ',(telephone-line-preprocess-subsegments
subsegments)
+ ,secondary-sep
+ ',color-sym)))))
(seq-reverse segments))
'(nil . nil))))
- [nongnu] elpa/telephone-line 4b4a1fdaa3 080/195: Add face symbol map, (continued)
- [nongnu] elpa/telephone-line 4b4a1fdaa3 080/195: Add face symbol map, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line fa2a272e98 029/195: Fix glaring separator issues, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line bcb747a5c0 023/195: Oops, another cl call, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line d80e1bd857 119/195: Radically redo segment definitions, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line d31a4a3e7f 121/195: Add experimental nyan-segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line abbeb654fb 095/195: Missed these from a while ago, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line a83dcda21b 096/195: Autoload the premade config, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9822d32b2b 084/195: Update screenshots more, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line f1f017607f 094/195: Fill now uses first right-hand segment for color, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 2162bdf9a3 098/195: Fix issue with airline position, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 23195b81b4 112/195: Add support for subsegment modifiers; add :active modifier,
ELPA Syncer <=
- [nongnu] elpa/telephone-line 40cd97a791 097/195: Bump version number, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line d594052b42 091/195: Add easy evil setup, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5500d470b1 126/195: Update readme with mention of flat separator. Also forgot nil renderer., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9e3502e7b5 085/195: Change default config to use airline position, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 68746c0d63 125/195: Rename telephone-line-nil to telephone-line-flat; include true nil separator., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 14d2abdbe0 139/195: Merge branch 'master' into master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 220a1a4a89 141/195: Update defaults + unify config, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 92a5cc6bb9 136/195: Added segments for window number and projectile., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1c154b7fd0 154/195: Inherit error face in telephone-line-error face., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line a9d89b876d 157/195: Fix for symlinks, ELPA Syncer, 2022/01/05