; Improve documentation of 'setopt'
* doc/lispref/variables.texi (Setting Variables): Note about the differences between 'setopt' and 'customize-set-variable'.
This commit is contained in:
parent
6f88de109c
commit
3941cc29df
1 changed files with 10 additions and 3 deletions
|
@ -857,9 +857,10 @@ error is signaled.
|
||||||
|
|
||||||
@defmac setopt [symbol form]@dots{}
|
@defmac setopt [symbol form]@dots{}
|
||||||
This is like @code{setq} (see above), but meant for user options.
|
This is like @code{setq} (see above), but meant for user options.
|
||||||
This macro uses the Customize machinery to set the variable(s). In
|
This macro uses the Customize machinery to set the variable(s)
|
||||||
particular, @code{setopt} will run the setter function associated with
|
(@pxref{Variable Definitions}). In particular, @code{setopt} will run
|
||||||
the variable. For instance, if you have:
|
the setter function associated with the variable. For instance, if
|
||||||
|
you have:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
|
@ -884,6 +885,12 @@ will also issue a message:
|
||||||
option. For instance, using @code{setopt} to set a user option
|
option. For instance, using @code{setopt} to set a user option
|
||||||
defined with a @code{number} type to a string will signal an error.
|
defined with a @code{number} type to a string will signal an error.
|
||||||
|
|
||||||
|
Unlike @code{defcustom} and related customization commands, such as
|
||||||
|
@code{customize-variable}, @code{setopt} is meant for non-interactive
|
||||||
|
use, in particular in the user init file. For that reason, it doesn't
|
||||||
|
record the standard, saved, and user-set values, and doesn't mark the
|
||||||
|
variable as candidate for saving in the custom file.
|
||||||
|
|
||||||
The @code{setopt} macro can be used on regular, non-user option
|
The @code{setopt} macro can be used on regular, non-user option
|
||||||
variables, but is much less efficient than @code{setq}. The main use
|
variables, but is much less efficient than @code{setq}. The main use
|
||||||
case for this macro is setting user options in the user's init file.
|
case for this macro is setting user options in the user's init file.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue