comparison lisp/cus-edit.el @ 90103:3ebd9bdb4fe5

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-13 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-83 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-89 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-90 Update from CVS: man/calc.texi: Add macro for LaTeX for info output. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-91 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-94 Update from CVS
author Miles Bader <miles@gnu.org>
date Sun, 13 Feb 2005 07:19:08 +0000
parents fa9654493afb 2832745c4aee
children 7e3f621f1dd4
comparison
equal deleted inserted replaced
90102:9b4f359c4117 90103:3ebd9bdb4fe5
31 ;; See `custom.el'. 31 ;; See `custom.el'.
32 32
33 ;; No commands should have names starting with `custom-' because 33 ;; No commands should have names starting with `custom-' because
34 ;; that interferes with completion. Use `customize-' for commands 34 ;; that interferes with completion. Use `customize-' for commands
35 ;; that the user will run with M-x, and `Custom-' for interactive commands. 35 ;; that the user will run with M-x, and `Custom-' for interactive commands.
36
37 ;; The identity of a customize option is represented by a Lisp symbol.
38 ;; There is the following values associated with an option.
39
40 ;; 0. The current value.
41
42 ;; This is the value of the option as seen by "the rest of Emacs".
43
44 ;; Usually extracted by 'default-value', but can be extracted with
45 ;; different means if the option symbol has the 'custom-get'
46 ;; property. Similarly, set-default (or the 'custom-set' property)
47 ;; can set it.
48
49 ;; 1. The widget value.
50
51 ;; This is the value shown in the widget in a customize buffer.
52
53 ;; 2. The customized value.
54
55 ;; This is the last value given to the option through customize.
56
57 ;; It is stored in the 'customized-value' property of the option, in a
58 ;; cons-cell whose car evaluate to the customized value.
59
60 ;; 3. The saved value.
61
62 ;; This is last value saved from customize.
63
64 ;; It is stored in the 'saved-value' property of the option, in a
65 ;; cons-cell whose car evaluate to the saved value.
66
67 ;; 4. The standard value.
68
69 ;; This is the value given in the 'defcustom' declaration.
70
71 ;; It is stored in the 'standard-value' property of the option, in a
72 ;; cons-cell whose car evaluate to the standard value.
73
74 ;; 5. The "think" value.
75
76 ;; This is what customize think the current value should be.
77
78 ;; This is the customize value, if any such value exists, otherwise
79 ;; the saved value, if that exists, and as a last resort the standard
80 ;; value.
81
82 ;; The reason for storing values unevaluated: This is so you can have
83 ;; values that depend on the environment. For example, you can have a
84 ;; valiable that has one value when Emacs is running under a window
85 ;; system, and another value on a tty. Since the evaluation is only done
86 ;; when the variable is firsty initialized, this is only relevant for the
87 ;; saved (and standard) values, but affect others values for
88 ;; compatibility.
89
90 ;; You can see (and modify and save) this unevaluated value by selecting
91 ;; "Show initial Lisp expression" from the Lisp interface. This will
92 ;; give you the unevaluated saved value, if any, otherwise the
93 ;; unevaluated standard value.
94
95 ;; The possible states for a customize widget are:
96
97 ;; 0. unknown
98
99 ;; The state has not been determined yet.
100
101 ;; 1. modified
102
103 ;; The widget value is different from the current value.
104
105 ;; 2. changed
106
107 ;; The current value is different from the "think" value.
108
109 ;; 3. set
110
111 ;; The "think" value is the customized value.
112
113 ;; 4. saved
114
115 ;; The "think" value is the saved value.
116
117 ;; 5. standard
118
119 ;; The "think" value is the standard value.
120
121 ;; 6. rogue
122
123 ;; There are no standard value.
124
125 ;; 7. hidden
126
127 ;; There is no widget value.
128
129 ;; 8. mismatch
130
131 ;; The widget value is not valid member of the :type specified for the
132 ;; option.
36 133
37 ;;; Code: 134 ;;; Code:
38 135
39 (require 'cus-face) 136 (require 'cus-face)
40 (require 'wid-edit) 137 (require 'wid-edit)
1181 :group 'custom-buffer) 1278 :group 'custom-buffer)
1182 1279
1183 (defcustom custom-buffer-done-kill nil 1280 (defcustom custom-buffer-done-kill nil
1184 "*Non-nil means exiting a Custom buffer should kill it." 1281 "*Non-nil means exiting a Custom buffer should kill it."
1185 :type 'boolean 1282 :type 'boolean
1186 :version "21.4" 1283 :version "22.1"
1187 :group 'custom-buffer) 1284 :group 'custom-buffer)
1188 1285
1189 (defcustom custom-buffer-indent 3 1286 (defcustom custom-buffer-indent 3
1190 "Number of spaces to indent nested groups." 1287 "Number of spaces to indent nested groups."
1191 :type 'integer 1288 :type 'integer
1297 (Custom-set))) 1394 (Custom-set)))
1298 (widget-insert " ") 1395 (widget-insert " ")
1299 (widget-create 'push-button 1396 (widget-create 'push-button
1300 :tag "Save for Future Sessions" 1397 :tag "Save for Future Sessions"
1301 :help-echo "\ 1398 :help-echo "\
1302 Make your editing in this buffer take effect for future Emacs sessions." 1399 Make your editing in this buffer take effect for future Emacs sessions.
1400 This updates your Emacs initialization file or creates a new one one."
1303 :action (lambda (widget &optional event) 1401 :action (lambda (widget &optional event)
1304 (Custom-save))) 1402 (Custom-save)))
1305 (if custom-reset-button-menu 1403 (if custom-reset-button-menu
1306 (progn 1404 (progn
1307 (widget-insert " ") 1405 (widget-insert " ")