From b92c644ad859e16bb29396345fac1fbe22424b78 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Mar 2022 21:16:10 +0100 Subject: [PATCH] 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... --- core/core-lib.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index d04f887d7..d5d62530d 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -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)