[Top][All Lists]

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

RE: Defaults for set-variable

From: Drew Adams
Subject: RE: Defaults for set-variable
Date: Mon, 31 Oct 2005 11:22:59 -0800

    I want to fix a bug in `set-variable' related to its default values.
    It uses `read-variable' to read the name of a user variable
    (a variable for which `user-variable-p' returns non-nil).
    But there is one case where `set-variable' doesn't follow this
    requirement: when a non-user variable name happens to be under point,
    it picks it up from the buffer as a default value, and if the user
    types RET, it accepts a non-user variable as a variable name argument
    of `set-variable'.  The first hunk in the following patch fixes this
    by testing the name of the default variable by `user-variable-p'.

The behavior before the fix was inconsistent, but it was sometimes useful (a
"feature"?). The fix makes sense, but it's too bad to lose a command that
sets a non user-option variable. (One could even use completion to get the
variable name: `C-h v foo TAB RET'; `M-x set-variable RET RET'.)

It's convenient to have a command to do this, as a shortcut for M-: `(setq
...)' - with `C-u' local option and no eval of value.  Any chance of having
a separate command, which works for any variable?

What's a bit unfortunate is that the name `set-variable' is already taken
(it really means `set-user-option').  `set-any-variable'?

reply via email to

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