emacs-devel
[Top][All Lists]
Advanced

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

Re: Defaults for set-variable


From: Juri Linkov
Subject: Re: Defaults for set-variable
Date: Sat, 05 Nov 2005 11:44:19 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> Customized variables make only sense where we are talking about a
> state that is intended to be preserved across sessions.  For example,
> buffer-local variables would not make sense to put into customize.

I completely agree with the Emacs Lisp manual where it says that
programmers should nearly always use `defcustom' instead of `defvar'
to define user options.  Perhaps Customize should support cases
you mentioned (buffer-local user options) with using a special
tag in `defcustom', for the sake of marking such variable as
user options (instead of the clumsy * in the documentation string),
and possibly also providing a special user interface for changing them.

In regard to `set-variable', the Emacs manual contains in the node
(info "(emacs)Examining"):

  `C-h v VAR <RET>'
       Display the value and documentation of variable VAR
       (`describe-variable').

  `M-x set-variable <RET> VAR <RET> VALUE <RET>'
       Change the value of variable VAR to VALUE.

This clearly indicates that these commands are complementary:
`describe-variable' displays the value of any variable, and
`set-variable' changes its value.  It unambiguously says that
it changes a variable, not an user option.

The current implementation contradicts the command name `set-variable'
and its documentation.

I see only one way to avoid this inconsistency - to have two commands:
`set-variable' for setting variables, and `set-user-option' for setting
user options.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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