mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
core-lib: add prependq! and appendq! macros
This commit is contained in:
@ -180,6 +180,14 @@ The order VALUES is preserved."
|
|||||||
`(dolist (--value-- (nreverse (list ,@values)))
|
`(dolist (--value-- (nreverse (list ,@values)))
|
||||||
(cl-pushnew --value-- ,place)))
|
(cl-pushnew --value-- ,place)))
|
||||||
|
|
||||||
|
(defmacro prependq! (sym &rest lists)
|
||||||
|
"Prepend LISTS to SYM in place."
|
||||||
|
`(setq ,sym (append (list ,@lists) ,sym)))
|
||||||
|
|
||||||
|
(defmacro appendq! (sym &rest lists)
|
||||||
|
"Append LISTS to SYM in place."
|
||||||
|
`(setq ,sym (append ,sym ,@lists)))
|
||||||
|
|
||||||
(defmacro delq! (elt list &optional fetcher)
|
(defmacro delq! (elt list &optional fetcher)
|
||||||
"Delete ELT from LIST in-place."
|
"Delete ELT from LIST in-place."
|
||||||
`(setq ,list
|
`(setq ,list
|
||||||
|
Reference in New Issue
Block a user