[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 778d435ad2 109/195: Fix support for Emacs<2
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 778d435ad2 109/195: Fix support for Emacs<25 |
Date: |
Wed, 5 Jan 2022 02:59:32 -0500 (EST) |
branch: elpa/telephone-line
commit 778d435ad2182ad7ffd344721ad7b4c720739a36
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Fix support for Emacs<25
---
telephone-line-utils.el | 8 ++++++++
telephone-line.el | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/telephone-line-utils.el b/telephone-line-utils.el
index 198151b0a2..9becfdb01b 100644
--- a/telephone-line-utils.el
+++ b/telephone-line-utils.el
@@ -41,6 +41,14 @@
:type 'boolean
:group 'telephone-line-evil)
+(if (fboundp #'alist-get)
+ (defalias 'telephone-line-alist-get #'alist-get)
+ (defun telephone-line-alist-get (key alist &optional default remove)
+ "Backport of alist-get for Emacs<25"
+ (ignore remove)
+ (let ((x (assq key alist)))
+ (if x (cdr x) default))))
+
(defun telephone-line-create-axis (length)
"Create an axis of length LENGTH.
For odd lengths, this is a sequence from -floor(LENGTH/2) to
diff --git a/telephone-line.el b/telephone-line.el
index f3c2139edd..0e33443673 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -169,14 +169,14 @@ Secondary separators do not incur a background color
change."
(defun telephone-line--face-map (sym active)
"Return the face corresponding to SYM for the given ACTIVE state."
- (let ((pair-or-func (alist-get sym telephone-line-faces)))
+ (let ((pair-or-func (telephone-line-alist-get sym telephone-line-faces)))
(cond ((functionp pair-or-func) (funcall pair-or-func active))
(active (car pair-or-func))
(t (cdr pair-or-func)))))
(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)))
+ (let ((subseparator-sym (telephone-line-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))))
- [nongnu] elpa/telephone-line ba6a56e027 018/195: Minor mode, (continued)
- [nongnu] elpa/telephone-line ba6a56e027 018/195: Minor mode, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 41edbc236a 053/195: Not sure why I memoized this in the first place?, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 7a6ac904b3 059/195: Further consolidate old stuff into new stuff, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 426a598c4a 056/195: Start work on memoize replacement, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line c73b2c210d 027/195: Fix face definitions, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5c0af25f19 073/195: Explain config ordering, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 74cd7ea3ee 082/195: Fix telephone-line-nil, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line b2439795a4 078/195: Improve default colors., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 07858899cc 052/195: Readme update, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line bfd9c8b431 067/195: New string trimmer fixes appearance of paradox line number segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 778d435ad2 109/195: Fix support for Emacs<25,
ELPA Syncer <=
- [nongnu] elpa/telephone-line 36a6583157 156/195: Add a bunch of docstrings to segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 0d23081c68 148/195: Add a couple faces for segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 8372f7d37c 133/195: Add centered segment support, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 2fd44a2811 144/195: Add hud segment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line e0eeb057ca 160/195: Actually check if the projectile stuff will work, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 305b5dbfec 163/195: Added minions-mode-segment, compatible with https://github.com/tarsius/minions., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 74068cd04a 167/195: Added segments "plain" buffer name and modified-state-only. (#93), ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 17901f3911 170/195: Merge pull request #96 from MikeTheGreat/filename_segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 81ec9e3137 171/195: Respect 0/1-indexing setting, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 706cedb353 174/195: Merge pull request #109 from endoffile78/circe, ELPA Syncer, 2022/01/05