all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: abraham@dina.kvl.dk
Subject: widget-choice-action
Date: Tue, 2 Aug 2005 08:49:26 -0500 (CDT)	[thread overview]
Message-ID: <200508021349.j72DnQ208932@raven.dms.auburn.edu> (raw)

Is there a reason for the "as long as the value is the same" in the
following comment in widget-choice-action?

      ;; If this was an explicit user choice,
      ;; record the choice, and the record the value it was made for.
      ;; widget-choice-value-create will respect this choice,
      ;; as long as the value is the same.

In other words, is there a reason not to make the changes to
`widget-choice-action and `widget-choice-value-create' in the patch
below?  Why should the user's explicit choice _not_ be respected if
the value changes?  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).  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.

===File ~/wid-edit-diff=====================================
*** wid-edit.el	21 Jul 2005 06:54:49 -0500	1.143
--- wid-edit.el	01 Aug 2005 23:00:23 -0500	
***************
*** 1955,1964 ****
  	(args (widget-get widget :args))
  	(explicit (widget-get widget :explicit-choice))
  	current)
!     (if (and explicit (equal value (widget-get widget :explicit-choice-value)))
  	(progn
  	  ;; If the user specified the choice for this value,
! 	  ;; respect that choice as long as the value is the same.
  	  (widget-put widget :children (list (widget-create-child-value
  					      widget explicit value)))
  	  (widget-put widget :choice explicit))
--- 1955,1964 ----
  	(args (widget-get widget :args))
  	(explicit (widget-get widget :explicit-choice))
  	current)
!     (if explicit
  	(progn
  	  ;; If the user specified the choice for this value,
! 	  ;; respect that choice.
  	  (widget-put widget :children (list (widget-create-child-value
  					      widget explicit value)))
  	  (widget-put widget :choice explicit))
***************
*** 2047,2059 ****
  		 (setq this-explicit t)
  		 (widget-choose tag (reverse choices) event))))
      (when current
!       ;; If this was an explicit user choice,
!       ;; record the choice, and the record the value it was made for.
!       ;; widget-choice-value-create will respect this choice,
!       ;; as long as the value is the same.
        (when this-explicit
! 	(widget-put widget :explicit-choice current)
! 	(widget-put widget :explicit-choice-value (widget-get widget :value)))
        (widget-value-set widget (widget-default-get current))
        (widget-setup)
        (widget-apply widget :notify widget event)))
--- 2047,2056 ----
  		 (setq this-explicit t)
  		 (widget-choose tag (reverse choices) event))))
      (when current
!       ;; If this was an explicit user choice, record the choice,
!       ;; so that widget-choice-value-create will respect it.
        (when this-explicit
! 	(widget-put widget :explicit-choice current))
        (widget-value-set widget (widget-default-get current))
        (widget-setup)
        (widget-apply widget :notify widget event)))
============================================================

             reply	other threads:[~2005-08-02 13:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 13:49 Luc Teirlinck [this message]
2005-08-02 15:31 ` widget-choice-action Per Abrahamsen
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=200508021349.j72DnQ208932@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=abraham@dina.kvl.dk \
    /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.