unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* widget-choice-action
@ 2005-08-02 13:49 Luc Teirlinck
  2005-08-02 15:31 ` widget-choice-action Per Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Luc Teirlinck @ 2005-08-02 13:49 UTC (permalink / raw)
  Cc: abraham

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)))
============================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-03 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 13:49 widget-choice-action Luc Teirlinck
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

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).