From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: widget-choice-action Date: Wed, 3 Aug 2005 09:59:03 -0500 (CDT) Message-ID: <200508031459.j73Ex3B10837@raven.dms.auburn.edu> References: <200508021349.j72DnQ208932@raven.dms.auburn.edu> <200508022144.j72LiHA09885@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1123081567 30811 80.91.229.2 (3 Aug 2005 15:06:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2005 15:06:07 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 03 17:06:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E0KnY-0001xs-1r for ged-emacs-devel@m.gmane.org; Wed, 03 Aug 2005 17:04:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E0KqI-00074a-C9 for ged-emacs-devel@m.gmane.org; Wed, 03 Aug 2005 11:07:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E0Kp7-0006la-5E for emacs-devel@gnu.org; Wed, 03 Aug 2005 11:06:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E0Kp0-0006hb-2H for emacs-devel@gnu.org; Wed, 03 Aug 2005 11:06:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E0Koy-0006cA-Je for emacs-devel@gnu.org; Wed, 03 Aug 2005 11:06:16 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E0Kv3-0002dE-69 for emacs-devel@gnu.org; Wed, 03 Aug 2005 11:12:33 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j73ExBqt010401; Wed, 3 Aug 2005 09:59:11 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j73Ex3B10837; Wed, 3 Aug 2005 09:59:03 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: abraham@dina.kvl.dk In-reply-to: (message from Per Abrahamsen on Wed, 03 Aug 2005 12:50:04 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41456 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41456 Per Abrahamsen wrote: However, if this is the only reason for :explicit-choice-value, it seems it would be much cleaner to simply erase the :explicit-choice attribute after use. I believe that it should be erased. It seems very bad to leave a property hanging around forever when it is no longer valid. If I understood correctly, the patch below which erases the :explicit-choice after use, should take care of the problems you mentioned. ===File ~/wid-edit-diff===================================== *** wid-edit.el 21 Jul 2005 06:54:49 -0500 1.143 --- wid-edit.el 03 Aug 2005 07:56:36 -0500 *************** *** 1955,1967 **** (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)) (while args (setq current (car args) args (cdr args)) --- 1955,1968 ---- (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) ! (widget-put widget :explicit-choice nil)) (while args (setq current (car args) args (cdr args)) *************** *** 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))) --- 2048,2057 ---- (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))) ============================================================