bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21695: 25.0.50; Change most occurrences of `setq' in Emacs manual to


From: Drew Adams
Subject: bug#21695: 25.0.50; Change most occurrences of `setq' in Emacs manual to `customize-set-variable'
Date: Fri, 16 Oct 2015 14:50:04 -0700 (PDT)

Please (case by case) change examples that use `setq' to set an option
value, so that they instead use one of the Customize functions
(`customize-set-variable', `custom-set-variables', etc.).

Using `setq' in an init file to set option values is error prone.  It is
not a good habit to develop, because (1) there are some options whose
`defcustom's use `:set', `:initialize' etc. (and `setq' ignores such),
and (2) `setq' does no type checking.

There are currently no occurrences of `customize-set-variable' or
`custom-set-variables' in the Emacs manual.  There are lots of uses of
`setq' in the Emacs manual.  Yet many (most?) of them are for setting
user-option values.  No distinction is made between setting options and
other variables (`defvar's).

Sure, many `defcustom's have a simple `:type' and no `:set' or
`:initialize' etc., so in practice it often does not really matter
whether you use `setq' or one of the Customize functions to set the
value.  Still, the manual should set a good example, and it is better to
not get in the habit of assuming that `setq' is sufficient to properly
set a user option.  I've see questions about this from users many times.
(Most often it is a problem with type and not with setter or initializer
functions.)  It is often not obvious (how should it be) to users what is
wrong when they get into trouble by using `setq'.

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2015-10-06
Bzr revision: a4a98a1b2568793ead43e824ecf227768759df12
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





reply via email to

[Prev in Thread] Current Thread [Next in Thread]