unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: customize-set-(value|variable) [was: apropos commands for commands, user options, all functions, all variables]
Date: Tue, 6 Nov 2007 14:46:10 -0800	[thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACCEJCCEAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1IlmB1-0000Ev-73@fencepost.gnu.org>

>     Since `set-variable' was also intended to change the values of user
>     options with the leading * in their docstrings, I think a new command
>     `set-option' should be added with the body of current `set-variable',
>     and `set-variable' should allow modifying any variable.
>
> I don't consider that a good reason for such a change.
> If I see some additional experienced users who want this as a convenience,
> then I will agree to the change.

Those quotes provide some context, but this is really about
`customize-set-value' and `customize-set-variable'. Here are some proposals
for discussion:

1. Rename `customize-set-value' to `set-option', and
`customize-set-variable' to `set-option-default' (or add aliases). Users
will find these names easier. These commands provide much better interaction
for reading the new value than does the current `set-variable'. Their
interaction subsumes that of `set-variable', which uses only property
`variable-interactive'.

2. Rewrite `set-variable' to set any variable, not just an option, and when
the variable is an option then have the code do what `customize-set-value'
does. That is, provide better value input interaction, when possible.

3. `customize-set-(value|variable)' needs some improvement. Here are some
things I notice:

a. `choice' for a list of `const' is good - it provides completion, which is
very handy - a great improvement over what is available in Customize, IMO.
However, there is no indication in the prompt that completion is (sometimes)
available. And when completion is available, the default value should be the
current value of the option, for possible editing. Currently, there is no
default value.

b. `choice' that includes a non-`const' choice, in addition to `const'
choices: the types of the non-`const' choices apparently govern what
happens:

- If the non-`const' choice types don't provide for completion, then no
completion is available for the `choice' at all. It would be better to have
non-strict completion and allow for the value that doesn't match any `const'
to be read according to its type. If possible.

- And, if the non-`const' choices also provide for completion, then it
should be possible to combine them with the `const' values into a general
completion. E.g. a `choice' of a `function' or (const :tag "None" nil)
currently completes only against function names - neither "None" nor nil are
allowed as completion candidates. Why not just add "None" to the list of
candidates?

c. `repeat' seems to read a sexp and evaluate to obtain the complete list -
the complete value. This is a cop-out and is not very useful. It would be
better to repeatedly read values corresponding to the list elements, and
then combine them to get the overall value. For example `repeat' of `sexp'
should repeatedly read a sexp (until, say, empty RET) and return the list of
sexprs that were read. And I don't see why the command should `eval' at all
for `repeat' - why wouldn't it just read, like it does for the other types?
And the user has no feedback as to what is expected to be input (beyond
"[repeat]" in the prompt) - nothing tells him to input a sexp that will be
evalled to produce the overall list value. (And end users should not need to
think in such terms, anyway.)

c. (choice (const :tag "None" nil) regexp) reads a regexp string, but the
default is "", not nil, which doesn't seem right. And if you type `nil' or
`None', then the literal string "nil" or "None" is interpreted as a regexp.
Again, it would be better to allow lax completion with sole candidate "None"
and allow a regexp string value as well.

d. For type `color', lax completion should be available, choosing from color
names but also allowing input of a #RRRGGBBB hex string.

#3 is the most important of these suggestions. I don't have time to work on
this much myself, but I can contribute a little time if someone else leads
on this. What's really needed is someone knowledgeable in custom and widgets
(ugh!).

I hope that people will not argue that users should not use
`customize-set-value' and `customize-set-variable', that they should
preferably use Customize. I think both have their advantages, and these
commands should be improved to make them viable alternatives. I also think
that Customize itself could be improved to allow for completion where
appropriate.

WDOT?

  reply	other threads:[~2007-11-06 22:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 19:08 apropos commands for commands, user options, all functions, all variables Drew Adams
2007-10-19 20:24 ` Andreas Röhler
2007-10-19 20:42   ` Drew Adams
2007-10-21  6:40 ` Stephen J. Turnbull
2007-10-21  7:26 ` Richard Stallman
2007-10-21 20:41   ` Juri Linkov
2007-10-22  0:55     ` Stefan Monnier
2007-10-23  0:35       ` Juri Linkov
2007-10-23  7:11         ` Drew Adams
2007-10-26  3:48           ` Richard Stallman
2007-10-26 22:43             ` Juri Linkov
2007-10-27 13:58               ` Richard Stallman
2007-11-06 22:46                 ` Drew Adams [this message]
2007-11-11 21:11                   ` customize-set-(value|variable) [was: apropos commands for commands, user options, all functions, all variables] Drew Adams
2007-11-11 21:34                     ` Lennart Borgman (gmail)
2007-11-12  0:43                       ` Drew Adams
2007-11-12  0:58                         ` Lennart Borgman (gmail)
2007-11-12  5:59                   ` Richard Stallman
2007-11-12 12:33                     ` Robert J. Chassell
2007-11-12 15:30                       ` customize-set-(value|variable) [was: apropos commands forcommands, " Drew Adams
2007-11-12 17:10                         ` Robert J. Chassell
2007-11-12 19:23                           ` customize-set-(value|variable) [was: apropos commandsforcommands, " Drew Adams
2007-11-12 20:32                             ` Robert J. Chassell
2007-10-23  7:12     ` apropos commands for commands, user options, all functions, all variables Richard Stallman
2007-10-25 20:59       ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BNELLINCGFJLDJIKDGACCEJCCEAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).