aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2005-08-07 01:07:33 +0000
committerLuc Teirlinck2005-08-07 01:07:33 +0000
commit25e3656c19c56dafbe51690ff47920a9f3e9c368 (patch)
treeb36f900c1ca7f32fdfd7af62e0186f8fcd5ef27d
parentff2b1744feefe3f1284f400ecab4740e43081bc8 (diff)
downloademacs-25e3656c19c56dafbe51690ff47920a9f3e9c368.tar.gz
emacs-25e3656c19c56dafbe51690ff47920a9f3e9c368.zip
(widget-choice-value-create): Unconditionally respect user choice.
Set :explicit-choice back to nil when no longer needed. (widget-choice-action): Unconditionally respect user choice. Eliminate :explicit-choice-value.
-rw-r--r--lisp/wid-edit.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 1198eff55ba..9c391ab1176 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1956,13 +1956,14 @@ the earlier input."
1956 (args (widget-get widget :args)) 1956 (args (widget-get widget :args))
1957 (explicit (widget-get widget :explicit-choice)) 1957 (explicit (widget-get widget :explicit-choice))
1958 current) 1958 current)
1959 (if (and explicit (equal value (widget-get widget :explicit-choice-value))) 1959 (if explicit
1960 (progn 1960 (progn
1961 ;; If the user specified the choice for this value, 1961 ;; If the user specified the choice for this value,
1962 ;; respect that choice as long as the value is the same. 1962 ;; respect that choice.
1963 (widget-put widget :children (list (widget-create-child-value 1963 (widget-put widget :children (list (widget-create-child-value
1964 widget explicit value))) 1964 widget explicit value)))
1965 (widget-put widget :choice explicit)) 1965 (widget-put widget :choice explicit)
1966 (widget-put widget :explicit-choice nil))
1966 (while args 1967 (while args
1967 (setq current (car args) 1968 (setq current (car args)
1968 args (cdr args)) 1969 args (cdr args))
@@ -2048,13 +2049,10 @@ when he invoked the menu."
2048 (setq this-explicit t) 2049 (setq this-explicit t)
2049 (widget-choose tag (reverse choices) event)))) 2050 (widget-choose tag (reverse choices) event))))
2050 (when current 2051 (when current
2051 ;; If this was an explicit user choice, 2052 ;; If this was an explicit user choice, record the choice,
2052 ;; record the choice, and the record the value it was made for. 2053 ;; so that widget-choice-value-create will respect it.
2053 ;; widget-choice-value-create will respect this choice,
2054 ;; as long as the value is the same.
2055 (when this-explicit 2054 (when this-explicit
2056 (widget-put widget :explicit-choice current) 2055 (widget-put widget :explicit-choice current))
2057 (widget-put widget :explicit-choice-value (widget-get widget :value)))
2058 (widget-value-set widget (widget-default-get current)) 2056 (widget-value-set widget (widget-default-get current))
2059 (widget-setup) 2057 (widget-setup)
2060 (widget-apply widget :notify widget event))) 2058 (widget-apply widget :notify widget event)))