[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 3e73a0ed24 135/195: Add :args and :truncate
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 3e73a0ed24 135/195: Add :args and :truncate segment modifiers |
Date: |
Wed, 5 Jan 2022 02:59:40 -0500 (EST) |
branch: elpa/telephone-line
commit 3e73a0ed2457e7b6991ea6555a1379bf9b77053b
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Add :args and :truncate segment modifiers
---
telephone-line.el | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/telephone-line.el b/telephone-line.el
index 33e9b5ed53..6ef2a2dd6f 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -246,18 +246,29 @@ Secondary separators do not incur a background color
change."
(if (functionp subsegment)
(funcall subsegment)
(seq-let (segment-func &rest modifiers) subsegment
- (cond
- ((seq-contains modifiers ':active)
- `(lambda (face)
- (if (telephone-line-selected-window-active)
- (funcall (,segment-func) face)
- nil)))
- ((seq-contains modifiers ':inactive)
- `(lambda (face)
- (if (not (telephone-line-selected-window-active))
- (funcall (,segment-func) face)
- nil)))
- (t segment-func)))))
+ (if (plist-get modifiers ':args)
+ (setq segment-func
+ (apply segment-func (plist-get modifiers ':args)))
+ (setq segment-func
+ (funcall segment-func)))
+ (if (plist-get modifiers ':active)
+ (setq segment-func
+ `(lambda (face)
+ (if (telephone-line-selected-window-active)
+ (,segment-func face)
+ nil))))
+ (if (plist-get modifiers ':inactive)
+ (setq segment-func
+ `(lambda (face)
+ (if (not (telephone-line-selected-window-active))
+ (,segment-func face)
+ nil))))
+ (if (and (plist-get modifiers ':truncate)
+ (< 0 (plist-get modifiers ':truncate)))
+ (setq segment-func
+ `(lambda (face)
+ (seq-take (format-mode-line (,segment-func face))
,(plist-get modifiers ':truncate)))))
+ segment-func)))
subsegments))
;;TODO: Clean this up
- [nongnu] elpa/telephone-line 44ca430fe1 062/195: Corrected types for custom vars, (continued)
- [nongnu] elpa/telephone-line 44ca430fe1 062/195: Corrected types for custom vars, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9c36180ba2 021/195: Enhanced axis documentation and new trig function, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 70c113bea3 063/195: Version Bump, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 797f257642 183/195: Wrap the segment in bound-and-true-p, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1705f029c7 009/195: Better conform to existing standards, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5968746a49 137/195: Added option to show window number in unicode., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 6e4e1e648b 151/195: Use built-in faces in flycheck-segment., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1dc10acfc4 175/195: Apparently this is the only hook that's needed now?, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 356e7b8834 117/195: Update docstring for new axis, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line cdbe1a6be5 140/195: Merge pull request #62 from anandpiyer/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 3e73a0ed24 135/195: Add :args and :truncate segment modifiers,
ELPA Syncer <=
- [nongnu] elpa/telephone-line c17c71ae18 132/195: Add missing methods to telephone-line-unicode-separator, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 4885ebe7ae 130/195: Separate unicode separators out into their own class so they can be intermixed with XPM separators, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9dfaef65b2 020/195: Formatting, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 80b642aee1 099/195: Add simple (no mouse bind) minor/major mode segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 45d97b4021 127/195: Oops, that was markdown format., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9fe198d82c 008/195: Remove autoloads carried over from names, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line d486eb3398 055/195: More indentation fixes, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line dd5a939edd 035/195: Fix error in erc segment when erc is not loaded, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5638edc4fa 032/195: Fix title typo, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line b58e3d1e43 030/195: Probably improve Unicode separators., ELPA Syncer, 2022/01/05