[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 86fb58f 64/99: Move compat--alist-get-full-elisp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 86fb58f 64/99: Move compat--alist-get-full-elisp to emacs-25.1 |
Date: |
Sun, 17 Oct 2021 05:57:58 -0400 (EDT) |
branch: externals/compat
commit 86fb58fd0a4f295c2284821350b8b391bae0aad5
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Move compat--alist-get-full-elisp to emacs-25.1
---
compat-25.1.el | 20 ++++++++++++++++++++
compat-26.1.el | 14 --------------
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/compat-25.1.el b/compat-25.1.el
index 350f917..5a4183e 100644
--- a/compat-25.1.el
+++ b/compat-25.1.el
@@ -90,6 +90,26 @@ MODES is as for `set-default-file-modes'."
,@body)
(set-default-file-modes ,umask)))))
+(compat-defun alist-get (key alist &optional default remove testfn)
+ "Find the first element of ALIST whose `car' equals KEY and return its `cdr'.
+If KEY is not found in ALIST, return DEFAULT.
+Equality with KEY is tested by TESTFN, defaulting to `eq'."
+ :max-version "24.5"
+ :realname compat--alist-get-full-elisp
+ (ignore remove)
+ (let (entry)
+ (cond
+ ((or (null testfn) (eq testfn 'eq))
+ (setq entry (assq key alist)))
+ ((eq testfn 'equal)
+ (setq entry (assoc key alist)))
+ ((catch 'found
+ (dolist (ent alist)
+ (when (and (consp ent) (funcall testfn (car ent) key))
+ (throw 'found (setq entry ent))))
+ default)))
+ (if entry (cdr entry) default)))
+
;;;; Defined in subr-x.el
(compat-defmacro if-let* (varlist then &rest else)
diff --git a/compat-26.1.el b/compat-26.1.el
index 99adce64..9415652 100644
--- a/compat-26.1.el
+++ b/compat-26.1.el
@@ -89,20 +89,6 @@ from the absolute start of the buffer, disregarding the
narrowing."
default)
(funcall oldfun key alist default remove testfn)))
-(compat-defun alist-get (key alist &optional default remove testfn)
- "Find the first element of ALIST whose `car' equals KEY and return its `cdr'.
-If KEY is not found in ALIST, return DEFAULT.
-Equality with KEY is tested by TESTFN, defaulting to `eq'."
- :max-version "24.5"
- :realname compat--alist-get-full-elisp
- (ignore remove)
- (unless testfn (setq testfn #'eq))
- (catch 'found
- (dolist (ent alist)
- (when (and (consp ent) (funcall testfn (car ent) key))
- (throw 'found (cdr ent))))
- default))
-
(compat-defun string-trim-left (string &optional regexp)
"Trim STRING of leading string matching REGEXP.
- [elpa] externals/compat 36ef438 35/99: Implement and use mounted-file-systems, (continued)
- [elpa] externals/compat 36ef438 35/99: Implement and use mounted-file-systems, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e5a573f 37/99: Declare mouse-set-point, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 2089c90 41/99: Declare gensym for with-existing-directory, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 2faab78 42/99: Add debug specification for setq-local, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 5e7698c 45/99: Avoid testing advice compatibility in version to old to compare, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 343bcbb 46/99: Fix if-let implementation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 32031ea 50/99: Remove unnecessary compat-- prefix from gensym-counter, ELPA Syncer, 2021/10/17
- [elpa] externals/compat f8f4a9f 52/99: Use right function in some compat-maxargs-/= invocations, ELPA Syncer, 2021/10/17
- [elpa] externals/compat fa09ea0 54/99: Factor out multibyte regexp tests for string-search and -replace, ELPA Syncer, 2021/10/17
- [elpa] externals/compat aa112d8 63/99: Implement lookup-key handling of keymap lists, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 86fb58f 64/99: Move compat--alist-get-full-elisp to emacs-25.1,
ELPA Syncer <=
- [elpa] externals/compat 954c97b 67/99: Update compat-tests header, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 5cd751b 68/99: Mention GitHub issue tracker in README, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 598a040 69/99: Add :cond check to lookup-key, ELPA Syncer, 2021/10/17
- [elpa] externals/compat b16122b 71/99: Use explicit symbol names instead of alii, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a7d9649 72/99: Manually advise functions when nadvice is not available, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 904d660 74/99: Add documentation to manual advice wrapper, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e689153 76/99: Merge compile and run into one GitHub Action job, ELPA Syncer, 2021/10/17
- [elpa] externals/compat c37e1d1 80/99: Fix quoting in compat-macs' legacy advice installation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 18c2bf9 83/99: Autoload advised functions is necessary, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 50767a8 90/99: Load deferred code even if file doesn't exist, ELPA Syncer, 2021/10/17