Mercurial > emacs
comparison lisp/wid-edit.el @ 90224:2d92f5c9d6ae
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-78
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 514-518)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 104-105)
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 26 Aug 2005 09:51:52 +0000 |
parents | 187d6a1f84f7 a0da2f13ae20 |
children | ee12d75eb214 |
comparison
equal
deleted
inserted
replaced
90223:edf295560b5a | 90224:2d92f5c9d6ae |
---|---|
1 ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*- | 1 ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*- |
2 ;; | 2 ;; |
3 ;; Copyright (C) 1996,97,1999,2000,01,02,2003, 2004, 2005 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, |
4 ;; 2004, 2005 Free Software Foundation, Inc. | |
4 ;; | 5 ;; |
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | 6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> |
6 ;; Maintainer: FSF | 7 ;; Maintainer: FSF |
7 ;; Keywords: extensions | 8 ;; Keywords: extensions |
8 | 9 |
1953 "Insert the first choice that matches the value." | 1954 "Insert the first choice that matches the value." |
1954 (let ((value (widget-get widget :value)) | 1955 (let ((value (widget-get widget :value)) |
1955 (args (widget-get widget :args)) | 1956 (args (widget-get widget :args)) |
1956 (explicit (widget-get widget :explicit-choice)) | 1957 (explicit (widget-get widget :explicit-choice)) |
1957 current) | 1958 current) |
1958 (if (and explicit (equal value (widget-get widget :explicit-choice-value))) | 1959 (if explicit |
1959 (progn | 1960 (progn |
1960 ;; If the user specified the choice for this value, | 1961 ;; If the user specified the choice for this value, |
1961 ;; respect that choice as long as the value is the same. | 1962 ;; respect that choice. |
1962 (widget-put widget :children (list (widget-create-child-value | 1963 (widget-put widget :children (list (widget-create-child-value |
1963 widget explicit value))) | 1964 widget explicit value))) |
1964 (widget-put widget :choice explicit)) | 1965 (widget-put widget :choice explicit) |
1966 (widget-put widget :explicit-choice nil)) | |
1965 (while args | 1967 (while args |
1966 (setq current (car args) | 1968 (setq current (car args) |
1967 args (cdr args)) | 1969 args (cdr args)) |
1968 (when (widget-apply current :match value) | 1970 (when (widget-apply current :match value) |
1969 (widget-put widget :children (list (widget-create-child-value | 1971 (widget-put widget :children (list (widget-create-child-value |
2045 current) | 2047 current) |
2046 choices))) | 2048 choices))) |
2047 (setq this-explicit t) | 2049 (setq this-explicit t) |
2048 (widget-choose tag (reverse choices) event)))) | 2050 (widget-choose tag (reverse choices) event)))) |
2049 (when current | 2051 (when current |
2050 ;; If this was an explicit user choice, | 2052 ;; If this was an explicit user choice, record the choice, |
2051 ;; record the choice, and the record the value it was made for. | 2053 ;; so that widget-choice-value-create will respect it. |
2052 ;; widget-choice-value-create will respect this choice, | |
2053 ;; as long as the value is the same. | |
2054 (when this-explicit | 2054 (when this-explicit |
2055 (widget-put widget :explicit-choice current) | 2055 (widget-put widget :explicit-choice current)) |
2056 (widget-put widget :explicit-choice-value (widget-get widget :value))) | |
2057 (widget-value-set widget (widget-default-get current)) | 2056 (widget-value-set widget (widget-default-get current)) |
2058 (widget-setup) | 2057 (widget-setup) |
2059 (widget-apply widget :notify widget event))) | 2058 (widget-apply widget :notify widget event))) |
2060 (run-hook-with-args 'widget-edit-functions widget)) | 2059 (run-hook-with-args 'widget-edit-functions widget)) |
2061 | 2060 |