[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 12c750656c 06/13: Move assoc-delete-all to emacs
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 12c750656c 06/13: Move assoc-delete-all to emacs-27 |
Date: |
Sun, 13 Mar 2022 19:57:32 -0400 (EDT) |
branch: externals/compat
commit 12c750656c9d0fd4b41f6b7dfe17397ee896aefa
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Move assoc-delete-all to emacs-27
---
compat-26.el | 18 ------------------
compat-27.el | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/compat-26.el b/compat-26.el
index a21e8552ed..564ad9c76d 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -320,24 +320,6 @@ PREFIX is a string, and defaults to \"g\"."
(1+ gensym-counter)))))
(make-symbol (format "%s%d" (or prefix "g") num))))
-(compat-defun assoc-delete-all (key alist &optional test)
- "Delete from ALIST all elements whose car is KEY.
-Compare keys with TEST. Defaults to `equal'.
-Return the modified alist.
-Elements of ALIST that are not conses are ignored."
- :version "26.2"
- (unless test (setq test #'equal))
- (while (and (consp (car alist))
- (funcall test (caar alist) key))
- (setq alist (cdr alist)))
- (let ((tail alist) tail-cdr)
- (while (setq tail-cdr (cdr tail))
- (if (and (consp (car tail-cdr))
- (funcall test (caar tail-cdr) key))
- (setcdr tail (cdr tail-cdr))
- (setq tail tail-cdr))))
- alist)
-
;;;; Defined in files.el
(declare-function temporary-file-directory nil)
diff --git a/compat-27.el b/compat-27.el
index 94cf2d4eae..31b6b0eb58 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -350,6 +350,27 @@ return nil."
"Standard regexp guaranteed not to match any string at all."
:constant t)
+(compat-defun assoc-delete-all (key alist &optional test)
+ "Delete from ALIST all elements whose car is KEY.
+Compare keys with TEST. Defaults to `equal'.
+Return the modified alist.
+Elements of ALIST that are not conses are ignored."
+ :prefix t
+ :cond (condition-case nil
+ (or (assoc-delete-all nil nil #'ignore) t)
+ (wrong-number-of-arguments nil))
+ (unless test (setq test #'equal))
+ (while (and (consp (car alist))
+ (funcall test (caar alist) key))
+ (setq alist (cdr alist)))
+ (let ((tail alist) tail-cdr)
+ (while (setq tail-cdr (cdr tail))
+ (if (and (consp (car tail-cdr))
+ (funcall test (caar tail-cdr) key))
+ (setcdr tail (cdr tail-cdr))
+ (setq tail tail-cdr))))
+ alist)
+
;;;; Defined in simple.el
;;* UNTESTED
- [elpa] externals/compat updated (c99569a419 -> 6b21a08666), ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3472e208d7 03/13: Remove duplicate string-search test block, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 7aee4b40ef 02/13: Remove duplicate ert-set-test in compat--expect, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 21c70607aa 01/13: Have minimal definitions expand to a defalias if possible, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 327cb6b6e6 04/13: Allow specifying a condition to test defaliasing prefix functions, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 12c750656c 06/13: Move assoc-delete-all to emacs-27,
ELPA Syncer <=
- [elpa] externals/compat abb32f1b9d 05/13: Add :cond to assoc definition, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 317b88abdc 08/13: Fix args-out-of-range signal upper-bound edge case, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3a6990e954 09/13: Rename named-let name in tests to avoid byte compiler warnings, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3b88489c8c 07/13: Exclude "MANUAL" from ELPA package, ELPA Syncer, 2022/03/13
- [elpa] externals/compat e5f4a546ae 10/13: Fix duplicate test name issues, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3fa2a7477f 11/13: Avoid failing ":cond"-check if assoc-delete-all is not defined, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 6b21a08666 13/13: Update assoc-delete-all with prefix, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 9e6b342095 12/13: Update MANUAL entry on assoc-delete-all, ELPA Syncer, 2022/03/13