Add delete! convenience macro
And polish delq!'s docstring.
This commit is contained in:
parent
0169f8e3f6
commit
856a2afe43
1 changed files with 7 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue