aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/proof-compat.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/proof-compat.el b/generic/proof-compat.el
index f3c5753b..b9b6b1a7 100644
--- a/generic/proof-compat.el
+++ b/generic/proof-compat.el
@@ -348,6 +348,7 @@ The returned value is one of the following symbols:
;; Emulate a useful builtin from XEmacs.
(or (fboundp 'remassq)
+;; NB: Emacs has assoc package with assq-delete-all function
(defun remassq (key alist)
"Delete any elements of ALIST whose car is `eq' to KEY.
The modified ALIST is returned."
@@ -359,6 +360,18 @@ The modified ALIST is returned."
(setq alist (cdr alist)))
(nreverse newalist))))
+(or (fboundp 'remassoc)
+(defun remassoc (key alist)
+ "Delete any elements of ALIST whose car is `eq' to KEY.
+The modified ALIST is returned."
+;; The builtin version deletes by side-effect, but don't bother here.
+ (let (newalist)
+ (while alist
+ (unless (equal key (caar alist))
+ (setq newalist (cons (car alist) newalist)))
+ (setq alist (cdr alist)))
+ (nreverse newalist))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;