mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
docs(lib): clarify setq!'s docstring
Emacs 29+ introduced the setopt macro for setting defcustom variables in a way that takes setters and type-constraints into account, but it eagerly pulls in a symbol's dependencies before doing so. To side-step this silliness, use Doom's setq! macro instead. I'm tempted to alias setopt to it...
This commit is contained in:
@ -463,11 +463,11 @@ See `general-key-dispatch' for what other arguments it accepts in BRANCHES."
|
||||
`(setq ,sym (append ,sym ,@lists)))
|
||||
|
||||
(defmacro setq! (&rest settings)
|
||||
"A stripped-down `customize-set-variable' with the syntax of `setq'.
|
||||
"A more sensible `setopt' for setting customizable variables.
|
||||
|
||||
This can be used as a drop-in replacement for `setq'. Particularly when you know
|
||||
a variable has a custom setter (a :set property in its `defcustom' declaration).
|
||||
This triggers setters. `setq' does not."
|
||||
This can be used as a drop-in replacement for `setq' and *should* be used
|
||||
instead of `setopt'. Unlike `setq', this triggers custom setters on variables.
|
||||
Unlike `setopt', this won't needlessly pull in dependencies."
|
||||
(macroexp-progn
|
||||
(cl-loop for (var val) on settings by 'cddr
|
||||
collect `(funcall (or (get ',var 'custom-set) #'set)
|
||||
|
Reference in New Issue
Block a user