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: Fri, 04 Nov 2005 14:07:14 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> From my personal experience, I claim that the frequency with which one
> sets variables by hand which _aren't_ "user variables" is very low --
> and as an Emacs hacker, I probably do so more often than an average
> user.  Thus, given that the proposed function offers at best, a rather
> minor increase in convenience, and will be used very rarely, it simply
> isn't worth the code/namespace bloat; existing more general functions
> as M-: are "convenient enough", and used much more often.

When I need to set a variable value, first I use `M-x set-variable RET'
(for its completion and default values), then if for some reason the
documentation string misses the star, I have to type C-g, and either
to type the variable name after `M-: setq ...' (this is too error-prone),
or to type `C-h v variable' (with completion) and to copy its name
from the *Help* buffer to the `M-: setq ...' minibuffer.  This is
very inconvenient.

> Morever, if there's a particular non-user variable you find yourself
> often setting, that's more likely to be an argument for making that
> variable a user-variable than an argument for making setting
> non-user-variables easier.

The current state of affairs in regard to this is quite confusing.
Neither the Emacs manual nor the Emacs Lisp manual define the term
"user variable", but at the same `user-variable-p' is the function
that is used by `set-variable' to restrict the set of variables
available for this function.  OTOH, the Emacs manual defines the term
"user option" as a variable that the user can customize with the
Customization interface.

So there are only two layers: variables (defined by `defvar') and
user options (defined by `defcustom').  An additional layer of
variables marked with a funny * in the documentation string seems
unnecessary.

With this clear distinction between variables and user options
it makes sense to have two commands:

1. `set-variable' as a convenient replacement of M-: (setq variable ...)
that can set any variable.

2. `set-user-option' as a fast but limited replacement of Customize
for setting user options in the minibuffer.

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





reply via email to

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