mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Add setq! macro
A convenient alternative to setq where you don't have to care about load order (no need for after! blocks).
This commit is contained in:
@ -164,6 +164,13 @@ at the values with which this function was called."
|
|||||||
(when-let (path (file!))
|
(when-let (path (file!))
|
||||||
(directory-file-name (file-name-directory path))))
|
(directory-file-name (file-name-directory path))))
|
||||||
|
|
||||||
|
(defmacro setq! (&rest settings)
|
||||||
|
"A stripped-down `customize-set-variable' with the syntax of `setq'."
|
||||||
|
(macroexp-progn
|
||||||
|
(cl-loop for (var val) on settings by 'cddr
|
||||||
|
collect `(funcall (or (get ',var 'custom-set) #'set)
|
||||||
|
',var ,val))))
|
||||||
|
|
||||||
(defmacro pushnew! (place &rest values)
|
(defmacro pushnew! (place &rest values)
|
||||||
"Push VALUES sequentially into PLACE, if they aren't already present.
|
"Push VALUES sequentially into PLACE, if they aren't already present.
|
||||||
This is a variadic `cl-pushnew'."
|
This is a variadic `cl-pushnew'."
|
||||||
|
Reference in New Issue
Block a user