diff --git a/core/core-lib.el b/core/core-lib.el index 9f3e6df41..2b08cafaa 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -230,13 +230,19 @@ This is a variadic `push'." `(setq ,sym (nconc ,sym ,@lists))) (defmacro delq! (elt list &optional fetcher) - "Delete ELT from LIST in-place." + "`delq' ELT from LIST in-place. + +If FETCHER is a function, ELT is used as the key in LIST (an alist)." `(setq ,list (delq ,(if fetcher `(funcall ,fetcher ,elt ,list) elt) ,list))) +(defmacro delete! (elt list) + "Delete ELT from LIST in-place." + `(setq ,list (delete ,elt ,list))) + (defmacro add-transient-hook! (hook-or-function &rest forms) "Attaches a self-removing function to HOOK-OR-FUNCTION.