[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50248: [DOC] Setting User Options in Init File
From: |
Kevin Vigouroux |
Subject: |
bug#50248: [DOC] Setting User Options in Init File |
Date: |
Sun, 29 Aug 2021 08:16:56 +0200 |
This is related to the closed bug #21695.
The Emacs manual does not mention that some user options must be set
using an appropriate setter function, as explained in the Emacs Lisp
Reference Manual.
#+begin_quote
15.3 Defining Customization Variables (Elisp Ref. Man.)
=====================================
‘:set SETFUNCTION’
Specify SETFUNCTION as the way to change the value of this option
when using the Customize interface. The function SETFUNCTION
should take two arguments, a symbol (the option name) and the new
value, and should do whatever is necessary to update the value
properly for this option (which may not mean simply setting the
option as a Lisp variable); preferably, though, it should not
modify its value argument destructively. The default for
SETFUNCTION is ‘set-default’.
If you specify this keyword, the variable’s documentation string
should describe how to do the same job in hand-written Lisp code.
#+end_quote
Informative text should be added to the following sections: 49.4.1 and
49.4.2.
#+begin_quote
49.4.1 Init File Syntax (Emacs manual)
-----------------------
You can set any Lisp variable with ‘setq’, but with certain variables
‘setq’ won’t do what you probably want in the init file. Some variables
automatically become buffer-local when set with ‘setq’; what you want in
the init file is to set the default value, using ‘setq-default’. Some
customizable minor mode variables do special things to enable the mode
when you set them with Customize, but ordinary ‘setq’ won’t do that; to
enable the mode in your init file, call the minor mode command. The
following section has examples of both of these methods.
#+end_quote
@Drew: Your answer on emacs.stackexchange.com is misleading [1].
[1]
https://emacs.stackexchange.com/questions/17386/display-all-setq-possibilities/17389#17389
- bug#50248: [DOC] Setting User Options in Init File,
Kevin Vigouroux <=