emacs-devel
[Top][All Lists]
Advanced

[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 14:15:22 -0800

    > 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?

    Er, "M-: (setq '" is _shorter_ than M-x set-variable RET

1. Counting keystrokes (but who's counting?), the two are about the same,
actually:

 M-: (setq SPC 'foo M-TAB SPC value) RET = 12 + foo + value

 vs

 M-x set-va RET foo TAB RET value RET    = 11 + foo + value


2.

    variable-name completion is available via M-TAB

`M-TAB' simply completes any Lisp symbol - it does not offer only variables
as completion candidates. The idea is to have completion against variable
names (only), just as `set-variable' currently offers completion against
user-option names.


3.

    For grabbing the name from the buffer, use `C-M-SPC M-w' ... `C-y'

a) That grabs any word, not just a variable name.
b) If point is in the middle of a name, it grabs only the rest of the name
under point; it does not grab the whole name. You need to start with
`C-M-b'.


4. Making the value local is a separate operation, if you use `M-:'.


Using `(setq foo...)' + `M-TAB' completion + your name-grabbing + a separate
operation for making the value local...takes longer and is more error-prone.

Which do you find more convenient for setting user options - setq or
set-variable? That is, you can use `M-: (setq foo '...)' today for user
options.  Do you, or do you use `M-x set-variable foo ...'?

In any case, there are of course ways to do without such a convenience. The
question is whether or not it is a convenience worth adding to Emacs.





reply via email to

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