From: Per Abrahamsen <abraham@dina.kvl.dk>
Cc: emacs-devel@gnu.org
Subject: Re: widget-choice-action
Date: Tue, 02 Aug 2005 17:31:51 +0200 [thread overview]
Message-ID: <rjmzo0icd4.fsf@sheridan.dina.kvl.dk> (raw)
In-Reply-To: 200508021349.j72DnQ208932@raven.dms.auburn.edu
It was RMS who wrote code, but since I'm CC'ed, I'll contribute with
my recollection of it (which may be entirely wrong).
Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> This seems very counterintuitive and I had to struggle
> with this in the new indicate-buffer-boundaries defcustom, although I
> finally found an acceptable workaround (but that was a coincidence and
> I would rather not have used the workaround, although it is not too
> bad).
What did you first try to do, what did you end up with?
> If the user selects a choice from a value menu, he expects to
> get that choice, regardless of whether the default :value of that
> choice is identical with the previous value or not.
The "previous value" is not used. It compares the value of the choice
the user selected, with the *new* value of the widget, which are
supposed to be the same.
I can imagine some cases where they are different, and for those cases
there are no guarantee that the new value of the widget will actually
fit the type of the explicit chosen widget. So these should be
ignored. I.e., please don't apply your patch.
...
I'm in general very suspicious of any customize type that need the
:explicit-choice functionality in order to work.
A choice widget will normally select the first choice that match the
value. :explicit-choice overrides that, so an later choice can be
selected even if a prior choice matches. However, if you save the
option and enter customize again, the first match will be used, thus
the choice you see will not be the one you saved.
Thus :explicit-choice often just hides a problem in a custom type long
enough for the developer not to discover it, but not long enough for
the user to avoid being bitten by it.
The real solution is that when you have overlapping types in a choice
widget, the most specific *must* be listed first. This
(choice string sexp); OK
and not
(choice sexp string); BAD: "string" will never be selected
; implicit, as any string is also a sexp
next prev parent reply other threads:[~2005-08-02 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-02 13:49 widget-choice-action Luc Teirlinck
2005-08-02 15:31 ` Per Abrahamsen [this message]
2005-08-02 16:25 ` widget-choice-action Luc Teirlinck
2005-08-02 20:20 ` widget-choice-action Luc Teirlinck
2005-08-02 21:44 ` widget-choice-action Luc Teirlinck
2005-08-03 10:50 ` widget-choice-action Per Abrahamsen
2005-08-03 14:59 ` widget-choice-action Luc Teirlinck
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=rjmzo0icd4.fsf@sheridan.dina.kvl.dk \
--to=abraham@dina.kvl.dk \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.