changeset 25140:e4493f0697ae

(assoc-delete-all): New function, renamed from frame-delete-all.
author Dave Love <fx@gnu.org>
date Fri, 30 Jul 1999 18:40:22 +0000
parents fde300f58ed8
children 7581eb34e7ff
files lisp/subr.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Fri Jul 30 18:39:32 1999 +0000
+++ b/lisp/subr.el	Fri Jul 30 18:40:22 1999 +0000
@@ -1252,4 +1252,15 @@
 ;      (setq tail (cdr tail))))
 ;  alist)
 
+(defun assoc-delete-all (key alist)
+  "Delete from ALIST all elements whose car is KEY.
+Return the modified alist."
+  (setq alist (copy-sequence alist))
+  (let ((tail alist))
+    (while tail
+      (if (eq (car (car tail)) key)
+	  (setq alist (delq (car tail) alist)))
+      (setq tail (cdr tail)))
+    alist))
+
 ;;; subr.el ends here