Mercurial > emacs
annotate lisp/cus-edit.el @ 110815:a9f5356546ca
* lisp/net/browse-url.el (browse-url-xdg-open): Shell-quote url. (Bug#7166)
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 07 Oct 2010 20:23:31 -0700 |
parents | 4d1b1a2c88c6 |
children | 7a9a2861c2c2 |
rev | line source |
---|---|
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37911
diff
changeset
|
1 ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages |
17334 | 2 ;; |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
106815 | 4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
17334 | 5 ;; |
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
7 ;; Maintainer: FSF |
17334 | 8 ;; Keywords: help, faces |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
109908
diff
changeset
|
9 ;; Package: emacs |
17334 | 10 |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
12 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94463
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94463
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94463
diff
changeset
|
16 ;; (at your option) any later version. |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
17 |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
21 ;; GNU General Public License for more details. |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
22 |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94463
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
25 |
17334 | 26 ;;; Commentary: |
27 ;; | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
28 ;; This file implements the code to create and edit customize buffers. |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
29 ;; |
17334 | 30 ;; See `custom.el'. |
31 | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
32 ;; No commands should have names starting with `custom-' because |
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
33 ;; that interferes with completion. Use `customize-' for commands |
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
34 ;; that the user will run with M-x, and `Custom-' for interactive commands. |
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
35 |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
36 ;; The identity of a customize option is represented by a Lisp symbol. |
60214 | 37 ;; The following values are associated with an option. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
38 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
39 ;; 0. The current value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
40 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
41 ;; This is the value of the option as seen by "the rest of Emacs". |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
42 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
43 ;; Usually extracted by 'default-value', but can be extracted with |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
44 ;; different means if the option symbol has the 'custom-get' |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
45 ;; property. Similarly, set-default (or the 'custom-set' property) |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
46 ;; can set it. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
47 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
48 ;; 1. The widget value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
49 |
60214 | 50 ;; This is the value shown in the widget in a customize buffer. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
51 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
52 ;; 2. The customized value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
53 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
54 ;; This is the last value given to the option through customize. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
55 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
56 ;; It is stored in the 'customized-value' property of the option, in a |
60214 | 57 ;; cons-cell whose car evaluates to the customized value. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
58 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
59 ;; 3. The saved value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
60 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
61 ;; This is last value saved from customize. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
62 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
63 ;; It is stored in the 'saved-value' property of the option, in a |
60214 | 64 ;; cons-cell whose car evaluates to the saved value. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
65 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
66 ;; 4. The standard value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
67 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
68 ;; This is the value given in the 'defcustom' declaration. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
69 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
70 ;; It is stored in the 'standard-value' property of the option, in a |
60214 | 71 ;; cons-cell whose car evaluates to the standard value. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
72 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
73 ;; 5. The "think" value. |
60214 | 74 |
75 ;; This is what customize thinks the current value should be. | |
76 | |
77 ;; This is the customized value, if any such value exists, otherwise | |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
78 ;; the saved value, if that exists, and as a last resort the standard |
60214 | 79 ;; value. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
80 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
81 ;; The reason for storing values unevaluated: This is so you can have |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
82 ;; values that depend on the environment. For example, you can have a |
60214 | 83 ;; variable that has one value when Emacs is running under a window |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
84 ;; system, and another value on a tty. Since the evaluation is only done |
60214 | 85 ;; when the variable is first initialized, this is only relevant for the |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
86 ;; saved (and standard) values, but affect others values for |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
87 ;; compatibility. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
88 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
89 ;; You can see (and modify and save) this unevaluated value by selecting |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
90 ;; "Show Saved Lisp Expression" from the Lisp interface. This will |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
91 ;; give you the unevaluated saved value, if any, otherwise the |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
92 ;; unevaluated standard value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
93 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
94 ;; The possible states for a customize widget are: |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
95 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
96 ;; 0. unknown |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
97 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
98 ;; The state has not been determined yet. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
99 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
100 ;; 1. modified |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
101 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
102 ;; The widget value is different from the current value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
103 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
104 ;; 2. changed |
60214 | 105 |
106 ;; The current value is different from the "think" value. | |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
107 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
108 ;; 3. set |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
109 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
110 ;; The "think" value is the customized value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
111 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
112 ;; 4. saved |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
113 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
114 ;; The "think" value is the saved value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
115 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
116 ;; 5. standard |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
117 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
118 ;; The "think" value is the standard value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
119 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
120 ;; 6. rogue |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
121 |
60214 | 122 ;; There is no standard value. This means that the variable was |
67600
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
123 ;; not defined with defcustom, nor handled in cus-start.el. Most |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
124 ;; standard interactive Custom commands do not let you create a |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
125 ;; Custom buffer containing such variables. However, such Custom |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
126 ;; buffers can be created, for instance, by calling |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
127 ;; `customize-apropos' with a prefix arg or by calling |
60296 | 128 ;; `customize-option' non-interactively. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
129 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
130 ;; 7. hidden |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
131 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
132 ;; There is no widget value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
133 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
134 ;; 8. mismatch |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
135 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
136 ;; The widget value is not valid member of the :type specified for the |
60214 | 137 ;; option. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
138 |
17334 | 139 ;;; Code: |
140 | |
141 (require 'cus-face) | |
142 (require 'wid-edit) | |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
143 |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
144 (defvar custom-versions-load-alist) ; from cus-load |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
145 (defvar recentf-exclude) ; from recentf.el |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
146 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
147 (condition-case nil |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
148 (require 'cus-load) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
149 (error nil)) |
17334 | 150 |
18089 | 151 (condition-case nil |
152 (require 'cus-start) | |
153 (error nil)) | |
154 | |
17415 | 155 (put 'custom-define-hook 'custom-type 'hook) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
156 (put 'custom-define-hook 'standard-value '(nil)) |
17415 | 157 (custom-add-to-group 'customize 'custom-define-hook 'custom-variable) |
158 | |
17334 | 159 ;;; Customization Groups. |
160 | |
161 (defgroup emacs nil | |
162 "Customization of the One True Editor." | |
163 :link '(custom-manual "(emacs)Top")) | |
164 | |
165 ;; Most of these groups are stolen from `finder.el', | |
166 (defgroup editing nil | |
167 "Basic text editing facilities." | |
168 :group 'emacs) | |
169 | |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
170 (defgroup convenience nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
171 "Convenience features for faster editing." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
172 :group 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
173 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
174 (defgroup files nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
175 "Support for editing files." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
176 :group 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
177 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
178 (defgroup wp nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
179 "Support for editing text files." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
180 :tag "Text" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
181 :group 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
182 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
183 (defgroup data nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
184 "Support for editing binary data files." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
185 :group 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
186 |
17334 | 187 (defgroup abbrev nil |
188 "Abbreviation handling, typing shortcuts, macros." | |
189 :tag "Abbreviations" | |
107378
904ccd8f2acb
Reorganize Custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107370
diff
changeset
|
190 :group 'convenience) |
17334 | 191 |
192 (defgroup matching nil | |
193 "Various sorts of searching and matching." | |
194 :group 'editing) | |
195 | |
196 (defgroup emulations nil | |
197 "Emulations of other editors." | |
52281 | 198 :link '(custom-manual "(emacs)Emulation") |
17334 | 199 :group 'editing) |
200 | |
201 (defgroup mouse nil | |
202 "Mouse support." | |
203 :group 'editing) | |
204 | |
205 (defgroup outlines nil | |
206 "Support for hierarchical outlining." | |
107378
904ccd8f2acb
Reorganize Custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107370
diff
changeset
|
207 :group 'wp) |
17334 | 208 |
209 (defgroup external nil | |
210 "Interfacing to external utilities." | |
211 :group 'emacs) | |
212 | |
107379
3c0cd76e49ff
Fix last change to use existing comm Custom group instead of `net'.
Chong Yidong <cyd@stupidchicken.com>
parents:
107378
diff
changeset
|
213 (defgroup comm nil |
3c0cd76e49ff
Fix last change to use existing comm Custom group instead of `net'.
Chong Yidong <cyd@stupidchicken.com>
parents:
107378
diff
changeset
|
214 "Communications, networking, and remote access to files." |
3c0cd76e49ff
Fix last change to use existing comm Custom group instead of `net'.
Chong Yidong <cyd@stupidchicken.com>
parents:
107378
diff
changeset
|
215 :tag "Communication" |
107378
904ccd8f2acb
Reorganize Custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107370
diff
changeset
|
216 :group 'emacs) |
904ccd8f2acb
Reorganize Custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107370
diff
changeset
|
217 |
17334 | 218 (defgroup processes nil |
219 "Process, subshell, compilation, and job control support." | |
107378
904ccd8f2acb
Reorganize Custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107370
diff
changeset
|
220 :group 'external) |
17334 | 221 |
222 (defgroup programming nil | |
223 "Support for programming in other languages." | |
224 :group 'emacs) | |
225 | |
226 (defgroup languages nil | |
227 "Specialized modes for editing programming languages." | |
228 :group 'programming) | |
229 | |
230 (defgroup lisp nil | |
231 "Lisp support, including Emacs Lisp." | |
66957
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
232 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
17334 | 233 :group 'languages |
234 :group 'development) | |
235 | |
236 (defgroup c nil | |
237 "Support for the C language and related languages." | |
66957
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
238 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
52281 | 239 :link '(custom-manual "(ccmode)") |
17334 | 240 :group 'languages) |
241 | |
242 (defgroup tools nil | |
243 "Programming tools." | |
244 :group 'programming) | |
245 | |
246 (defgroup applications nil | |
247 "Applications written in Emacs." | |
248 :group 'emacs) | |
249 | |
250 (defgroup calendar nil | |
251 "Calendar and time management support." | |
252 :group 'applications) | |
253 | |
254 (defgroup mail nil | |
255 "Modes for electronic-mail handling." | |
256 :group 'applications) | |
257 | |
258 (defgroup news nil | |
259 "Support for netnews reading and posting." | |
52281 | 260 :link '(custom-manual "(gnus)") |
17334 | 261 :group 'applications) |
262 | |
263 (defgroup games nil | |
264 "Games, jokes and amusements." | |
265 :group 'applications) | |
266 | |
267 (defgroup development nil | |
268 "Support for further development of Emacs." | |
269 :group 'emacs) | |
270 | |
271 (defgroup docs nil | |
272 "Support for Emacs documentation." | |
273 :group 'development) | |
274 | |
275 (defgroup extensions nil | |
276 "Emacs Lisp language extensions." | |
277 :group 'development) | |
278 | |
279 (defgroup internal nil | |
280 "Code for Emacs internals, build process, defaults." | |
281 :group 'development) | |
282 | |
283 (defgroup maint nil | |
284 "Maintenance aids for the Emacs development group." | |
285 :tag "Maintenance" | |
286 :group 'development) | |
287 | |
288 (defgroup environment nil | |
289 "Fitting Emacs with its environment." | |
290 :group 'emacs) | |
291 | |
292 (defgroup hardware nil | |
107167
f6b8c73548b3
Minor tweaks to custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
293 "Support for interfacing with miscellaneous hardware." |
17334 | 294 :group 'environment) |
295 | |
296 (defgroup terminals nil | |
297 "Support for terminal types." | |
298 :group 'environment) | |
299 | |
300 (defgroup unix nil | |
301 "Front-ends/assistants for, or emulators of, UNIX features." | |
302 :group 'environment) | |
303 | |
304 (defgroup i18n nil | |
305 "Internationalization and alternate character-set support." | |
52281 | 306 :link '(custom-manual "(emacs)International") |
17334 | 307 :group 'environment |
308 :group 'editing) | |
309 | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
310 (defgroup x nil |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
311 "The X Window system." |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
312 :group 'environment) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
313 |
17334 | 314 (defgroup frames nil |
315 "Support for Emacs frames and window systems." | |
316 :group 'environment) | |
317 | |
318 (defgroup tex nil | |
319 "Code related to the TeX formatter." | |
66957
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
320 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
17334 | 321 :group 'wp) |
322 | |
323 (defgroup faces nil | |
324 "Support for multiple fonts." | |
325 :group 'emacs) | |
326 | |
327 (defgroup help nil | |
328 "Support for on-line help systems." | |
329 :group 'emacs) | |
330 | |
25685 | 331 (defgroup multimedia nil |
332 "Non-textual support, specifically images and sound." | |
333 :group 'emacs) | |
334 | |
17334 | 335 (defgroup local nil |
336 "Code local to your site." | |
337 :group 'emacs) | |
338 | |
339 (defgroup customize '((widgets custom-group)) | |
340 "Customization of the Customization support." | |
341 :prefix "custom-" | |
17415 | 342 :group 'help) |
343 | |
344 (defgroup custom-faces nil | |
345 "Faces used by customize." | |
346 :group 'customize | |
17334 | 347 :group 'faces) |
348 | |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
349 (defgroup custom-browse nil |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
350 "Control customize browser." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
351 :prefix "custom-" |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
352 :group 'customize) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
353 |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
354 (defgroup custom-buffer nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
355 "Control customize buffers." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
356 :prefix "custom-" |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
357 :group 'customize) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
358 |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
359 (defgroup custom-menu nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
360 "Control customize menus." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
361 :prefix "custom-" |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
362 :group 'customize) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
363 |
17415 | 364 (defgroup alloc nil |
365 "Storage allocation and gc for GNU Emacs Lisp interpreter." | |
366 :tag "Storage Allocation" | |
367 :group 'internal) | |
368 | |
369 (defgroup undo nil | |
370 "Undoing changes in buffers." | |
52281 | 371 :link '(custom-manual "(emacs)Undo") |
17415 | 372 :group 'editing) |
373 | |
72877
bbdd54e72794
(mode-line): Renamed from modeline. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents:
72715
diff
changeset
|
374 (defgroup mode-line nil |
17415 | 375 "Content of the modeline." |
376 :group 'environment) | |
377 | |
378 (defgroup editing-basics nil | |
379 "Most basic editing facilities." | |
380 :group 'editing) | |
381 | |
382 (defgroup display nil | |
383 "How characters are displayed in buffers." | |
384 :group 'environment) | |
385 | |
386 (defgroup execute nil | |
387 "Executing external commands." | |
388 :group 'processes) | |
389 | |
390 (defgroup installation nil | |
391 "The Emacs installation." | |
392 :group 'environment) | |
393 | |
394 (defgroup dired nil | |
395 "Directory editing." | |
396 :group 'environment) | |
397 | |
398 (defgroup limits nil | |
399 "Internal Emacs limits." | |
400 :group 'internal) | |
401 | |
402 (defgroup debug nil | |
403 "Debugging Emacs itself." | |
404 :group 'development) | |
405 | |
406 (defgroup keyboard nil | |
407 "Input from the keyboard." | |
408 :group 'environment) | |
409 | |
410 (defgroup mouse nil | |
411 "Input from the mouse." | |
412 :group 'environment) | |
413 | |
414 (defgroup menu nil | |
415 "Input from the menus." | |
416 :group 'environment) | |
417 | |
61475
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
418 (defgroup dnd nil |
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
419 "Handling data from drag and drop." |
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
420 :group 'environment) |
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
421 |
17415 | 422 (defgroup auto-save nil |
77171
6540b56c4b3d
(minibuffer, auto-save): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
76338
diff
changeset
|
423 "Preventing accidental loss of data." |
18320
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
424 :group 'files) |
17415 | 425 |
426 (defgroup processes-basics nil | |
427 "Basic stuff dealing with processes." | |
428 :group 'processes) | |
429 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
430 (defgroup mule nil |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
431 "MULE Emacs internationalization." |
18053
941f5d1a241e
(cus-start): Require cus-start.
Richard M. Stallman <rms@gnu.org>
parents:
18033
diff
changeset
|
432 :group 'i18n) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
433 |
17415 | 434 (defgroup windows nil |
435 "Windows within a frame." | |
52281 | 436 :link '(custom-manual "(emacs)Windows") |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
437 :group 'environment) |
17415 | 438 |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
439 ;;; Custom mode keymaps |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
440 |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
441 (defvar custom-mode-map |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
442 ;; This keymap should be dense, but a dense keymap would prevent inheriting |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
443 ;; "\r" bindings from the parent map. |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
444 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
445 (let ((map (make-keymap))) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
446 (set-keymap-parent map widget-keymap) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
447 (define-key map [remap self-insert-command] 'Custom-no-edit) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
448 (define-key map "\^m" 'Custom-newline) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
449 (define-key map " " 'scroll-up) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
450 (define-key map "\177" 'scroll-down) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
451 (define-key map "\C-c\C-c" 'Custom-set) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
452 (define-key map "\C-x\C-s" 'Custom-save) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
453 (define-key map "q" 'Custom-buffer-done) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
454 (define-key map "u" 'Custom-goto-parent) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
455 (define-key map "n" 'widget-forward) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
456 (define-key map "p" 'widget-backward) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
457 map) |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
458 "Keymap for `Custom-mode'.") |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
459 |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
460 (defvar custom-mode-link-map |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
461 (let ((map (make-keymap))) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
462 (set-keymap-parent map custom-mode-map) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
463 (define-key map [down-mouse-2] nil) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
464 (define-key map [down-mouse-1] 'mouse-drag-region) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
465 (define-key map [mouse-2] 'widget-move-and-invoke) |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
466 map) |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
467 "Local keymap for links in `Custom-mode'.") |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
468 |
86232
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
469 (defvar custom-field-keymap |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
470 (let ((map (copy-keymap widget-field-keymap))) |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
471 (define-key map "\C-c\C-c" 'Custom-set) |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
472 (define-key map "\C-x\C-s" 'Custom-save) |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
473 map) |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
474 "Keymap used inside editable fields in customization buffers.") |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
475 |
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
476 (widget-put (get 'editable-field 'widget-type) :keymap custom-field-keymap) |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
477 |
17334 | 478 ;;; Utilities. |
479 | |
480 (defun custom-split-regexp-maybe (regexp) | |
481 "If REGEXP is a string, split it to a list at `\\|'. | |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
482 You can get the original back from the result with: |
17334 | 483 (mapconcat 'identity result \"\\|\") |
484 | |
485 IF REGEXP is not a string, return it unchanged." | |
486 (if (stringp regexp) | |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
487 (split-string regexp "\\\\|") |
17334 | 488 regexp)) |
489 | |
17415 | 490 (defun custom-variable-prompt () |
49104
b74a6560ecbb
(custom-variable-prompt): Doc change. Use custom-variable-p.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49013
diff
changeset
|
491 "Prompt for a custom variable, defaulting to the variable at point. |
17415 | 492 Return a list suitable for use in `interactive'." |
66957
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
493 (let* ((v (variable-at-point)) |
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
494 (default (and (symbolp v) (custom-variable-p v) (symbol-name v))) |
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
495 (enable-recursive-minibuffers t) |
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
496 val) |
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
497 (setq val (completing-read |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
498 (if default (format "Customize variable (default %s): " default) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
499 "Customize variable: ") |
66957
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
500 obarray 'custom-variable-p t nil nil default)) |
17415 | 501 (list (if (equal val "") |
18085
3da4eaba1fe8
(custom-variable-prompt): Handle variable-at-point returning 0.
Richard M. Stallman <rms@gnu.org>
parents:
18067
diff
changeset
|
502 (if (symbolp v) v nil) |
3da4eaba1fe8
(custom-variable-prompt): Handle variable-at-point returning 0.
Richard M. Stallman <rms@gnu.org>
parents:
18067
diff
changeset
|
503 (intern val))))) |
17415 | 504 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
505 (defun custom-menu-filter (menu widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
506 "Convert MENU to the form used by `widget-choose'. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
507 MENU should be in the same format as `custom-variable-menu'. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
508 WIDGET is the widget to apply the filter entries of MENU on." |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
509 (let ((result nil) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
510 current name action filter) |
25685 | 511 (while menu |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
512 (setq current (car menu) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
513 name (nth 0 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
514 action (nth 1 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
515 filter (nth 2 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
516 menu (cdr menu)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
517 (if (or (null filter) (funcall filter widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
518 (push (cons name action) result) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
519 (push name result))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
520 (nreverse result))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
521 |
17415 | 522 ;;; Unlispify. |
523 | |
17334 | 524 (defvar custom-prefix-list nil |
28130 | 525 "List of prefixes that should be ignored by `custom-unlispify'.") |
17334 | 526 |
527 (defcustom custom-unlispify-menu-entries t | |
73643
b99336492688
(custom-unlispify-menu-entries, custom-unlispify-tag-names,
Juanma Barranquero <lekktu@gmail.com>
parents:
73194
diff
changeset
|
528 "Display menu entries as words instead of symbols if non-nil." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
529 :group 'custom-menu |
17334 | 530 :type 'boolean) |
531 | |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
532 (defcustom custom-unlispify-remove-prefixes nil |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
533 "Non-nil means remove group prefixes from option names in buffer." |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
534 :group 'custom-menu |
43508
c092c3c65251
2002-02-24 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43246
diff
changeset
|
535 :group 'custom-buffer |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
536 :type 'boolean) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
537 |
17334 | 538 (defun custom-unlispify-menu-entry (symbol &optional no-suffix) |
28130 | 539 "Convert SYMBOL into a menu entry." |
17334 | 540 (cond ((not custom-unlispify-menu-entries) |
541 (symbol-name symbol)) | |
542 ((get symbol 'custom-tag) | |
543 (if no-suffix | |
544 (get symbol 'custom-tag) | |
545 (concat (get symbol 'custom-tag) "..."))) | |
546 (t | |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
547 (with-current-buffer (get-buffer-create " *Custom-Work*") |
17334 | 548 (erase-buffer) |
549 (princ symbol (current-buffer)) | |
550 (goto-char (point-min)) | |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
551 ;; FIXME: Boolean variables are not predicates, so they shouldn't |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
552 ;; end with `-p'. -stef |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
553 ;; (when (and (eq (get symbol 'custom-type) 'boolean) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
554 ;; (re-search-forward "-p\\'" nil t)) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
555 ;; (replace-match "" t t) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
556 ;; (goto-char (point-min))) |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
557 (if custom-unlispify-remove-prefixes |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
558 (let ((prefixes custom-prefix-list) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
559 prefix) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
560 (while prefixes |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
561 (setq prefix (car prefixes)) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
562 (if (search-forward prefix (+ (point) (length prefix)) t) |
25685 | 563 (progn |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
564 (setq prefixes nil) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
565 (delete-region (point-min) (point))) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
566 (setq prefixes (cdr prefixes)))))) |
17334 | 567 (subst-char-in-region (point-min) (point-max) ?- ?\ t) |
568 (capitalize-region (point-min) (point-max)) | |
25685 | 569 (unless no-suffix |
17334 | 570 (goto-char (point-max)) |
571 (insert "...")) | |
572 (buffer-string))))) | |
573 | |
574 (defcustom custom-unlispify-tag-names t | |
73643
b99336492688
(custom-unlispify-menu-entries, custom-unlispify-tag-names,
Juanma Barranquero <lekktu@gmail.com>
parents:
73194
diff
changeset
|
575 "Display tag names as words instead of symbols if non-nil." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
576 :group 'custom-buffer |
17334 | 577 :type 'boolean) |
578 | |
579 (defun custom-unlispify-tag-name (symbol) | |
28130 | 580 "Convert SYMBOL into a menu entry." |
17334 | 581 (let ((custom-unlispify-menu-entries custom-unlispify-tag-names)) |
582 (custom-unlispify-menu-entry symbol t))) | |
583 | |
584 (defun custom-prefix-add (symbol prefixes) | |
28130 | 585 "Add SYMBOL to list of ignored PREFIXES." |
17334 | 586 (cons (or (get symbol 'custom-prefix) |
587 (concat (symbol-name symbol) "-")) | |
588 prefixes)) | |
589 | |
17415 | 590 ;;; Guess. |
591 | |
592 (defcustom custom-guess-name-alist | |
593 '(("-p\\'" boolean) | |
71368
7c41e181974c
(custom-guess-name-alist): Recognize `-flag'.
Richard M. Stallman <rms@gnu.org>
parents:
70179
diff
changeset
|
594 ("-flag\\'" boolean) |
17415 | 595 ("-hook\\'" hook) |
596 ("-face\\'" face) | |
597 ("-file\\'" file) | |
598 ("-function\\'" function) | |
599 ("-functions\\'" (repeat function)) | |
600 ("-list\\'" (repeat sexp)) | |
601 ("-alist\\'" (repeat (cons sexp sexp)))) | |
602 "Alist of (MATCH TYPE). | |
603 | |
25685 | 604 MATCH should be a regexp matching the name of a symbol, and TYPE should |
17415 | 605 be a widget suitable for editing the value of that symbol. The TYPE |
606 of the first entry where MATCH matches the name of the symbol will be | |
25685 | 607 used. |
17415 | 608 |
609 This is used for guessing the type of variables not declared with | |
610 customize." | |
611 :type '(repeat (group (regexp :tag "Match") (sexp :tag "Type"))) | |
67983
eea3a49a9d6c
* cus-edit.el (custom-guess-name-alist, custom-guess-doc-alist):
Chong Yidong <cyd@stupidchicken.com>
parents:
67977
diff
changeset
|
612 :group 'custom-buffer) |
17415 | 613 |
614 (defcustom custom-guess-doc-alist | |
615 '(("\\`\\*?Non-nil " boolean)) | |
616 "Alist of (MATCH TYPE). | |
617 | |
618 MATCH should be a regexp matching a documentation string, and TYPE | |
619 should be a widget suitable for editing the value of a variable with | |
620 that documentation string. The TYPE of the first entry where MATCH | |
621 matches the name of the symbol will be used. | |
622 | |
623 This is used for guessing the type of variables not declared with | |
624 customize." | |
625 :type '(repeat (group (regexp :tag "Match") (sexp :tag "Type"))) | |
67983
eea3a49a9d6c
* cus-edit.el (custom-guess-name-alist, custom-guess-doc-alist):
Chong Yidong <cyd@stupidchicken.com>
parents:
67977
diff
changeset
|
626 :group 'custom-buffer) |
17415 | 627 |
628 (defun custom-guess-type (symbol) | |
629 "Guess a widget suitable for editing the value of SYMBOL. | |
25685 | 630 This is done by matching SYMBOL with `custom-guess-name-alist' and |
17415 | 631 if that fails, the doc string with `custom-guess-doc-alist'." |
632 (let ((name (symbol-name symbol)) | |
633 (names custom-guess-name-alist) | |
634 current found) | |
635 (while names | |
636 (setq current (car names) | |
637 names (cdr names)) | |
638 (when (string-match (nth 0 current) name) | |
639 (setq found (nth 1 current) | |
640 names nil))) | |
641 (unless found | |
642 (let ((doc (documentation-property symbol 'variable-documentation)) | |
643 (docs custom-guess-doc-alist)) | |
25685 | 644 (when doc |
17415 | 645 (while docs |
646 (setq current (car docs) | |
647 docs (cdr docs)) | |
648 (when (string-match (nth 0 current) doc) | |
649 (setq found (nth 1 current) | |
650 docs nil)))))) | |
651 found)) | |
652 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
653 ;;; Sorting. |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
654 |
74921
2472ac8d27d2
(custom-browse-sort-alphabetically, custom-buffer-sort-alphabetically)
Richard M. Stallman <rms@gnu.org>
parents:
73942
diff
changeset
|
655 ;;;###autoload |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
656 (defcustom custom-browse-sort-alphabetically nil |
74921
2472ac8d27d2
(custom-browse-sort-alphabetically, custom-buffer-sort-alphabetically)
Richard M. Stallman <rms@gnu.org>
parents:
73942
diff
changeset
|
657 "If non-nil, sort customization group alphabetically in `custom-browse'." |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
658 :type 'boolean |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
659 :group 'custom-browse) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
660 |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
661 (defcustom custom-browse-order-groups nil |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
662 "If non-nil, order group members within each customization group. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
663 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
664 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
665 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
666 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
667 (const :tag "none" nil)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
668 :group 'custom-browse) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
669 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
670 (defcustom custom-browse-only-groups nil |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
671 "If non-nil, show group members only within each customization group." |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
672 :type 'boolean |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
673 :group 'custom-browse) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
674 |
74921
2472ac8d27d2
(custom-browse-sort-alphabetically, custom-buffer-sort-alphabetically)
Richard M. Stallman <rms@gnu.org>
parents:
73942
diff
changeset
|
675 ;;;###autoload |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
676 (defcustom custom-buffer-sort-alphabetically t |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
677 "Whether to sort customization groups alphabetically in Custom buffer." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
678 :type 'boolean |
107723
d6963128f839
* cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
Chong Yidong <cyd@stupidchicken.com>
parents:
107381
diff
changeset
|
679 :group 'custom-buffer |
d6963128f839
* cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
Chong Yidong <cyd@stupidchicken.com>
parents:
107381
diff
changeset
|
680 :version "24.1") |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
681 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
682 (defcustom custom-buffer-order-groups 'last |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
683 "If non-nil, order group members within each customization group. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
684 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
685 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
686 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
687 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
688 (const :tag "none" nil)) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
689 :group 'custom-buffer) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
690 |
74921
2472ac8d27d2
(custom-browse-sort-alphabetically, custom-buffer-sort-alphabetically)
Richard M. Stallman <rms@gnu.org>
parents:
73942
diff
changeset
|
691 ;;;###autoload |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
692 (defcustom custom-menu-sort-alphabetically nil |
74921
2472ac8d27d2
(custom-browse-sort-alphabetically, custom-buffer-sort-alphabetically)
Richard M. Stallman <rms@gnu.org>
parents:
73942
diff
changeset
|
693 "If non-nil, sort each customization group alphabetically in menus." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
694 :type 'boolean |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
695 :group 'custom-menu) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
696 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
697 (defcustom custom-menu-order-groups 'first |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
698 "If non-nil, order group members within each customization group. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
699 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
700 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
701 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
702 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
703 (const :tag "none" nil)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
704 :group 'custom-menu) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
705 |
105939
a0f778f4a995
* term/x-win.el (x-gtk-stock-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104988
diff
changeset
|
706 ;;;###autoload (add-hook 'same-window-regexps (purecopy "\\`\\*Customiz.*\\*\\'")) |
22332
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
707 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
708 (defun custom-sort-items (items sort-alphabetically order-groups) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
709 "Return a sorted copy of ITEMS. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
710 ITEMS should be a `custom-group' property. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
711 If SORT-ALPHABETICALLY non-nil, sort alphabetically. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
712 If ORDER-GROUPS is `first' order groups before non-groups, if `last' order |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
713 groups after non-groups, if nil do not order groups at all." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
714 (sort (copy-sequence items) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
715 (lambda (a b) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
716 (let ((typea (nth 1 a)) (typeb (nth 1 b)) |
28568
cfff869d8a3d
(custom-sort-items): Avoid symbol-name with new
Dave Love <fx@gnu.org>
parents:
28310
diff
changeset
|
717 (namea (nth 0 a)) (nameb (nth 0 b))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
718 (cond ((not order-groups) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
719 ;; Since we don't care about A and B order, maybe sort. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
720 (when sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
721 (string-lessp namea nameb))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
722 ((eq typea 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
723 ;; If B is also a group, maybe sort. Otherwise, order A and B. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
724 (if (eq typeb 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
725 (when sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
726 (string-lessp namea nameb)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
727 (eq order-groups 'first))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
728 ((eq typeb 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
729 ;; Since A cannot be a group, order A and B. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
730 (eq order-groups 'last)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
731 (sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
732 ;; Since A and B cannot be groups, sort. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
733 (string-lessp namea nameb))))))) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
734 |
17415 | 735 ;;; Custom Mode Commands. |
17334 | 736 |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
737 ;; This variable is used by `custom-tool-bar-map', or directly by |
99634
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
738 ;; `custom-buffer-create-internal' if `custom-buffer-verbose-help' is non-nil. |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
739 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
740 (defvar custom-commands |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
741 '(("Set for current session" Custom-set t |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
742 "Apply all settings in this buffer to the current session" |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
743 "index" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
744 "Apply") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
745 ("Save for future sessions" Custom-save |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
746 (or custom-file user-init-file) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
747 "Apply all settings in this buffer and save them for future Emacs sessions." |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
748 "save" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
749 "Save") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
750 ("Undo edits" Custom-reset-current t |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
751 "Restore all settings in this buffer to reflect their current values." |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
752 "refresh" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
753 "Undo") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
754 ("Reset to saved" Custom-reset-saved t |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
755 "Restore all settings in this buffer to their saved values (if any)." |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
756 "undo" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
757 "Reset") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
758 ("Erase customizations" Custom-reset-standard |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
759 (or custom-file user-init-file) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
760 "Un-customize all settings in this buffer and save them with standard values." |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
761 "delete" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
762 "Uncustomize") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
763 ("Help for Customize" Custom-help t |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
764 "Get help for using Customize." |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
765 "help" |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
766 "Help") |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
767 ("Exit" Custom-buffer-done t "Exit Customize." "exit" "Exit"))) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
768 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
769 (defun Custom-help () |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
770 "Read the node on Easy Customization in the Emacs manual." |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
771 (interactive) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
772 (info "(emacs)Easy Customization")) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
773 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
774 (defvar custom-reset-menu |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
775 '(("Undo Edits" . Custom-reset-current) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
776 ("Reset to Saved" . Custom-reset-saved) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
777 ("Erase Customizations (use standard values)" . Custom-reset-standard)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
778 "Alist of actions for the `Reset' button. |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
779 The key is a string containing the name of the action, the value is a |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
780 Lisp function taking the widget as an element which will be called |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
781 when the action is chosen.") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
782 |
17334 | 783 (defvar custom-options nil |
784 "Customization widgets in the current buffer.") | |
785 | |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
786 (defun custom-command-apply (fun query &optional strong-query) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
787 "Call function FUN on all widgets in `custom-options'. |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
788 If there is more than one widget, ask user for confirmation using |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
789 the query string QUERY, using `y-or-n-p' if STRONG-QUERY is nil, |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
790 and `yes-or-no-p' otherwise." |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
791 (if (or (and (= 1 (length custom-options)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
792 (memq (widget-type (car custom-options)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
793 '(custom-variable custom-face))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
794 (funcall (if strong-query 'yes-or-no-p 'y-or-n-p) query)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
795 (progn (mapc fun custom-options) t) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
796 (message "Aborted") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
797 nil)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
798 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
799 (defun Custom-set (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
800 "Set the current value of all edited settings in the buffer." |
17334 | 801 (interactive) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
802 (custom-command-apply |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
803 (lambda (child) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
804 (when (eq (widget-get child :custom-state) 'modified) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
805 (widget-apply child :custom-set))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
806 "Set all values according to this buffer? ")) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
807 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
808 (defun Custom-save (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
809 "Set all edited settings, then save all settings that have been set. |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
810 If a setting was edited and set before, this saves it. If a |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
811 setting was merely edited before, this sets it then saves it." |
17334 | 812 (interactive) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
813 (when (custom-command-apply |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
814 (lambda (child) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
815 (when (memq (widget-get child :custom-state) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
816 '(modified set changed rogue)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
817 (widget-apply child :custom-mark-to-save))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
818 "Save all settings in this buffer? " t) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
819 ;; Save changes to buffer and redraw. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
820 (custom-save-all) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
821 (dolist (child custom-options) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
822 (widget-apply child :custom-state-set-and-redraw)))) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
823 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
824 (defun custom-reset (widget &optional event) |
17334 | 825 "Select item from reset menu." |
826 (let* ((completion-ignore-case t) | |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
827 (answer (widget-choose "Reset settings" |
17334 | 828 custom-reset-menu |
829 event))) | |
830 (if answer | |
831 (funcall answer)))) | |
832 | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
833 (defun Custom-reset-current (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
834 "Reset all edited settings in the buffer to show their current values." |
17334 | 835 (interactive) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
836 (custom-command-apply |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
837 (lambda (widget) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
838 (if (memq (widget-get widget :custom-state) '(modified changed)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
839 (widget-apply widget :custom-reset-current))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
840 "Reset all settings' buffer text to show current values? ")) |
17334 | 841 |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
842 (defun Custom-reset-saved (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
843 "Reset all edited or set settings in the buffer to their saved value. |
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
844 This also shows the saved values in the buffer." |
17334 | 845 (interactive) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
846 (custom-command-apply |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
847 (lambda (widget) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
848 (if (memq (widget-get widget :custom-state) '(modified set changed rogue)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
849 (widget-apply widget :custom-reset-saved))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
850 "Reset all settings (current values and buffer text) to saved values? ")) |
17334 | 851 |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
852 ;; The next two variables are bound to '(t) by `Custom-reset-standard' |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
853 ;; and `custom-group-reset-standard'. If these variables are nil, both |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
854 ;; `custom-variable-reset-standard' and `custom-face-reset-standard' |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
855 ;; save, reset and redraw the handled widget immediately. Otherwise, |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
856 ;; they add the widget to the corresponding list and leave it to |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
857 ;; `custom-reset-standard-save-and-update' to save, reset and redraw it. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
858 (defvar custom-reset-standard-variables-list nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
859 (defvar custom-reset-standard-faces-list nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
860 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
861 ;; The next function was excerpted from `custom-variable-reset-standard' |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
862 ;; and `custom-face-reset-standard' and is used to avoid calling |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
863 ;; `custom-save-all' repeatedly (and thus saving settings to file one by |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
864 ;; one) when erasing all customizations. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
865 (defun custom-reset-standard-save-and-update () |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
866 "Save settings and redraw after erasing customizations." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
867 (when (or (and custom-reset-standard-variables-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
868 (not (eq custom-reset-standard-variables-list '(t)))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
869 (and custom-reset-standard-faces-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
870 (not (eq custom-reset-standard-faces-list '(t))))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
871 ;; Save settings to file. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
872 (custom-save-all) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
873 ;; Set state of and redraw variables. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
874 (dolist (widget custom-reset-standard-variables-list) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
875 (unless (eq widget t) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
876 (widget-put widget :custom-state 'unknown) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
877 (custom-redraw widget))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
878 ;; Set state of and redraw faces. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
879 (dolist (widget custom-reset-standard-faces-list) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
880 (unless (eq widget t) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
881 (let* ((symbol (widget-value widget)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
882 (child (car (widget-get widget :children))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
883 (value (get symbol 'face-defface-spec)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
884 (comment-widget (widget-get widget :comment-widget))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
885 (put symbol 'face-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
886 (widget-value-set child |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
887 (custom-pre-filter-face-spec |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
888 (list (list t (custom-face-attributes-get |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
889 symbol nil))))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
890 ;; This call manages the comment visibility |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
891 (widget-value-set comment-widget "") |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
892 (custom-face-state-set widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
893 (custom-redraw-magic widget)))))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
894 |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
895 (defun Custom-reset-standard (&rest ignore) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
896 "Erase all customizations (either current or saved) in current buffer. |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
897 The immediate result is to restore them to their standard values. |
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
898 This operation eliminates any saved values for the group members, |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
899 making them as if they had never been customized at all." |
17334 | 900 (interactive) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
901 ;; Bind these temporarily. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
902 (let ((custom-reset-standard-variables-list '(t)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
903 (custom-reset-standard-faces-list '(t))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
904 (custom-command-apply |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
905 (lambda (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
906 (and (or (null (widget-get widget :custom-standard-value)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
907 (widget-apply widget :custom-standard-value)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
908 (memq (widget-get widget :custom-state) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
909 '(modified set changed saved rogue)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
910 (widget-apply widget :custom-mark-to-reset-standard))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
911 "Erase all customizations for settings in this buffer? " t) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
912 (custom-reset-standard-save-and-update))) |
17334 | 913 |
914 ;;; The Customize Commands | |
915 | |
25685 | 916 (defun custom-prompt-variable (prompt-var prompt-val &optional comment) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
917 "Prompt for a variable and a value and return them as a list. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
918 PROMPT-VAR is the prompt for the variable, and PROMPT-VAL is the |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
919 prompt for the value. The %s escape in PROMPT-VAL is replaced with |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
920 the name of the variable. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
921 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
922 If the variable has a `variable-interactive' property, that is used as if |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
923 it were the arg to `interactive' (which see) to interactively read the value. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
924 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
925 If the variable has a `custom-type' property, it must be a widget and the |
25685 | 926 `:prompt-value' property of that widget will be used for reading the value. |
927 | |
73643
b99336492688
(custom-unlispify-menu-entries, custom-unlispify-tag-names,
Juanma Barranquero <lekktu@gmail.com>
parents:
73194
diff
changeset
|
928 If optional COMMENT argument is non-nil, also prompt for a comment and return |
25685 | 929 it as the third element in the list." |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
930 (let* ((var (read-variable prompt-var)) |
25685 | 931 (minibuffer-help-form '(describe-variable var)) |
932 (val | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
933 (let ((prop (get var 'variable-interactive)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
934 (type (get var 'custom-type)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
935 (prompt (format prompt-val var))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
936 (unless (listp type) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
937 (setq type (list type))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
938 (cond (prop |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
939 ;; Use VAR's `variable-interactive' property |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
940 ;; as an interactive spec for prompting. |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
941 (call-interactively `(lambda (arg) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
942 (interactive ,prop) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
943 arg))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
944 (type |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
945 (widget-prompt-value type |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
946 prompt |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
947 (if (boundp var) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
948 (symbol-value var)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
949 (not (boundp var)))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
950 (t |
25685 | 951 (eval-minibuffer prompt)))))) |
952 (if comment | |
953 (list var val | |
954 (read-string "Comment: " (get var 'variable-comment))) | |
955 (list var val)))) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
956 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
957 ;;;###autoload |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
958 (defun customize-set-value (variable value &optional comment) |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
959 "Set VARIABLE to VALUE, and return VALUE. VALUE is a Lisp object. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
960 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
961 If VARIABLE has a `variable-interactive' property, that is used as if |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
962 it were the arg to `interactive' (which see) to interactively read the value. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
963 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
964 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 965 `:prompt-value' property of that widget will be used for reading the value. |
966 | |
967 If given a prefix (or a COMMENT argument), also prompt for a comment." | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
968 (interactive (custom-prompt-variable "Set variable: " |
25685 | 969 "Set %s to value: " |
970 current-prefix-arg)) | |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
971 |
25685 | 972 (cond ((string= comment "") |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
973 (put variable 'variable-comment nil)) |
25685 | 974 (comment |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
975 (put variable 'variable-comment comment))) |
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
976 (set variable value)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
977 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
978 ;;;###autoload |
28130 | 979 (defun customize-set-variable (variable value &optional comment) |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
980 "Set the default for VARIABLE to VALUE, and return VALUE. |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
981 VALUE is a Lisp object. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
982 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
983 If VARIABLE has a `custom-set' property, that is used for setting |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
984 VARIABLE, otherwise `set-default' is used. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
985 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
986 If VARIABLE has a `variable-interactive' property, that is used as if |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
987 it were the arg to `interactive' (which see) to interactively read the value. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
988 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
989 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 990 `:prompt-value' property of that widget will be used for reading the value. |
991 | |
992 If given a prefix (or a COMMENT argument), also prompt for a comment." | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
993 (interactive (custom-prompt-variable "Set variable: " |
25685 | 994 "Set customized value for %s to: " |
995 current-prefix-arg)) | |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
996 (custom-load-symbol variable) |
69007
b9e2a1b4b54a
* cus-edit.el (customize-set-variable): Push setting to `user' theme.
Chong Yidong <cyd@stupidchicken.com>
parents:
69004
diff
changeset
|
997 (custom-push-theme 'theme-value variable 'user 'set (custom-quote value)) |
28130 | 998 (funcall (or (get variable 'custom-set) 'set-default) variable value) |
999 (put variable 'customized-value (list (custom-quote value))) | |
25685 | 1000 (cond ((string= comment "") |
28130 | 1001 (put variable 'variable-comment nil) |
1002 (put variable 'customized-variable-comment nil)) | |
25685 | 1003 (comment |
28130 | 1004 (put variable 'variable-comment comment) |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1005 (put variable 'customized-variable-comment comment))) |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1006 value) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1007 |
17334 | 1008 ;;;###autoload |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1009 (defun customize-save-variable (variable value &optional comment) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1010 "Set the default for VARIABLE to VALUE, and save it for future sessions. |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1011 Return VALUE. |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1012 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1013 If VARIABLE has a `custom-set' property, that is used for setting |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1014 VARIABLE, otherwise `set-default' is used. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1015 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1016 If VARIABLE has a `variable-interactive' property, that is used as if |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1017 it were the arg to `interactive' (which see) to interactively read the value. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1018 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1019 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 1020 `:prompt-value' property of that widget will be used for reading the value. |
1021 | |
1022 If given a prefix (or a COMMENT argument), also prompt for a comment." | |
43063 | 1023 (interactive (custom-prompt-variable "Set and save variable: " |
25685 | 1024 "Set and save value for %s as: " |
1025 current-prefix-arg)) | |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1026 (funcall (or (get variable 'custom-set) 'set-default) variable value) |
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1027 (put variable 'saved-value (list (custom-quote value))) |
67797
7bdbb812b2f9
* custom.el (custom-push-theme): Fix docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
67793
diff
changeset
|
1028 (custom-push-theme 'theme-value variable 'user 'set (custom-quote value)) |
25685 | 1029 (cond ((string= comment "") |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1030 (put variable 'variable-comment nil) |
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1031 (put variable 'saved-variable-comment nil)) |
25685 | 1032 (comment |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1033 (put variable 'variable-comment comment) |
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
1034 (put variable 'saved-variable-comment comment))) |
76338
12695d523f37
(customize-save-variable): Clear customized-value property (saved
Chong Yidong <cyd@stupidchicken.com>
parents:
76100
diff
changeset
|
1035 (put variable 'customized-value nil) |
12695d523f37
(customize-save-variable): Clear customized-value property (saved
Chong Yidong <cyd@stupidchicken.com>
parents:
76100
diff
changeset
|
1036 (put variable 'customized-variable-comment nil) |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1037 (custom-save-all) |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
1038 value) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1039 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1040 ;;;###autoload |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1041 (defun customize () |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1042 "Select a customization buffer which you can use to set user options. |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1043 User options are structured into \"groups\". |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1044 Initially the top-level group `Emacs' and its immediate subgroups |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1045 are shown; the contents of those subgroups are initially hidden." |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1046 (interactive) |
17703 | 1047 (customize-group 'emacs)) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1048 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1049 ;;;###autoload |
47823
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1050 (defun customize-mode (mode) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1051 "Customize options related to the current major mode. |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1052 If a prefix \\[universal-argument] was given (or if the current major mode has no known group), |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1053 then prompt for the MODE to customize." |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1054 (interactive |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1055 (list |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1056 (let ((completion-regexp-list '("-mode\\'")) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1057 (group (custom-group-of-mode major-mode))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1058 (if (and group (not current-prefix-arg)) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1059 major-mode |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1060 (intern |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1061 (completing-read (if group |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1062 (format "Major mode (default %s): " major-mode) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1063 "Major mode: ") |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1064 obarray |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1065 'custom-group-of-mode |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1066 t nil nil (if group (symbol-name major-mode)))))))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1067 (customize-group (custom-group-of-mode mode))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1068 |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1069 (defun customize-read-group () |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1070 (let ((completion-ignore-case t)) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1071 (completing-read "Customize group (default emacs): " |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1072 obarray |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1073 (lambda (symbol) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1074 (or (and (get symbol 'custom-loads) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1075 (not (get symbol 'custom-autoload))) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1076 (get symbol 'custom-group))) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1077 t))) |
47823
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1078 |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
1079 ;;;###autoload |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1080 (defun customize-group (&optional group) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1081 "Customize GROUP, which must be a customization group." |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1082 (interactive (list (customize-read-group))) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1083 (when (stringp group) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1084 (if (string-equal "" group) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1085 (setq group 'emacs) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1086 (setq group (intern group)))) |
18359
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1087 (let ((name (format "*Customize Group: %s*" |
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1088 (custom-unlispify-tag-name group)))) |
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1089 (if (get-buffer name) |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1090 (pop-to-buffer name) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1091 (custom-buffer-create |
22001
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1092 (list (list group 'custom-group)) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1093 name |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1094 (concat " for group " |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1095 (custom-unlispify-tag-name group)))))) |
17334 | 1096 |
1097 ;;;###autoload | |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1098 (defun customize-group-other-window (&optional group) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1099 "Customize GROUP, which must be a customization group, in another window." |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1100 (interactive (list (customize-read-group))) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1101 (let ((pop-up-windows t) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1102 (same-window-buffer-names nil) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1103 (same-window-regexps nil)) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1104 (customize-group group))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1105 |
18089 | 1106 ;;;###autoload |
1107 (defalias 'customize-variable 'customize-option) | |
18086
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1108 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1109 ;;;###autoload |
18086
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1110 (defun customize-option (symbol) |
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1111 "Customize SYMBOL, which must be a user option variable." |
17415 | 1112 (interactive (custom-variable-prompt)) |
71390
927d95604b99
(customize-option, customize-option-other-window): Error if SYMBOL is nil.
Richard M. Stallman <rms@gnu.org>
parents:
71368
diff
changeset
|
1113 (unless symbol |
927d95604b99
(customize-option, customize-option-other-window): Error if SYMBOL is nil.
Richard M. Stallman <rms@gnu.org>
parents:
71368
diff
changeset
|
1114 (error "No variable specified")) |
64151
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1115 (let ((basevar (indirect-variable symbol))) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1116 (custom-buffer-create (list (list basevar 'custom-variable)) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1117 (format "*Customize Option: %s*" |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1118 (custom-unlispify-tag-name basevar))) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1119 (unless (eq symbol basevar) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1120 (message "`%s' is an alias for `%s'" symbol basevar)))) |
17334 | 1121 |
48975
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1122 ;;;###autoload |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1123 (defalias 'customize-variable-other-window 'customize-option-other-window) |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1124 |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1125 ;;;###autoload |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1126 (defun customize-option-other-window (symbol) |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1127 "Customize SYMBOL, which must be a user option variable. |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1128 Show the buffer in another window, but don't select it." |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1129 (interactive (custom-variable-prompt)) |
71390
927d95604b99
(customize-option, customize-option-other-window): Error if SYMBOL is nil.
Richard M. Stallman <rms@gnu.org>
parents:
71368
diff
changeset
|
1130 (unless symbol |
927d95604b99
(customize-option, customize-option-other-window): Error if SYMBOL is nil.
Richard M. Stallman <rms@gnu.org>
parents:
71368
diff
changeset
|
1131 (error "No variable specified")) |
64151
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1132 (let ((basevar (indirect-variable symbol))) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1133 (custom-buffer-create-other-window |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1134 (list (list basevar 'custom-variable)) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1135 (format "*Customize Option: %s*" (custom-unlispify-tag-name basevar))) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1136 (unless (eq symbol basevar) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1137 (message "`%s' is an alias for `%s'" symbol basevar)))) |
48975
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1138 |
107370
934bc4b20344
* cus-edit.el (customize-changed-options-previous-release): Bump to 23.1.
Glenn Morris <rgm@gnu.org>
parents:
107167
diff
changeset
|
1139 (defvar customize-changed-options-previous-release "23.1" |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1140 "Version for `customize-changed-options' to refer back to by default.") |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1141 |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1142 ;; Packages will update this variable, so make it available. |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1143 ;;;###autoload |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1144 (defvar customize-package-emacs-version-alist nil |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1145 "Alist mapping versions of a package to Emacs versions. |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1146 We use this for packages that have their own names, but are released |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1147 as part of Emacs itself. |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1148 |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1149 Each elements looks like this: |
70021
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1150 |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1151 (PACKAGE (PVERSION . EVERSION)...) |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1152 |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1153 Here PACKAGE is the name of a package, as a symbol. After |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1154 PACKAGE come one or more elements, each associating a |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1155 package version PVERSION with the first Emacs version |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1156 EVERSION in which it (or a subsequent version of PACKAGE) |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1157 was first released. Both PVERSION and EVERSION are strings. |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1158 PVERSION should be a string that this package used in |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1159 the :package-version keyword for `defcustom', `defgroup', |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1160 and `defface'. |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1161 |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1162 For example, the MH-E package updates this alist as follows: |
70021
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1163 |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1164 (add-to-list 'customize-package-emacs-version-alist |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1165 '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\") |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1166 (\"7.0\" . \"22.1\") (\"7.1\" . \"22.1\") |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1167 (\"7.2\" . \"22.1\") (\"7.3\" . \"22.1\") |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1168 (\"7.4\" . \"22.1\") (\"8.0\" . \"22.1\"))) |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1169 |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1170 The value of PACKAGE needs to be unique and it needs to match the |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1171 PACKAGE value appearing in the :package-version keyword. Since |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1172 the user might see the value in a error message, a good choice is |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1173 the official name of the package, such as MH-E or Gnus.") |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1174 |
17334 | 1175 ;;;###autoload |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1176 (defalias 'customize-changed 'customize-changed-options) |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1177 |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1178 ;;;###autoload |
79190
afa7fa1e71f4
(customize-changed-options): Make arg optional.
Richard M. Stallman <rms@gnu.org>
parents:
79040
diff
changeset
|
1179 (defun customize-changed-options (&optional since-version) |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1180 "Customize all settings whose meanings have changed in Emacs itself. |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1181 This includes new user option variables and faces, and new |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1182 customization groups, as well as older options and faces whose meanings |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1183 or default values have changed since the previous major Emacs release. |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1184 |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1185 With argument SINCE-VERSION (a string), customize all settings |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1186 that were added or redefined since that version." |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1187 |
69540
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1188 (interactive |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1189 (list |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1190 (read-from-minibuffer |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1191 (format "Customize options changed, since version (default %s): " |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1192 customize-changed-options-previous-release)))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1193 (if (equal since-version "") |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1194 (setq since-version nil) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1195 (unless (condition-case nil |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1196 (numberp (read since-version)) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1197 (error nil)) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1198 (signal 'wrong-type-argument (list 'numberp since-version)))) |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1199 (unless since-version |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1200 (setq since-version customize-changed-options-previous-release)) |
49218
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1201 |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1202 ;; Load the information for versions since since-version. We use |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1203 ;; custom-load-symbol for this. |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1204 (put 'custom-versions-load-alist 'custom-loads nil) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1205 (dolist (elt custom-versions-load-alist) |
49300
b99be2b86231
(customize-changed-options): Undo last doc change.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49218
diff
changeset
|
1206 (if (customize-version-lessp since-version (car elt)) |
b99be2b86231
(customize-changed-options): Undo last doc change.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49218
diff
changeset
|
1207 (dolist (load (cdr elt)) |
b99be2b86231
(customize-changed-options): Undo last doc change.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49218
diff
changeset
|
1208 (custom-add-load 'custom-versions-load-alist load)))) |
49218
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1209 (custom-load-symbol 'custom-versions-load-alist) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1210 (put 'custom-versions-load-alist 'custom-loads nil) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1211 |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1212 (let (found) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1213 (mapatoms |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1214 (lambda (symbol) |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1215 (let* ((package-version (get symbol 'custom-package-version)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1216 (version |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1217 (or (and package-version |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1218 (customize-package-emacs-version symbol |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1219 package-version)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1220 (get symbol 'custom-version)))) |
49218
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1221 (if version |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1222 (when (customize-version-lessp since-version version) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1223 (if (or (get symbol 'custom-group) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1224 (get symbol 'group-documentation)) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1225 (push (list symbol 'custom-group) found)) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1226 (if (custom-variable-p symbol) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1227 (push (list symbol 'custom-variable) found)) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1228 (if (custom-facep symbol) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1229 (push (list symbol 'custom-face) found))))))) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1230 (if found |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1231 (custom-buffer-create (custom-sort-items found t 'first) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1232 "*Customize Changed Options*") |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1233 (error "No user option defaults have been changed since Emacs %s" |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1234 since-version)))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1235 |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1236 (defun customize-package-emacs-version (symbol package-version) |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1237 "Return the Emacs version in which SYMBOL's meaning last changed. |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1238 PACKAGE-VERSION has the form (PACKAGE . VERSION). We use |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1239 `customize-package-emacs-version-alist' to find the version of |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1240 Emacs that is associated with version VERSION of PACKAGE." |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1241 (let (package-versions emacs-version) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1242 ;; Use message instead of error since we want user to be able to |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1243 ;; see the rest of the symbols even if a package author has |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1244 ;; botched things up. |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1245 (cond ((not (listp package-version)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1246 (message "Invalid package-version value for %s" symbol)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1247 ((setq package-versions (assq (car package-version) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1248 customize-package-emacs-version-alist)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1249 (setq emacs-version |
70021
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1250 (cdr (assoc (cdr package-version) package-versions))) |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1251 (unless emacs-version |
70021
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1252 (message "%s version %s not found in %s" symbol |
8991a6461375
* cus-edit.el (customize-package-emacs-version-alist): Update
Bill Wohler <wohler@newt.com>
parents:
69922
diff
changeset
|
1253 (cdr package-version) |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1254 "customize-package-emacs-version-alist"))) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1255 (t |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1256 (message "Package %s version %s lists no corresponding Emacs version" |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1257 (car package-version) |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
1258 (cdr package-version)))) |
69922
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1259 emacs-version)) |
dc1f0ab7e276
* custom.el (defcustom, custom-handle-keyword): Add :package-version
Bill Wohler <wohler@newt.com>
parents:
69624
diff
changeset
|
1260 |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1261 (defun customize-version-lessp (version1 version2) |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1262 ;; Why are the versions strings, and given that they are, why aren't |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1263 ;; they converted to numbers and compared as such here? -- fx |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1264 |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1265 ;; In case someone made a mistake and left out the quotes |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1266 ;; in the :version value. |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1267 (if (numberp version2) |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1268 (setq version2 (prin1-to-string version2))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1269 (let (major1 major2 minor1 minor2) |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1270 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1271 (setq major1 (read (or (match-string 1 version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1272 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1273 (setq minor1 (read (or (match-string 3 version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1274 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1275 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1276 (setq major2 (read (or (match-string 1 version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1277 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1278 (setq minor2 (read (or (match-string 3 version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1279 "0"))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1280 (or (< major1 major2) |
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1281 (and (= major1 major2) |
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1282 (< minor1 minor2))))) |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
1283 |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1284 ;;;###autoload |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1285 (defun customize-face (&optional face) |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
1286 "Customize FACE, which should be a face name or nil. |
63661
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1287 If FACE is nil, customize all faces. If FACE is actually a |
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1288 face-alias, customize the face it is aliased to. |
44841
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1289 |
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1290 Interactively, when point is on text which has a face specified, |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
1291 suggest to customize that face, if it's customizable." |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1292 (interactive (list (read-face-name "Customize face" "all faces" t))) |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1293 (if (member face '(nil "")) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1294 (setq face (face-list))) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1295 (if (and (listp face) (null (cdr face))) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1296 (setq face (car face))) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1297 (if (listp face) |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1298 (custom-buffer-create |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1299 (custom-sort-items |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1300 (mapcar (lambda (s) (list s 'custom-face)) face) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1301 t nil) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1302 "*Customize Faces*") |
63661
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1303 ;; If FACE is actually an alias, customize the face it is aliased to. |
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1304 (if (get face 'face-alias) |
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1305 (setq face (get face 'face-alias))) |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1306 (unless (facep face) |
49013
4a3d5b9c79b9
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48997
diff
changeset
|
1307 (error "Invalid face %S" face)) |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1308 (custom-buffer-create |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1309 (list (list face 'custom-face)) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1310 (format "*Customize Face: %s*" |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1311 (custom-unlispify-tag-name face))))) |
17334 | 1312 |
1313 ;;;###autoload | |
44891 | 1314 (defun customize-face-other-window (&optional face) |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
1315 "Show customization buffer for face FACE in other window. |
63661
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1316 If FACE is actually a face-alias, customize the face it is aliased to. |
44841
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1317 |
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1318 Interactively, when point is on text which has a face specified, |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
1319 suggest to customize that face, if it's customizable." |
82193
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1320 (interactive (list (read-face-name "Customize face" "all faces" t))) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1321 (let ((pop-up-windows t) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1322 (same-window-buffer-names nil) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1323 (same-window-regexps nil)) |
6037be8575c3
(customize-read-group): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
1324 (customize-face face))) |
17415 | 1325 |
75046
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1326 (defalias 'customize-customized 'customize-unsaved) |
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1327 |
17415 | 1328 ;;;###autoload |
75046
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1329 (defun customize-unsaved () |
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1330 "Customize all user options set in this session but not saved." |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1331 (interactive) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1332 (let ((found nil)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1333 (mapatoms (lambda (symbol) |
25685 | 1334 (and (or (get symbol 'customized-face) |
1335 (get symbol 'customized-face-comment)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1336 (custom-facep symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1337 (push (list symbol 'custom-face) found)) |
25685 | 1338 (and (or (get symbol 'customized-value) |
1339 (get symbol 'customized-variable-comment)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1340 (boundp symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1341 (push (list symbol 'custom-variable) found)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1342 (if (not found) |
75046
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1343 (error "No user options are set but unsaved") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1344 (custom-buffer-create (custom-sort-items found t nil) |
75046
b644db4759fa
(customize-unsaved): Renamed from customize-customized.
Richard M. Stallman <rms@gnu.org>
parents:
74921
diff
changeset
|
1345 "*Customize Unsaved*")))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1346 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1347 ;;;###autoload |
50077
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1348 (defun customize-rogue () |
68232
4580b1bedd8a
(customize-rogue): Minor doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
68194
diff
changeset
|
1349 "Customize all user variables modified outside customize." |
50077
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1350 (interactive) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1351 (let ((found nil)) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1352 (mapatoms (lambda (symbol) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1353 (let ((cval (or (get symbol 'customized-value) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1354 (get symbol 'saved-value) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1355 (get symbol 'standard-value)))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1356 (when (and cval ;Declared with defcustom. |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1357 (default-boundp symbol) ;Has a value. |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
1358 (not (equal (eval (car cval)) |
50077
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1359 ;; Which does not match customize. |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1360 (default-value symbol)))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1361 (push (list symbol 'custom-variable) found))))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1362 (if (not found) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1363 (error "No rogue user options") |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1364 (custom-buffer-create (custom-sort-items found t nil) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1365 "*Customize Rogue*")))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1366 ;;;###autoload |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1367 (defun customize-saved () |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1368 "Customize all already saved user options." |
17334 | 1369 (interactive) |
1370 (let ((found nil)) | |
1371 (mapatoms (lambda (symbol) | |
25685 | 1372 (and (or (get symbol 'saved-face) |
1373 (get symbol 'saved-face-comment)) | |
17334 | 1374 (custom-facep symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1375 (push (list symbol 'custom-face) found)) |
25685 | 1376 (and (or (get symbol 'saved-value) |
1377 (get symbol 'saved-variable-comment)) | |
17334 | 1378 (boundp symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1379 (push (list symbol 'custom-variable) found)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1380 (if (not found ) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1381 (error "No saved user options") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1382 (custom-buffer-create (custom-sort-items found t nil) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1383 "*Customize Saved*")))) |
17334 | 1384 |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1385 (declare-function apropos-parse-pattern "apropos" (pattern)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1386 |
17334 | 1387 ;;;###autoload |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1388 (defun customize-apropos (pattern &optional type) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1389 "Customize all loaded options, faces and groups matching PATTERN. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1390 PATTERN can be a word, a list of words (separated by spaces), |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1391 or a regexp (using some regexp special characters). If it is a word, |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1392 search for matches for that word as a substring. If it is a list of words, |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1393 search for matches for any two (or more) of those words. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1394 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1395 If TYPE is `options', include only options. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1396 If TYPE is `faces', include only faces. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1397 If TYPE is `groups', include only groups. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1398 If TYPE is t (interactively, with prefix arg), include variables |
67677
acbc5122c634
(customize-apropos, customize-apropos-options): Docstring changes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67660
diff
changeset
|
1399 that are not customizable options, as well as faces and groups |
acbc5122c634
(customize-apropos, customize-apropos-options): Docstring changes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67660
diff
changeset
|
1400 \(but we recommend using `apropos-variable' instead)." |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1401 (interactive (list (apropos-read-pattern "symbol") current-prefix-arg)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1402 (require 'apropos) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1403 (apropos-parse-pattern pattern) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1404 (let (found tests) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1405 (mapatoms |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1406 `(lambda (symbol) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1407 (when (string-match apropos-regexp (symbol-name symbol)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1408 ,(if (not (memq type '(faces options))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1409 '(if (get symbol 'custom-group) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1410 (push (list symbol 'custom-group) found))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1411 ,(if (not (memq type '(options groups))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1412 '(if (custom-facep symbol) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1413 (push (list symbol 'custom-face) found))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1414 ,(if (not (memq type '(groups faces))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1415 `(if (and (boundp symbol) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1416 (eq (indirect-variable symbol) symbol) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1417 (or (get symbol 'saved-value) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1418 (custom-variable-p symbol) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1419 ,(if (not (memq type '(nil options))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1420 '(get symbol 'variable-documentation)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1421 (push (list symbol 'custom-variable) found)))))) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1422 (if (not found) |
82244
9928f84fd32b
(customize-apropos): Make the error message indicate what kind of
Glenn Morris <rgm@gnu.org>
parents:
82225
diff
changeset
|
1423 (error "No %s matching %s" |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1424 (if (eq type t) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1425 "items" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1426 (format "customizable %s" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1427 (if (memq type '(options faces groups)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1428 (symbol-name type) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1429 "items"))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1430 pattern) |
71438
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
1431 (custom-buffer-create |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
1432 (custom-sort-items found t custom-buffer-order-groups) |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
1433 "*Customize Apropos*")))) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1434 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1435 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1436 (defun customize-apropos-options (regexp &optional arg) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1437 "Customize all loaded customizable options matching REGEXP. |
99298
225286546090
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
98001
diff
changeset
|
1438 With prefix ARG, include variables that are not customizable options |
79655
4feb30a8db36
(custom-add-parent-links): Fill the "Parent documentation" text.
Richard M. Stallman <rms@gnu.org>
parents:
79190
diff
changeset
|
1439 \(but it is better to use `apropos-variable' if you want to find those)." |
78394
ec3c22479e73
(customize-apropos, customize-apropos-options)
Richard M. Stallman <rms@gnu.org>
parents:
78377
diff
changeset
|
1440 (interactive "sCustomize options (regexp): \nP") |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1441 (customize-apropos regexp (or arg 'options))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1442 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1443 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1444 (defun customize-apropos-faces (regexp) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1445 "Customize all loaded faces matching REGEXP." |
78394
ec3c22479e73
(customize-apropos, customize-apropos-options)
Richard M. Stallman <rms@gnu.org>
parents:
78377
diff
changeset
|
1446 (interactive "sCustomize faces (regexp): \n") |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1447 (customize-apropos regexp 'faces)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1448 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1449 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1450 (defun customize-apropos-groups (regexp) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1451 "Customize all loaded groups matching REGEXP." |
78394
ec3c22479e73
(customize-apropos, customize-apropos-options)
Richard M. Stallman <rms@gnu.org>
parents:
78377
diff
changeset
|
1452 (interactive "sCustomize groups (regexp): \n") |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1453 (customize-apropos regexp 'groups)) |
17334 | 1454 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1455 ;;; Buffer. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1456 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1457 (defcustom custom-buffer-style 'links |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1458 "Control the presentation style for customization buffers. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1459 The value should be a symbol, one of: |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1460 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1461 brackets: groups nest within each other with big horizontal brackets. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1462 links: groups have links to subgroups." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1463 :type '(radio (const brackets) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1464 (const links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1465 :group 'custom-buffer) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1466 |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1467 (defcustom custom-buffer-done-kill nil |
99298
225286546090
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
98001
diff
changeset
|
1468 "Non-nil means exiting a Custom buffer should kill it." |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1469 :type 'boolean |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59795
diff
changeset
|
1470 :version "22.1" |
25685 | 1471 :group 'custom-buffer) |
1472 | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1473 (defcustom custom-buffer-indent 3 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1474 "Number of spaces to indent nested groups." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1475 :type 'integer |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1476 :group 'custom-buffer) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1477 |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1478 (defun custom-get-fresh-buffer (name) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1479 "Get a fresh new buffer with name NAME. |
51381
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1480 If the buffer already exist, clean it up to be like new. |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1481 Beware: it's not quite like new. Good enough for custom, but maybe |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1482 not for everybody." |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1483 ;; To be more complete, we should also kill all permanent-local variables, |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1484 ;; but it's not needed for custom. |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1485 (let ((buf (get-buffer name))) |
51429
b107764e9a67
(custom-get-fresh-buffer): Test for nonexistence buffer.
Lute Kamstra <lute@gnu.org>
parents:
51381
diff
changeset
|
1486 (when (and buf (buffer-local-value 'buffer-file-name buf)) |
51381
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1487 ;; This will check if the file is not saved. |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1488 (kill-buffer buf) |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1489 (setq buf nil)) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1490 (if (null buf) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1491 (get-buffer-create name) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1492 (with-current-buffer buf |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1493 (kill-all-local-variables) |
51381
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1494 (run-hooks 'kill-buffer-hook) |
51561
bed114065e35
(custom-get-fresh-buffer): Kill overlays before erasing the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51429
diff
changeset
|
1495 ;; Delete overlays before erasing the buffer so the overlay hooks |
bed114065e35
(custom-get-fresh-buffer): Kill overlays before erasing the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51429
diff
changeset
|
1496 ;; don't get run spuriously when we erase the buffer. |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1497 (let ((ols (overlay-lists))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1498 (dolist (ol (nconc (car ols) (cdr ols))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1499 (delete-overlay ol))) |
51561
bed114065e35
(custom-get-fresh-buffer): Kill overlays before erasing the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51429
diff
changeset
|
1500 (erase-buffer) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1501 buf)))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1502 |
17334 | 1503 ;;;###autoload |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1504 (defun custom-buffer-create (options &optional name description) |
17334 | 1505 "Create a buffer containing OPTIONS. |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1506 Optional NAME is the name of the buffer. |
17334 | 1507 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
1508 SYMBOL is a customization option, and WIDGET is a widget for editing | |
1509 that option." | |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1510 (pop-to-buffer (custom-get-fresh-buffer (or name "*Customization*"))) |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1511 (custom-buffer-create-internal options description)) |
17415 | 1512 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1513 ;;;###autoload |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1514 (defun custom-buffer-create-other-window (options &optional name description) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1515 "Create a buffer containing OPTIONS, and display it in another window. |
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1516 The result includes selecting that window. |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1517 Optional NAME is the name of the buffer. |
17415 | 1518 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
1519 SYMBOL is a customization option, and WIDGET is a widget for editing | |
1520 that option." | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1521 (unless name (setq name "*Customization*")) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1522 (let ((pop-up-windows t) |
22332
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
1523 (same-window-buffer-names nil) |
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
1524 (same-window-regexps nil)) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1525 (pop-to-buffer (custom-get-fresh-buffer name)) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1526 (custom-buffer-create-internal options description))) |
18089 | 1527 |
1528 (defcustom custom-reset-button-menu nil | |
1529 "If non-nil, only show a single reset button in customize buffers. | |
1530 This button will have a menu with all three reset operations." | |
1531 :type 'boolean | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1532 :group 'custom-buffer) |
17415 | 1533 |
45102
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1534 (defcustom custom-buffer-verbose-help t |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1535 "If non-nil, include explanatory text in the customization buffer." |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1536 :type 'boolean |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1537 :group 'custom-buffer) |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1538 |
25685 | 1539 (defun Custom-buffer-done (&rest ignore) |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1540 "Exit current Custom buffer according to `custom-buffer-done-kill'." |
25685 | 1541 (interactive) |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1542 (quit-window custom-buffer-done-kill)) |
25685 | 1543 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1544 (defvar custom-button nil |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1545 "Face used for buttons in customization buffers.") |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1546 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1547 (defvar custom-button-mouse nil |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1548 "Mouse face used for buttons in customization buffers.") |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1549 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1550 (defvar custom-button-pressed nil |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1551 "Face used for pressed buttons in customization buffers.") |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1552 |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1553 (defcustom custom-search-field t |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1554 "If non-nil, show a search field in Custom buffers." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1555 :type 'boolean |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1556 :version "24.1" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1557 :group 'custom-buffer) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1558 |
25685 | 1559 (defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box) |
1560 '(("unspecified" . unspecified)))) | |
1561 "If non-nil, indicate active buttons in a `raised-button' style. | |
1562 Otherwise use brackets." | |
1563 :type 'boolean | |
1564 :version "21.1" | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1565 :group 'custom-buffer |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1566 :set (lambda (variable value) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1567 (custom-set-default variable value) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1568 (setq custom-button |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1569 (if value 'custom-button 'custom-button-unraised)) |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1570 (setq custom-button-mouse |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1571 (if value 'custom-button-mouse 'highlight)) |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1572 (setq custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1573 (if value |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1574 'custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1575 'custom-button-pressed-unraised)))) |
25685 | 1576 |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1577 (defun custom-buffer-create-internal (options &optional description) |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
1578 (Custom-mode) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1579 (let ((init-file (or custom-file user-init-file))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1580 ;; Insert verbose help at the top of the custom buffer. |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1581 (when custom-buffer-verbose-help |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1582 (widget-insert (if init-file |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1583 "To apply changes, use the Save or Set buttons." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1584 "Custom settings cannot be saved; maybe you started Emacs with `-q'.") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1585 "\nFor details, see ") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1586 (widget-create 'custom-manual |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1587 :tag "Saving Customizations" |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1588 "(emacs)Saving Customizations") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1589 (widget-insert " in the ") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1590 (widget-create 'custom-manual |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1591 :tag "Emacs manual" |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1592 :help-echo "Read the Emacs manual." |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1593 "(emacs)Top") |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1594 (widget-insert ".")) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1595 (widget-insert "\n") |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1596 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1597 ;; Insert the search field. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1598 (when custom-search-field |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1599 (widget-insert "\n") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1600 (let* ((echo "Search for custom items") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1601 (search-widget |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1602 (widget-create |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1603 'editable-field |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1604 :size 40 :help-echo echo |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1605 :action `(lambda (widget &optional event) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1606 (customize-apropos (widget-value widget)))))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1607 (widget-insert " ") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1608 (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1609 search-widget 'push-button |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1610 :tag "Search" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1611 :help-echo echo :action |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1612 (lambda (widget &optional event) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1613 (customize-apropos (widget-value (widget-get widget :parent))))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1614 (widget-insert "\n"))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1615 |
99634
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1616 ;; The custom command buttons are also in the toolbar, so for a |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1617 ;; time they were not inserted in the buffer if the toolbar was in use. |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1618 ;; But it can be a little confusing for the buffer layout to |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1619 ;; change according to whether or nor the toolbar is on, not to |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1620 ;; mention that a custom buffer can in theory be created in a |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1621 ;; frame with a toolbar, then later viewed in one without. |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1622 ;; So now the buttons are always inserted in the buffer. (Bug#1326) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1623 (if custom-buffer-verbose-help |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1624 (widget-insert " |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
1625 Operate on all settings in this buffer:\n")) |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
1626 (let ((button (lambda (tag action active help icon label) |
99634
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1627 (widget-insert " ") |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1628 (if (eval active) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1629 (widget-create 'push-button :tag tag |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1630 :help-echo help :action action)))) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1631 (commands custom-commands)) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1632 (apply button (pop commands)) ; Set for current session |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1633 (apply button (pop commands)) ; Save for future sessions |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1634 (if custom-reset-button-menu |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1635 (progn |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1636 (widget-insert " ") |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1637 (widget-create 'push-button |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1638 :tag "Reset buffer" |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1639 :help-echo "Show a menu with reset operations." |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1640 :mouse-down-action 'ignore |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1641 :action 'custom-reset)) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1642 (widget-insert "\n") |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1643 (apply button (pop commands)) ; Undo edits |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1644 (apply button (pop commands)) ; Reset to saved |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1645 (apply button (pop commands)) ; Erase customization |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1646 (widget-insert " ") |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1647 (pop commands) ; Help (omitted) |
4aa56c6b5ac5
(custom-buffer-create-internal): Always insert the
Glenn Morris <rgm@gnu.org>
parents:
99481
diff
changeset
|
1648 (apply button (pop commands)))) ; Exit |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1649 (widget-insert "\n\n")) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1650 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
1651 ;; Now populate the custom buffer. |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1652 (message "Creating customization items...") |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1653 (buffer-disable-undo) |
25685 | 1654 (setq custom-options |
17334 | 1655 (if (= (length options) 1) |
1656 (mapcar (lambda (entry) | |
1657 (widget-create (nth 1 entry) | |
18139
ee3c0d09dcd3
Synched with 1.9908.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18131
diff
changeset
|
1658 :documentation-shown t |
17334 | 1659 :custom-state 'unknown |
1660 :tag (custom-unlispify-tag-name | |
1661 (nth 0 entry)) | |
1662 :value (nth 0 entry))) | |
1663 options) | |
1664 (let ((count 0) | |
1665 (length (length options))) | |
1666 (mapcar (lambda (entry) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1667 (prog2 |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1668 (message "Creating customization items ...%2d%%" |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1669 (/ (* 100.0 count) length)) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1670 (widget-create (nth 1 entry) |
17334 | 1671 :tag (custom-unlispify-tag-name |
1672 (nth 0 entry)) | |
1673 :value (nth 0 entry)) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1674 (setq count (1+ count)) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1675 (unless (eq (preceding-char) ?\n) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1676 (widget-insert "\n")) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1677 (widget-insert "\n"))) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1678 options)))) |
17334 | 1679 (unless (eq (preceding-char) ?\n) |
1680 (widget-insert "\n")) | |
39153
001cb5cd0de9
(custom-buffer-create-internal): Remove "100%" from
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
1681 (message "Creating customization items ...done") |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1682 (message "Resetting customization items...") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1683 (unless (eq custom-buffer-style 'tree) |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1684 (mapc 'custom-magic-reset custom-options)) |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1685 (message "Resetting customization items...done") |
17334 | 1686 (message "Creating customization setup...") |
1687 (widget-setup) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1688 (buffer-enable-undo) |
17334 | 1689 (goto-char (point-min)) |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1690 (message "Creating customization setup...done")) |
17334 | 1691 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1692 ;;; The Tree Browser. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1693 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1694 ;;;###autoload |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1695 (defun customize-browse (&optional group) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1696 "Create a tree browser for the customize hierarchy." |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
1697 (interactive) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1698 (unless group |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1699 (setq group 'emacs)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1700 (let ((name "*Customize Browser*")) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1701 (pop-to-buffer (custom-get-fresh-buffer name))) |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
1702 (Custom-mode) |
67745
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1703 (widget-insert (format "\ |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1704 %s buttons; type RET or click mouse-1 |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1705 on a button to invoke its action. |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1706 Invoke [+] to expand a group, and [-] to collapse an expanded group.\n" |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1707 (if custom-raised-buttons |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1708 "`Raised' text indicates" |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1709 "Square brackets indicate"))) |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1710 |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1711 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1712 (if custom-browse-only-groups |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1713 (widget-insert "\ |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1714 Invoke the [Group] button below to edit that item in another window.\n\n") |
25685 | 1715 (widget-insert "Invoke the ") |
1716 (widget-create 'item | |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1717 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1718 :tag "[Group]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1719 :tag-glyph "folder") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1720 (widget-insert ", ") |
25685 | 1721 (widget-create 'item |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1722 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1723 :tag "[Face]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1724 :tag-glyph "face") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1725 (widget-insert ", and ") |
25685 | 1726 (widget-create 'item |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1727 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1728 :tag "[Option]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1729 :tag-glyph "option") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1730 (widget-insert " buttons below to edit that |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1731 item in another window.\n\n")) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1732 (let ((custom-buffer-style 'tree)) |
25685 | 1733 (widget-create 'custom-group |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1734 :custom-last t |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1735 :custom-state 'unknown |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1736 :tag (custom-unlispify-tag-name group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1737 :value group)) |
48997
eb9dca992edf
(customize-browse): Call `widget-setup'.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48975
diff
changeset
|
1738 (widget-setup) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1739 (goto-char (point-min))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1740 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1741 (define-widget 'custom-browse-visibility 'item |
20600
323f33e3e92c
(custom-browse-visibility): Doc fix.
Andreas Schwab <schwab@suse.de>
parents:
20562
diff
changeset
|
1742 "Control visibility of items in the customize tree browser." |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1743 :format "%[[%t]%]" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1744 :action 'custom-browse-visibility-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1745 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1746 (defun custom-browse-visibility-action (widget &rest ignore) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1747 (let ((custom-buffer-style 'tree)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1748 (custom-toggle-parent widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1749 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1750 (define-widget 'custom-browse-group-tag 'custom-group-link |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1751 "Show parent in other window when activated." |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
1752 :tag "Group" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1753 :tag-glyph "folder" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1754 :action 'custom-browse-group-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1755 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1756 (defun custom-browse-group-tag-action (widget &rest ignore) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1757 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1758 (customize-group-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1759 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1760 (define-widget 'custom-browse-variable-tag 'custom-group-link |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1761 "Show parent in other window when activated." |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
1762 :tag "Option" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1763 :tag-glyph "option" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1764 :action 'custom-browse-variable-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1765 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1766 (defun custom-browse-variable-tag-action (widget &rest ignore) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1767 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1768 (customize-variable-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1769 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1770 (define-widget 'custom-browse-face-tag 'custom-group-link |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1771 "Show parent in other window when activated." |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
1772 :tag "Face" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1773 :tag-glyph "face" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1774 :action 'custom-browse-face-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1775 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1776 (defun custom-browse-face-tag-action (widget &rest ignore) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1777 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1778 (customize-face-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1779 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1780 (defconst custom-browse-alist '((" " "space") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1781 (" | " "vertical") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1782 ("-\\ " "top") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1783 (" |-" "middle") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1784 (" `-" "bottom"))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1785 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1786 (defun custom-browse-insert-prefix (prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1787 "Insert PREFIX. On XEmacs convert it to line graphics." |
25685 | 1788 ;; Fixme: do graphics. |
85724
c717580e7817
* cus-edit.el (custom-browse-insert-prefix):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85710
diff
changeset
|
1789 (if nil ; (featurep 'xemacs) |
25685 | 1790 (progn |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1791 (insert "*") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1792 (while (not (string-equal prefix "")) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1793 (let ((entry (substring prefix 0 3))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1794 (setq prefix (substring prefix 3)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1795 (let ((overlay (make-overlay (1- (point)) (point) nil t nil)) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1796 (name (nth 1 (assoc entry custom-browse-alist)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1797 (overlay-put overlay 'end-glyph (widget-glyph-find name entry)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1798 (overlay-put overlay 'start-open t) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1799 (overlay-put overlay 'end-open t))))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1800 (insert prefix))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1801 |
17334 | 1802 ;;; Modification of Basic Widgets. |
1803 ;; | |
1804 ;; We add extra properties to the basic widgets needed here. This is | |
94463 | 1805 ;; fine, as long as we are careful to stay within our own namespace. |
17334 | 1806 ;; |
1807 ;; We want simple widgets to be displayed by default, but complex | |
1808 ;; widgets to be hidden. | |
1809 | |
1810 (widget-put (get 'item 'widget-type) :custom-show t) | |
1811 (widget-put (get 'editable-field 'widget-type) | |
1812 :custom-show (lambda (widget value) | |
1813 (let ((pp (pp-to-string value))) | |
1814 (cond ((string-match "\n" pp) | |
1815 nil) | |
1816 ((> (length pp) 40) | |
1817 nil) | |
1818 (t t))))) | |
1819 (widget-put (get 'menu-choice 'widget-type) :custom-show t) | |
1820 | |
1821 ;;; The `custom-manual' Widget. | |
1822 | |
1823 (define-widget 'custom-manual 'info-link | |
1824 "Link to the manual entry for this customization option." | |
1825 :help-echo "Read the manual entry for this option." | |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
1826 :keymap custom-mode-link-map |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
1827 :follow-link 'mouse-face |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
1828 :button-face 'custom-link |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
1829 :mouse-face 'highlight |
68892
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
1830 :pressed-face 'highlight |
17334 | 1831 :tag "Manual") |
1832 | |
1833 ;;; The `custom-magic' Widget. | |
1834 | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1835 (defgroup custom-magic-faces nil |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1836 "Faces used by the magic button." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1837 :group 'custom-faces |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1838 :group 'custom-buffer) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1839 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1840 (defface custom-invalid '((((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1841 (:foreground "yellow1" :background "red1")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1842 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1843 (:weight bold :slant italic :underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1844 "Face used when the customize item is invalid." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1845 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1846 (define-obsolete-face-alias 'custom-invalid-face 'custom-invalid "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1847 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1848 (defface custom-rogue '((((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1849 (:foreground "pink" :background "black")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1850 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1851 (:underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1852 "Face used when the customize item is not defined for customization." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1853 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1854 (define-obsolete-face-alias 'custom-rogue-face 'custom-rogue "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1855 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1856 (defface custom-modified '((((min-colors 88) (class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1857 (:foreground "white" :background "blue1")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1858 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1859 (:foreground "white" :background "blue")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1860 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1861 (:slant italic :bold))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1862 "Face used when the customize item has been modified." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1863 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1864 (define-obsolete-face-alias 'custom-modified-face 'custom-modified "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1865 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1866 (defface custom-set '((((min-colors 88) (class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1867 (:foreground "blue1" :background "white")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1868 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1869 (:foreground "blue" :background "white")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1870 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1871 (:slant italic))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1872 "Face used when the customize item has been set." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1873 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1874 (define-obsolete-face-alias 'custom-set-face 'custom-set "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1875 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1876 (defface custom-changed '((((min-colors 88) (class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1877 (:foreground "white" :background "blue1")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1878 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1879 (:foreground "white" :background "blue")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1880 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1881 (:slant italic))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1882 "Face used when the customize item has been changed." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1883 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1884 (define-obsolete-face-alias 'custom-changed-face 'custom-changed "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1885 |
67783
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1886 (defface custom-themed '((((min-colors 88) (class color)) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1887 (:foreground "white" :background "blue1")) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1888 (((class color)) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1889 (:foreground "white" :background "blue")) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1890 (t |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1891 (:slant italic))) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1892 "Face used when the customize item has been set by a theme." |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1893 :group 'custom-magic-faces) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1894 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1895 (defface custom-saved '((t (:underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1896 "Face used when the customize item has been saved." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1897 :group 'custom-magic-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
1898 (define-obsolete-face-alias 'custom-saved-face 'custom-saved "22.1") |
17334 | 1899 |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1900 (defconst custom-magic-alist |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1901 '((nil "#" underline "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1902 UNINITIALIZED, you should not see this.") |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1903 (unknown "?" italic "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1904 UNKNOWN, you should not see this.") |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1905 (hidden "-" default "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1906 HIDDEN, invoke \"Show\" in the previous line to show." "\ |
18362
4655515f51cc
(custom-magic-alist) <hidden>: Don't refer to "dots".
Richard M. Stallman <rms@gnu.org>
parents:
18360
diff
changeset
|
1907 group now hidden, invoke \"Show\", above, to show contents.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1908 (invalid "x" custom-invalid "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1909 INVALID, the displayed value cannot be set.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1910 (modified "*" custom-modified "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1911 EDITED, shown value does not take effect until you set or save it." "\ |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1912 something in this group has been edited but not set.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1913 (set "+" custom-set "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1914 SET for current session only." "\ |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1915 something in this group has been set but not saved.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1916 (changed ":" custom-changed "\ |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
1917 CHANGED outside Customize." "\ |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1918 something in this group has been changed outside customize.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1919 (saved "!" custom-saved "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1920 SAVED and set." "\ |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1921 something in this group has been set and saved.") |
67783
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1922 (themed "o" custom-themed "\ |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1923 THEMED." "\ |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1924 visible group members are all at standard values.") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1925 (rogue "@" custom-rogue "\ |
67600
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
1926 NO CUSTOMIZATION DATA; not intended to be customized." "\ |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1927 something in this group is not prepared for customization.") |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1928 (standard " " nil "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1929 STANDARD." "\ |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
1930 visible group members are all at standard values.")) |
17334 | 1931 "Alist of customize option states. |
25685 | 1932 Each entry is of the form (STATE MAGIC FACE ITEM-DESC [ GROUP-DESC ]), where |
17334 | 1933 |
1934 STATE is one of the following symbols: | |
1935 | |
1936 `nil' | |
1937 For internal use, should never occur. | |
1938 `unknown' | |
1939 For internal use, should never occur. | |
1940 `hidden' | |
25685 | 1941 This item is not being displayed. |
17334 | 1942 `invalid' |
1943 This item is modified, but has an invalid form. | |
1944 `modified' | |
1945 This item is modified, and has a valid form. | |
1946 `set' | |
1947 This item has been set but not saved. | |
1948 `changed' | |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1949 The current value of this item has been changed outside Customize. |
17334 | 1950 `saved' |
1951 This item is marked for saving. | |
1952 `rogue' | |
1953 This item has no customization information. | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1954 `standard' |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1955 This item is unchanged from the standard setting. |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1956 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1957 MAGIC is a string used to present that state. |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1958 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1959 FACE is a face used to present the state. |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1960 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1961 ITEM-DESC is a string describing the state for options. |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1962 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1963 GROUP-DESC is a string describing the state for groups. If this is |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1964 left out, ITEM-DESC will be used. |
17334 | 1965 |
18089 | 1966 The string %c in either description will be replaced with the |
1967 category of the item. These are `group'. `option', and `face'. | |
1968 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1969 The list should be sorted most significant first.") |
17334 | 1970 |
1971 (defcustom custom-magic-show 'long | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1972 "If non-nil, show textual description of the state. |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1973 If `long', show a full-line description, not just one word." |
17334 | 1974 :type '(choice (const :tag "no" nil) |
22600
2f3b4c74e9a1
(custom-magic-show): Use `other' widget type.
Andreas Schwab <schwab@suse.de>
parents:
22538
diff
changeset
|
1975 (const long) |
2f3b4c74e9a1
(custom-magic-show): Use `other' widget type.
Andreas Schwab <schwab@suse.de>
parents:
22538
diff
changeset
|
1976 (other :tag "short" short)) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1977 :group 'custom-buffer) |
17334 | 1978 |
18089 | 1979 (defcustom custom-magic-show-hidden '(option face) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1980 "Control whether the State button is shown for hidden items. |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1981 The value should be a list with the custom categories where the State |
18089 | 1982 button should be visible. Possible categories are `group', `option', |
1983 and `face'." | |
1984 :type '(set (const group) (const option) (const face)) | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1985 :group 'custom-buffer) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1986 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1987 (defcustom custom-magic-show-button nil |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1988 "Show a \"magic\" button indicating the state of each customization option." |
17334 | 1989 :type 'boolean |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1990 :group 'custom-buffer) |
17334 | 1991 |
1992 (define-widget 'custom-magic 'default | |
1993 "Show and manipulate state for a customization option." | |
1994 :format "%v" | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1995 :action 'widget-parent-action |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1996 :notify 'ignore |
17334 | 1997 :value-get 'ignore |
1998 :value-create 'custom-magic-value-create | |
1999 :value-delete 'widget-children-value-delete) | |
2000 | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2001 (defun widget-magic-mouse-down-action (widget &optional event) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2002 ;; Non-nil unless hidden. |
25685 | 2003 (not (eq (widget-get (widget-get (widget-get widget :parent) :parent) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2004 :custom-state) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2005 'hidden))) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2006 |
17334 | 2007 (defun custom-magic-value-create (widget) |
28130 | 2008 "Create compact status report for WIDGET." |
17334 | 2009 (let* ((parent (widget-get widget :parent)) |
2010 (state (widget-get parent :custom-state)) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2011 (hidden (eq state 'hidden)) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2012 (entry (assq state custom-magic-alist)) |
17334 | 2013 (magic (nth 1 entry)) |
2014 (face (nth 2 entry)) | |
18089 | 2015 (category (widget-get parent :custom-category)) |
2016 (text (or (and (eq category 'group) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2017 (nth 4 entry)) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2018 (nth 3 entry))) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2019 (form (widget-get parent :custom-form)) |
17334 | 2020 children) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2021 (unless (eq state 'hidden) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2022 (while (string-match "\\`\\(.*\\)%c\\(.*\\)\\'" text) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2023 (setq text (concat (match-string 1 text) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2024 (symbol-name category) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2025 (match-string 2 text)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2026 (when (and custom-magic-show |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2027 (or (not hidden) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2028 (memq category custom-magic-show-hidden))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2029 (insert " ") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2030 (when (and (eq category 'group) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2031 (not (and (eq custom-buffer-style 'links) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2032 (> (widget-get parent :custom-level) 1)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2033 (insert-char ?\ (* custom-buffer-indent |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2034 (widget-get parent :custom-level)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2035 (push (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2036 widget 'choice-item |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2037 :help-echo "Change the state of this item." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2038 :format (if hidden "%t" "%[%t%]") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2039 :button-prefix 'widget-push-button-prefix |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2040 :button-suffix 'widget-push-button-suffix |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2041 :mouse-down-action 'widget-magic-mouse-down-action |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2042 :tag "State") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2043 children) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2044 (insert ": ") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2045 (let ((start (point))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2046 (if (eq custom-magic-show 'long) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2047 (insert text) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2048 (insert (symbol-name state))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2049 (cond ((eq form 'lisp) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2050 (insert " (lisp)")) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2051 ((eq form 'mismatch) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2052 (insert " (mismatch)"))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2053 (put-text-property start (point) 'face 'custom-state)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2054 (insert "\n")) |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
2055 (when (and (eq category 'group) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
2056 (not (and (eq custom-buffer-style 'links) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
2057 (> (widget-get parent :custom-level) 1)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2058 (insert-char ?\ (* custom-buffer-indent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2059 (widget-get parent :custom-level)))) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2060 (when custom-magic-show-button |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2061 (when custom-magic-show |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2062 (let ((indent (widget-get parent :indent))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2063 (when indent |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2064 (insert-char ? indent)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2065 (push (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2066 widget 'choice-item |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2067 :mouse-down-action 'widget-magic-mouse-down-action |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2068 :button-face face |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2069 :button-prefix "" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2070 :button-suffix "" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2071 :help-echo "Change the state." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2072 :format (if hidden "%t" "%[%t%]") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2073 :tag (if (memq form '(lisp mismatch)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2074 (concat "(" magic ")") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2075 (concat "[" magic "]"))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2076 children) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2077 (insert " ")) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2078 (widget-put widget :children children)))) |
17334 | 2079 |
2080 (defun custom-magic-reset (widget) | |
2081 "Redraw the :custom-magic property of WIDGET." | |
2082 (let ((magic (widget-get widget :custom-magic))) | |
2083 (widget-value-set magic (widget-value magic)))) | |
2084 | |
2085 ;;; The `custom' Widget. | |
2086 | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2087 (defface custom-button |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96675
diff
changeset
|
2088 '((((type x w32 ns) (class color)) ; Like default modeline |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31744
diff
changeset
|
2089 (:box (:line-width 2 :style released-button) |
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31744
diff
changeset
|
2090 :background "lightgrey" :foreground "black")) |
25685 | 2091 (t |
2092 nil)) | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2093 "Face for custom buffer buttons if `custom-raised-buttons' is non-nil." |
25685 | 2094 :version "21.1" |
2095 :group 'custom-faces) | |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2096 (define-obsolete-face-alias 'custom-button-face 'custom-button "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2097 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2098 (defface custom-button-mouse |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96675
diff
changeset
|
2099 '((((type x w32 ns) (class color)) |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2100 (:box (:line-width 2 :style released-button) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2101 :background "grey90" :foreground "black")) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2102 (t |
98001
c5c3ca209572
Move comment for last change to right place.
Eli Zaretskii <eliz@gnu.org>
parents:
97999
diff
changeset
|
2103 ;; This is for text terminals that support mouse, like GPM mouse |
c5c3ca209572
Move comment for last change to right place.
Eli Zaretskii <eliz@gnu.org>
parents:
97999
diff
changeset
|
2104 ;; or the MS-DOS terminal: inverse-video makes the button stand |
c5c3ca209572
Move comment for last change to right place.
Eli Zaretskii <eliz@gnu.org>
parents:
97999
diff
changeset
|
2105 ;; out on mouse-over. |
97999
8038a4df451c
(custom-button-pressed): Default to inverse-video.
Eli Zaretskii <eliz@gnu.org>
parents:
97546
diff
changeset
|
2106 (:inverse-video t))) |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2107 "Mouse face for custom buffer buttons if `custom-raised-buttons' is non-nil." |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2108 :version "22.1" |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2109 :group 'custom-faces) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2110 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2111 (defface custom-button-unraised |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2112 '((t :inherit underline)) |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2113 "Face for custom buffer buttons if `custom-raised-buttons' is nil." |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2114 :version "22.1" |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2115 :group 'custom-faces) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2116 |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2117 (setq custom-button |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2118 (if custom-raised-buttons 'custom-button 'custom-button-unraised)) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2119 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2120 (setq custom-button-mouse |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2121 (if custom-raised-buttons 'custom-button-mouse 'highlight)) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2122 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2123 (defface custom-button-pressed |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96675
diff
changeset
|
2124 '((((type x w32 ns) (class color)) |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31744
diff
changeset
|
2125 (:box (:line-width 2 :style pressed-button) |
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31744
diff
changeset
|
2126 :background "lightgrey" :foreground "black")) |
25685 | 2127 (t |
2128 (:inverse-video t))) | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2129 "Face for pressed custom buttons if `custom-raised-buttons' is non-nil." |
25685 | 2130 :version "21.1" |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2131 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2132 (define-obsolete-face-alias 'custom-button-pressed-face |
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2133 'custom-button-pressed "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2134 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2135 (defface custom-button-pressed-unraised |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2136 '((default :inherit custom-button-unraised) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2137 (((class color) (background light)) :foreground "magenta4") |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2138 (((class color) (background dark)) :foreground "violet")) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2139 "Face for pressed custom buttons if `custom-raised-buttons' is nil." |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2140 :version "22.1" |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2141 :group 'custom-faces) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2142 |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2143 (setq custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2144 (if custom-raised-buttons |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2145 'custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2146 'custom-button-pressed-unraised)) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2147 |
70179
bdc0573597a9
(custom-documentation): Avoid nil spec in defface.
Luc Teirlinck <teirllm@auburn.edu>
parents:
70021
diff
changeset
|
2148 (defface custom-documentation '((t nil)) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2149 "Face used for documentation strings in customization buffers." |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2150 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2151 (define-obsolete-face-alias 'custom-documentation-face |
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2152 'custom-documentation "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2153 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2154 (defface custom-state '((((class color) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2155 (background dark)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2156 (:foreground "lime green")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2157 (((class color) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2158 (background light)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2159 (:foreground "dark green")) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2160 (t nil)) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2161 "Face used for State descriptions in the customize buffer." |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2162 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2163 (define-obsolete-face-alias 'custom-state-face 'custom-state "22.1") |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2164 |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
2165 (defface custom-link |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2166 '((t :inherit link)) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2167 "Face for links in customization buffers." |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2168 :version "22.1" |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2169 :group 'custom-faces) |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
2170 |
17334 | 2171 (define-widget 'custom 'default |
2172 "Customize a user option." | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2173 :format "%v" |
17334 | 2174 :convert-widget 'custom-convert-widget |
2175 :notify 'custom-notify | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2176 :custom-prefix "" |
17334 | 2177 :custom-level 1 |
2178 :custom-state 'hidden | |
2179 :documentation-property 'widget-subclass-responsibility | |
2180 :value-create 'widget-subclass-responsibility | |
2181 :value-delete 'widget-children-value-delete | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2182 :value-get 'widget-value-value-get |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2183 :validate 'widget-children-validate |
17334 | 2184 :match (lambda (widget value) (symbolp value))) |
2185 | |
2186 (defun custom-convert-widget (widget) | |
28130 | 2187 "Initialize :value and :tag from :args in WIDGET." |
17334 | 2188 (let ((args (widget-get widget :args))) |
25685 | 2189 (when args |
17334 | 2190 (widget-put widget :value (widget-apply widget |
2191 :value-to-internal (car args))) | |
2192 (widget-put widget :tag (custom-unlispify-tag-name (car args))) | |
2193 (widget-put widget :args nil))) | |
2194 widget) | |
2195 | |
2196 (defun custom-notify (widget &rest args) | |
2197 "Keep track of changes." | |
18090 | 2198 (let ((state (widget-get widget :custom-state))) |
2199 (unless (eq state 'modified) | |
2200 (unless (memq state '(nil unknown hidden)) | |
2201 (widget-put widget :custom-state 'modified)) | |
2202 (custom-magic-reset widget) | |
2203 (apply 'widget-default-notify widget args)))) | |
17334 | 2204 |
2205 (defun custom-redraw (widget) | |
2206 "Redraw WIDGET with current settings." | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2207 (let ((line (count-lines (point-min) (point))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2208 (column (current-column)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2209 (pos (point)) |
17334 | 2210 (from (marker-position (widget-get widget :from))) |
2211 (to (marker-position (widget-get widget :to)))) | |
2212 (save-excursion | |
2213 (widget-value-set widget (widget-value widget)) | |
2214 (custom-redraw-magic widget)) | |
2215 (when (and (>= pos from) (<= pos to)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2216 (condition-case nil |
25685 | 2217 (progn |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103835
diff
changeset
|
2218 (goto-char (point-min)) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103835
diff
changeset
|
2219 (forward-line (if (> column 0) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103835
diff
changeset
|
2220 (1- line) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
103835
diff
changeset
|
2221 line)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2222 (move-to-column column)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2223 (error nil))))) |
17334 | 2224 |
2225 (defun custom-redraw-magic (widget) | |
2226 "Redraw WIDGET state with current settings." | |
25685 | 2227 (while widget |
17334 | 2228 (let ((magic (widget-get widget :custom-magic))) |
25685 | 2229 (cond (magic |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2230 (widget-value-set magic (widget-value magic)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2231 (when (setq widget (widget-get widget :group)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2232 (custom-group-state-update widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2233 (t |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2234 (setq widget nil))))) |
17334 | 2235 (widget-setup)) |
2236 | |
2237 (defun custom-show (widget value) | |
2238 "Non-nil if WIDGET should be shown with VALUE by default." | |
2239 (let ((show (widget-get widget :custom-show))) | |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2240 (if (functionp show) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2241 (funcall show widget value) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2242 show))) |
17334 | 2243 |
2244 (defun custom-load-widget (widget) | |
2245 "Load all dependencies for WIDGET." | |
2246 (custom-load-symbol (widget-value widget))) | |
2247 | |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2248 (defun custom-unloaded-symbol-p (symbol) |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
2249 "Return non-nil if the dependencies of SYMBOL have not yet been loaded." |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2250 (let ((found nil) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2251 (loads (get symbol 'custom-loads)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2252 load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2253 (while loads |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2254 (setq load (car loads) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2255 loads (cdr loads)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2256 (cond ((symbolp load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2257 (unless (featurep load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2258 (setq found t))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2259 ((assoc load load-history)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2260 ((assoc (locate-library load) load-history) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2261 (message nil)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2262 (t |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2263 (setq found t)))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2264 found)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2265 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2266 (defun custom-unloaded-widget-p (widget) |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
2267 "Return non-nil if the dependencies of WIDGET have not yet been loaded." |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2268 (custom-unloaded-symbol-p (widget-value widget))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2269 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2270 (defun custom-toggle-hide (widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2271 "Toggle visibility of WIDGET." |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2272 (custom-load-widget widget) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2273 (let ((state (widget-get widget :custom-state))) |
97546
57c9b0f7df3e
(custom-toggle-hide): Allow hiding only if widget is saved.
Chong Yidong <cyd@stupidchicken.com>
parents:
97242
diff
changeset
|
2274 (cond ((memq state '(invalid modified set)) |
57c9b0f7df3e
(custom-toggle-hide): Allow hiding only if widget is saved.
Chong Yidong <cyd@stupidchicken.com>
parents:
97242
diff
changeset
|
2275 (error "There are unsaved changes")) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2276 ((eq state 'hidden) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2277 (widget-put widget :custom-state 'unknown)) |
25685 | 2278 (t |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2279 (widget-put widget :documentation-shown nil) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2280 (widget-put widget :custom-state 'hidden))) |
18258
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2281 (custom-redraw widget) |
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2282 (widget-setup))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2283 |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2284 (defun custom-toggle-parent (widget &rest ignore) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2285 "Toggle visibility of parent of WIDGET." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2286 (custom-toggle-hide (widget-get widget :parent))) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2287 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2288 (defun custom-add-see-also (widget &optional prefix) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2289 "Add `See also ...' to WIDGET if there are any links. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2290 Insert PREFIX first if non-nil." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2291 (let* ((symbol (widget-get widget :value)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2292 (links (get symbol 'custom-links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2293 (many (> (length links) 2)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2294 (buttons (widget-get widget :buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2295 (indent (widget-get widget :indent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2296 (when links |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2297 (when indent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2298 (insert-char ?\ indent)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2299 (when prefix |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2300 (insert prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2301 (insert "See also ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2302 (while links |
68178
08dc54e52e8e
(custom-add-see-also, custom-add-parent-links): Make sure the links use
Eli Zaretskii <eliz@gnu.org>
parents:
68139
diff
changeset
|
2303 (push (widget-create-child-and-convert |
08dc54e52e8e
(custom-add-see-also, custom-add-parent-links): Make sure the links use
Eli Zaretskii <eliz@gnu.org>
parents:
68139
diff
changeset
|
2304 widget (car links) |
08dc54e52e8e
(custom-add-see-also, custom-add-parent-links): Make sure the links use
Eli Zaretskii <eliz@gnu.org>
parents:
68139
diff
changeset
|
2305 :button-face 'custom-link |
68892
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
2306 :mouse-face 'highlight |
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
2307 :pressed-face 'highlight) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2308 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2309 (setq links (cdr links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2310 (cond ((null links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2311 (insert ".\n")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2312 ((null (cdr links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2313 (if many |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2314 (insert ", and ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2315 (insert " and "))) |
25685 | 2316 (t |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2317 (insert ", ")))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2318 (widget-put widget :buttons buttons)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2319 |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2320 (defun custom-add-parent-links (widget &optional initial-string doc-initial-string) |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
2321 "Add \"Parent groups: ...\" to WIDGET if the group has parents. |
66904
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2322 The value is non-nil if any parents were found. |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
2323 If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2324 (let ((name (widget-value widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2325 (type (widget-type widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2326 (buttons (widget-get widget :buttons)) |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
2327 (start (point)) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2328 (parents nil)) |
79659
a4773f405434
(custom-add-parent-links): New arg DOC-INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
79655
diff
changeset
|
2329 (insert (or initial-string "Groups:")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2330 (mapatoms (lambda (symbol) |
66904
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2331 (when (member (list name type) (get symbol 'custom-group)) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2332 (insert " ") |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2333 (push (widget-create-child-and-convert |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2334 widget 'custom-group-link |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2335 :tag (custom-unlispify-tag-name symbol) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2336 symbol) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2337 buttons) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2338 (setq parents (cons symbol parents))))) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2339 (if parents |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2340 (insert "\n") |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2341 (delete-region start (point))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2342 (widget-put widget :buttons buttons) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2343 parents)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2344 |
25685 | 2345 ;;; The `custom-comment' Widget. |
2346 | |
2347 ;; like the editable field | |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2348 (defface custom-comment '((((type tty)) |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2349 :background "yellow3" |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2350 :foreground "black") |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2351 (((class grayscale color) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2352 (background light)) |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2353 :background "gray85") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2354 (((class grayscale color) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2355 (background dark)) |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2356 :background "dim gray") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2357 (t |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2358 :slant italic)) |
99298
225286546090
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
98001
diff
changeset
|
2359 "Face used for comments on variables or faces." |
25685 | 2360 :version "21.1" |
2361 :group 'custom-faces) | |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2362 (define-obsolete-face-alias 'custom-comment-face 'custom-comment "22.1") |
25685 | 2363 |
2364 ;; like font-lock-comment-face | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2365 (defface custom-comment-tag |
25685 | 2366 '((((class color) (background dark)) (:foreground "gray80")) |
2367 (((class color) (background light)) (:foreground "blue4")) | |
2368 (((class grayscale) (background light)) | |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2369 (:foreground "DimGray" :weight bold :slant italic)) |
25685 | 2370 (((class grayscale) (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2371 (:foreground "LightGray" :weight bold :slant italic)) |
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2372 (t (:weight bold))) |
99403
e0a169f45c0e
(custom-comment-tag): Doc fix.
Glenn Morris <rgm@gnu.org>
parents:
99298
diff
changeset
|
2373 "Face used for the comment tag on variables or faces." |
25685 | 2374 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2375 (define-obsolete-face-alias 'custom-comment-tag-face 'custom-comment-tag "22.1") |
25685 | 2376 |
2377 (define-widget 'custom-comment 'string | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2378 "User comment." |
25685 | 2379 :tag "Comment" |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2380 :help-echo "Edit a comment here." |
99403
e0a169f45c0e
(custom-comment-tag): Doc fix.
Glenn Morris <rgm@gnu.org>
parents:
99298
diff
changeset
|
2381 :sample-face 'custom-comment-tag |
e0a169f45c0e
(custom-comment-tag): Doc fix.
Glenn Morris <rgm@gnu.org>
parents:
99298
diff
changeset
|
2382 :value-face 'custom-comment |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2383 :shown nil |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2384 :create 'custom-comment-create) |
25685 | 2385 |
2386 (defun custom-comment-create (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2387 (let* ((null-comment (equal "" (widget-value widget)))) |
25847
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2388 (if (or (widget-get (widget-get widget :parent) :comment-shown) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2389 (not null-comment)) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2390 (widget-default-create widget) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2391 ;; `widget-default-delete' expects markers in these slots -- |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2392 ;; maybe it shouldn't. |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2393 (widget-put widget :from (point-marker)) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2394 (widget-put widget :to (point-marker))))) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2395 |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2396 (defun custom-comment-hide (widget) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2397 (widget-put (widget-get widget :parent) :comment-shown nil)) |
25685 | 2398 |
2399 ;; Those functions are for the menu. WIDGET is NOT the comment widget. It's | |
2400 ;; the global custom one | |
2401 (defun custom-comment-show (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2402 (widget-put widget :comment-shown t) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2403 (custom-redraw widget) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2404 (widget-setup)) |
25685 | 2405 |
2406 (defun custom-comment-invisible-p (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2407 (let ((val (widget-value (widget-get widget :comment-widget)))) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2408 (and (equal "" val) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2409 (not (widget-get widget :comment-shown))))) |
25685 | 2410 |
17334 | 2411 ;;; The `custom-variable' Widget. |
2412 | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2413 (defface custom-variable-tag |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2414 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2415 (background dark)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
2416 (:foreground "light blue" :weight bold)) |
61394
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
2417 (((min-colors 88) (class color) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
2418 (background light)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
2419 (:foreground "blue1" :weight bold)) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2420 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2421 (background light)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
2422 (:foreground "blue" :weight bold)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2423 (t (:weight bold))) |
17334 | 2424 "Face used for unpushable variable tags." |
17415 | 2425 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2426 (define-obsolete-face-alias 'custom-variable-tag-face |
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2427 'custom-variable-tag "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2428 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2429 (defface custom-variable-button '((t (:underline t :weight bold))) |
17334 | 2430 "Face used for pushable variable tags." |
17415 | 2431 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2432 (define-obsolete-face-alias 'custom-variable-button-face |
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
2433 'custom-variable-button "22.1") |
17334 | 2434 |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2435 (defcustom custom-variable-default-form 'edit |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2436 "Default form of displaying variable values." |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2437 :type '(choice (const edit) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2438 (const lisp)) |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
2439 :group 'custom-buffer |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
2440 :version "20.3") |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2441 |
56161
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2442 (defun custom-variable-documentation (variable) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2443 "Return documentation of VARIABLE for use in Custom buffer. |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2444 Normally just return the docstring. But if VARIABLE automatically |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2445 becomes buffer local when set, append a message to that effect." |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2446 (if (and (local-variable-if-set-p variable) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2447 (or (not (local-variable-p variable)) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2448 (with-temp-buffer |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2449 (local-variable-if-set-p variable)))) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2450 (concat (documentation-property variable 'variable-documentation) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2451 "\n |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2452 This variable automatically becomes buffer-local when set outside Custom. |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2453 However, setting it through Custom sets the default value.") |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2454 (documentation-property variable 'variable-documentation))) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2455 |
17334 | 2456 (define-widget 'custom-variable 'custom |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2457 "A widget for displaying a Custom variable. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2458 |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2459 The following properties have special meanings for this widget: |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2460 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2461 :hidden-states should be a list of widget states for which the |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2462 widget's initial contents are to be hidden. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2463 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2464 :custom-form should be a symbol describing how to display and |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2465 edit the variable---either `edit' (using edit widgets), |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2466 `lisp' (as a Lisp sexp), or `mismatch' (should not happen); |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2467 if nil, use the return value of `custom-variable-default-form'." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2468 :format "%v" |
17334 | 2469 :help-echo "Set or reset this variable." |
56161
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2470 :documentation-property #'custom-variable-documentation |
18089 | 2471 :custom-category 'option |
17334 | 2472 :custom-state nil |
2473 :custom-menu 'custom-variable-menu-create | |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
2474 :custom-form nil |
17334 | 2475 :value-create 'custom-variable-value-create |
2476 :action 'custom-variable-action | |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2477 :hidden-states '(standard) |
17334 | 2478 :custom-set 'custom-variable-set |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2479 :custom-mark-to-save 'custom-variable-mark-to-save |
17334 | 2480 :custom-reset-current 'custom-redraw |
2481 :custom-reset-saved 'custom-variable-reset-saved | |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2482 :custom-reset-standard 'custom-variable-reset-standard |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2483 :custom-mark-to-reset-standard 'custom-variable-mark-to-reset-standard |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2484 :custom-standard-value 'custom-variable-standard-value |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2485 :custom-state-set-and-redraw 'custom-variable-state-set-and-redraw) |
17334 | 2486 |
17415 | 2487 (defun custom-variable-type (symbol) |
2488 "Return a widget suitable for editing the value of SYMBOL. | |
25685 | 2489 If SYMBOL has a `custom-type' property, use that. |
77997
20578868cbb3
(custom-variable-type): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
77171
diff
changeset
|
2490 Otherwise, try matching SYMBOL against `custom-guess-name-alist' and |
20578868cbb3
(custom-variable-type): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
77171
diff
changeset
|
2491 try matching its doc string against `custom-guess-doc-alist'." |
17415 | 2492 (let* ((type (or (get symbol 'custom-type) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2493 (and (not (get symbol 'standard-value)) |
17415 | 2494 (custom-guess-type symbol)) |
2495 'sexp)) | |
2496 (options (get symbol 'custom-options)) | |
2497 (tmp (if (listp type) | |
17534
a5cf59eee84b
(custom-variable-type): Use copy-sequence, not copy-list.
Richard M. Stallman <rms@gnu.org>
parents:
17521
diff
changeset
|
2498 (copy-sequence type) |
17415 | 2499 (list type)))) |
2500 (when options | |
2501 (widget-put tmp :options options)) | |
2502 tmp)) | |
2503 | |
17334 | 2504 (defun custom-variable-value-create (widget) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2505 "Here is where you edit the variable's value." |
17334 | 2506 (custom-load-widget widget) |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2507 (unless (widget-get widget :custom-form) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2508 (widget-put widget :custom-form custom-variable-default-form)) |
17334 | 2509 (let* ((buttons (widget-get widget :buttons)) |
2510 (children (widget-get widget :children)) | |
2511 (form (widget-get widget :custom-form)) | |
2512 (symbol (widget-get widget :value)) | |
2513 (tag (widget-get widget :tag)) | |
17415 | 2514 (type (custom-variable-type symbol)) |
17334 | 2515 (conv (widget-convert type)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2516 (get (or (get symbol 'custom-get) 'default-value)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2517 (prefix (widget-get widget :custom-prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2518 (last (widget-get widget :custom-last)) |
17334 | 2519 (value (if (default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2520 (funcall get symbol) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2521 (widget-get conv :value))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2522 (state (or (widget-get widget :custom-state) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2523 (if (memq (custom-variable-state symbol value) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2524 (widget-get widget :hidden-states)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2525 'hidden)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2526 |
17334 | 2527 ;; If we don't know the state, see if we need to edit it in lisp form. |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2528 (unless state |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2529 (setq state (if (custom-show type value) 'unknown 'hidden))) |
17334 | 2530 (when (eq state 'unknown) |
2531 (unless (widget-apply conv :match value) | |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2532 (setq form 'mismatch))) |
17334 | 2533 ;; Now we can create the child widget. |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2534 (cond ((eq custom-buffer-style 'tree) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
2535 (insert prefix (if last " `--- " " |--- ")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2536 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2537 widget 'custom-browse-variable-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2538 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2539 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2540 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2541 ((eq state 'hidden) |
17334 | 2542 ;; Indicate hidden value. |
25685 | 2543 (push (widget-create-child-and-convert |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2544 widget 'custom-visibility |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2545 :help-echo "Show the value of this option." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2546 :on-image "down" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2547 :on "Hide" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2548 :off-image "right" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2549 :off "Show Value" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2550 :action 'custom-toggle-parent |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2551 nil) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2552 buttons) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2553 (insert " ") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2554 (push (widget-create-child-and-convert |
17334 | 2555 widget 'item |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2556 :format "%{%t%} " |
99404
16c6946eeb2e
(custom-variable-value-create, custom-face):
Glenn Morris <rgm@gnu.org>
parents:
99403
diff
changeset
|
2557 :sample-face 'custom-variable-tag |
17334 | 2558 :tag tag |
2559 :parent widget) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2560 buttons)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2561 ((memq form '(lisp mismatch)) |
17334 | 2562 ;; In lisp mode edit the saved value when possible. |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2563 (push (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2564 widget 'custom-visibility |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2565 :help-echo "Hide the value of this option." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2566 :on "Hide" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2567 :off "Show" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2568 :on-image "down" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2569 :off-image "right" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2570 :action 'custom-toggle-parent |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2571 t) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2572 buttons) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2573 (insert " ") |
17334 | 2574 (let* ((value (cond ((get symbol 'saved-value) |
2575 (car (get symbol 'saved-value))) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2576 ((get symbol 'standard-value) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2577 (car (get symbol 'standard-value))) |
17334 | 2578 ((default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2579 (custom-quote (funcall get symbol))) |
17334 | 2580 (t |
2581 (custom-quote (widget-get conv :value)))))) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2582 (insert (symbol-name symbol) ": ") |
25685 | 2583 (push (widget-create-child-and-convert |
2584 widget 'sexp | |
17334 | 2585 :button-face 'custom-variable-button-face |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2586 :format "%v" |
17334 | 2587 :tag (symbol-name symbol) |
2588 :parent widget | |
2589 :value value) | |
2590 children))) | |
2591 (t | |
2592 ;; Edit mode. | |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2593 (push (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2594 widget 'custom-visibility |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2595 :help-echo "Hide or show this option." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2596 :on "Hide" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2597 :off "Show" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2598 :on-image "down" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2599 :off-image "right" |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2600 :action 'custom-toggle-parent |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2601 t) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2602 buttons) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2603 (insert " ") |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2604 (let* ((format (widget-get type :format)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2605 tag-format value-format) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2606 (unless (string-match ":" format) |
19883
519eab181c36
(custom-face-menu): Use custom-face-save-command. not custom-face-save.
Richard M. Stallman <rms@gnu.org>
parents:
19823
diff
changeset
|
2607 (error "Bad format")) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2608 (setq tag-format (substring format 0 (match-end 0))) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2609 (setq value-format (substring format (match-end 0))) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2610 (push (widget-create-child-and-convert |
25685 | 2611 widget 'item |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2612 :format tag-format |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2613 :action 'custom-tag-action |
18258
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2614 :help-echo "Change value of this option." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2615 :mouse-down-action 'custom-tag-mouse-down-action |
99404
16c6946eeb2e
(custom-variable-value-create, custom-face):
Glenn Morris <rgm@gnu.org>
parents:
99403
diff
changeset
|
2616 :button-face 'custom-variable-button |
16c6946eeb2e
(custom-variable-value-create, custom-face):
Glenn Morris <rgm@gnu.org>
parents:
99403
diff
changeset
|
2617 :sample-face 'custom-variable-tag |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2618 tag) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2619 buttons) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2620 (push (widget-create-child-and-convert |
25685 | 2621 widget type |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2622 :format value-format |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2623 :value value) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2624 children)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2625 (unless (eq custom-buffer-style 'tree) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2626 (unless (eq (preceding-char) ?\n) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2627 (widget-insert "\n")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2628 ;; Create the magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2629 (let ((magic (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2630 widget 'custom-magic nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2631 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2632 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2633 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2634 ;; Insert documentation. |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
2635 (widget-put widget :documentation-indent 3) |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
2636 (widget-add-documentation-string-button |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
2637 widget :visibility-widget 'custom-visibility) |
25685 | 2638 |
2639 ;; The comment field | |
2640 (unless (eq state 'hidden) | |
2641 (let* ((comment (get symbol 'variable-comment)) | |
2642 (comment-widget | |
2643 (widget-create-child-and-convert | |
2644 widget 'custom-comment | |
2645 :parent widget | |
2646 :value (or comment "")))) | |
2647 (widget-put widget :comment-widget comment-widget) | |
2648 ;; Don't push it !!! Custom assumes that the first child is the | |
2649 ;; value one. | |
2650 (setq children (append children (list comment-widget))))) | |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2651 ;; Update the rest of the properties. |
25685 | 2652 (widget-put widget :custom-form form) |
2653 (widget-put widget :children children) | |
2654 ;; Now update the state. | |
2655 (if (eq state 'hidden) | |
2656 (widget-put widget :custom-state state) | |
2657 (custom-variable-state-set widget)) | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2658 ;; See also. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2659 (unless (eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2660 (when (eq (widget-get widget :custom-level) 1) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2661 (custom-add-parent-links widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2662 (custom-add-see-also widget))))) |
17334 | 2663 |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2664 (defun custom-tag-action (widget &rest args) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2665 "Pass :action to first child of WIDGET's parent." |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2666 (apply 'widget-apply (car (widget-get (widget-get widget :parent) :children)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2667 :action args)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2668 |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2669 (defun custom-tag-mouse-down-action (widget &rest args) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2670 "Pass :mouse-down-action to first child of WIDGET's parent." |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2671 (apply 'widget-apply (car (widget-get (widget-get widget :parent) :children)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2672 :mouse-down-action args)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2673 |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2674 (defun custom-variable-state (symbol val) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2675 "Return the state of SYMBOL if its value is VAL. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2676 If SYMBOL has a non-nil `custom-get' property, it overrides VAL. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2677 Possible return values are `standard', `saved', `set', `themed', |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2678 `changed', and `rogue'." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2679 (let* ((get (or (get symbol 'custom-get) 'default-value)) |
17334 | 2680 (value (if (default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2681 (funcall get symbol) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2682 val)) |
25685 | 2683 (comment (get symbol 'variable-comment)) |
17334 | 2684 tmp |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2685 temp) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2686 (cond ((progn (setq tmp (get symbol 'customized-value)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2687 (setq temp |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2688 (get symbol 'customized-variable-comment)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2689 (or tmp temp)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2690 (if (condition-case nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2691 (and (equal value (eval (car tmp))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2692 (equal comment temp)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2693 (error nil)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2694 'set |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2695 'changed)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2696 ((progn (setq tmp (get symbol 'theme-value)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2697 (setq temp (get symbol 'saved-variable-comment)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2698 (or tmp temp)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2699 (if (condition-case nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2700 (and (equal comment temp) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2701 (equal value |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2702 (eval |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2703 (car (custom-variable-theme-value |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2704 symbol))))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2705 (error nil)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2706 (cond |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2707 ((eq (caar tmp) 'user) 'saved) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2708 ((eq (caar tmp) 'changed) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2709 (if (condition-case nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2710 (and (null comment) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2711 (equal value |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2712 (eval |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2713 (car (get symbol 'standard-value))))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2714 (error nil)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2715 ;; The value was originally set outside |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2716 ;; custom, but it was set to the standard |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2717 ;; value (probably an autoloaded defcustom). |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2718 'standard |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2719 'changed)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2720 (t 'themed)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2721 'changed)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2722 ((setq tmp (get symbol 'standard-value)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2723 (if (condition-case nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2724 (and (equal value (eval (car tmp))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2725 (equal comment nil)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2726 (error nil)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2727 'standard |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2728 'changed)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2729 (t 'rogue)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2730 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2731 (defun custom-variable-state-set (widget &optional state) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2732 "Set the state of WIDGET to STATE. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2733 If STATE is nil, the value is computed by `custom-variable-state'." |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2734 (widget-put widget :custom-state |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2735 (or state (custom-variable-state (widget-value widget) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
2736 (widget-get widget :value))))) |
17334 | 2737 |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2738 (defun custom-variable-standard-value (widget) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2739 (get (widget-value widget) 'standard-value)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2740 |
25685 | 2741 (defvar custom-variable-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2742 `(("Set for Current Session" custom-variable-set |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
2743 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2744 (eq (widget-get widget :custom-state) 'modified))) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2745 ;; Note that in all the backquoted code in this file, we test |
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2746 ;; init-file-user rather than user-init-file. This is in case |
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2747 ;; cus-edit is loaded by something in site-start.el, because |
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2748 ;; user-init-file is not set at that stage. |
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2749 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00310.html |
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2750 ,@(when (or custom-file init-file-user) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2751 '(("Save for Future Sessions" custom-variable-save |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2752 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2753 (memq (widget-get widget :custom-state) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2754 '(modified set changed rogue)))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2755 ("Undo Edits" custom-redraw |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2756 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2757 (and (default-boundp (widget-value widget)) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2758 (memq (widget-get widget :custom-state) '(modified changed))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2759 ("Reset to Saved" custom-variable-reset-saved |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2760 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2761 (and (or (get (widget-value widget) 'saved-value) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2762 (get (widget-value widget) 'saved-variable-comment)) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2763 (memq (widget-get widget :custom-state) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2764 '(modified set changed rogue))))) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
2765 ,@(when (or custom-file init-file-user) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2766 '(("Erase Customization" custom-variable-reset-standard |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2767 (lambda (widget) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2768 (and (get (widget-value widget) 'standard-value) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2769 (memq (widget-get widget :custom-state) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2770 '(modified set changed saved rogue))))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2771 ("Set to Backup Value" custom-variable-reset-backup |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2772 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2773 (get (widget-value widget) 'backup-value))) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2774 ("---" ignore ignore) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2775 ("Add Comment" custom-comment-show custom-comment-invisible-p) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2776 ("---" ignore ignore) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2777 ("Show Current Value" custom-variable-edit |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2778 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2779 (eq (widget-get widget :custom-form) 'lisp))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2780 ("Show Saved Lisp Expression" custom-variable-edit-lisp |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2781 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2782 (eq (widget-get widget :custom-form) 'edit)))) |
17334 | 2783 "Alist of actions for the `custom-variable' widget. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2784 Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2785 the menu entry, ACTION is the function to call on the widget when the |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2786 menu is selected, and FILTER is a predicate which takes a `custom-variable' |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2787 widget as an argument, and returns non-nil if ACTION is valid on that |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
2788 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 2789 |
2790 (defun custom-variable-action (widget &optional event) | |
2791 "Show the menu for `custom-variable' WIDGET. | |
2792 Optional EVENT is the location for the menu." | |
2793 (if (eq (widget-get widget :custom-state) 'hidden) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2794 (custom-toggle-hide widget) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2795 (unless (eq (widget-get widget :custom-state) 'modified) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2796 (custom-variable-state-set widget)) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2797 (custom-redraw-magic widget) |
17334 | 2798 (let* ((completion-ignore-case t) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2799 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2800 (custom-unlispify-tag-name |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2801 (widget-get widget :value))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2802 (custom-menu-filter custom-variable-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2803 widget) |
17334 | 2804 event))) |
2805 (if answer | |
2806 (funcall answer widget))))) | |
2807 | |
2808 (defun custom-variable-edit (widget) | |
2809 "Edit value of WIDGET." | |
2810 (widget-put widget :custom-state 'unknown) | |
2811 (widget-put widget :custom-form 'edit) | |
2812 (custom-redraw widget)) | |
2813 | |
2814 (defun custom-variable-edit-lisp (widget) | |
28130 | 2815 "Edit the Lisp representation of the value of WIDGET." |
17334 | 2816 (widget-put widget :custom-state 'unknown) |
2817 (widget-put widget :custom-form 'lisp) | |
2818 (custom-redraw widget)) | |
2819 | |
2820 (defun custom-variable-set (widget) | |
2821 "Set the current value for the variable being edited by WIDGET." | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2822 (let* ((form (widget-get widget :custom-form)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2823 (state (widget-get widget :custom-state)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2824 (child (car (widget-get widget :children))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2825 (symbol (widget-value widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2826 (set (or (get symbol 'custom-set) 'set-default)) |
25685 | 2827 (comment-widget (widget-get widget :comment-widget)) |
2828 (comment (widget-value comment-widget)) | |
2829 val) | |
17334 | 2830 (cond ((eq state 'hidden) |
19883
519eab181c36
(custom-face-menu): Use custom-face-save-command. not custom-face-save.
Richard M. Stallman <rms@gnu.org>
parents:
19823
diff
changeset
|
2831 (error "Cannot set hidden variable")) |
17334 | 2832 ((setq val (widget-apply child :validate)) |
2833 (goto-char (widget-get val :from)) | |
2834 (error "%s" (widget-get val :error))) | |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2835 ((memq form '(lisp mismatch)) |
25685 | 2836 (when (equal comment "") |
2837 (setq comment nil) | |
2838 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2839 (custom-comment-hide comment-widget)) |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2840 (custom-variable-backup-value widget) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2841 (custom-push-theme 'theme-value symbol 'user |
67797
7bdbb812b2f9
* custom.el (custom-push-theme): Fix docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
67793
diff
changeset
|
2842 'set (custom-quote (widget-value child))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2843 (funcall set symbol (eval (setq val (widget-value child)))) |
25685 | 2844 (put symbol 'customized-value (list val)) |
2845 (put symbol 'variable-comment comment) | |
2846 (put symbol 'customized-variable-comment comment)) | |
17334 | 2847 (t |
25685 | 2848 (when (equal comment "") |
2849 (setq comment nil) | |
2850 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2851 (custom-comment-hide comment-widget)) |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2852 (custom-variable-backup-value widget) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2853 (custom-push-theme 'theme-value symbol 'user |
67797
7bdbb812b2f9
* custom.el (custom-push-theme): Fix docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
67793
diff
changeset
|
2854 'set (custom-quote (widget-value child))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2855 (funcall set symbol (setq val (widget-value child))) |
25685 | 2856 (put symbol 'customized-value (list (custom-quote val))) |
2857 (put symbol 'variable-comment comment) | |
2858 (put symbol 'customized-variable-comment comment))) | |
17334 | 2859 (custom-variable-state-set widget) |
2860 (custom-redraw-magic widget))) | |
2861 | |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2862 (defun custom-variable-mark-to-save (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2863 "Set value and mark for saving the variable edited by WIDGET." |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2864 (let* ((form (widget-get widget :custom-form)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2865 (state (widget-get widget :custom-state)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2866 (child (car (widget-get widget :children))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2867 (symbol (widget-value widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2868 (set (or (get symbol 'custom-set) 'set-default)) |
25685 | 2869 (comment-widget (widget-get widget :comment-widget)) |
2870 (comment (widget-value comment-widget)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2871 val) |
17334 | 2872 (cond ((eq state 'hidden) |
19883
519eab181c36
(custom-face-menu): Use custom-face-save-command. not custom-face-save.
Richard M. Stallman <rms@gnu.org>
parents:
19823
diff
changeset
|
2873 (error "Cannot set hidden variable")) |
17334 | 2874 ((setq val (widget-apply child :validate)) |
2875 (goto-char (widget-get val :from)) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
2876 (error "Saving %s: %s" symbol (widget-get val :error))) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2877 ((memq form '(lisp mismatch)) |
25685 | 2878 (when (equal comment "") |
2879 (setq comment nil) | |
2880 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2881 (custom-comment-hide comment-widget)) |
17334 | 2882 (put symbol 'saved-value (list (widget-value child))) |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
2883 (custom-push-theme 'theme-value symbol 'user |
67797
7bdbb812b2f9
* custom.el (custom-push-theme): Fix docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
67793
diff
changeset
|
2884 'set (custom-quote (widget-value child))) |
25685 | 2885 (funcall set symbol (eval (widget-value child))) |
2886 (put symbol 'variable-comment comment) | |
2887 (put symbol 'saved-variable-comment comment)) | |
17334 | 2888 (t |
25685 | 2889 (when (equal comment "") |
2890 (setq comment nil) | |
2891 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2892 (custom-comment-hide comment-widget)) |
25685 | 2893 (put symbol 'saved-value |
2894 (list (custom-quote (widget-value child)))) | |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
2895 (custom-push-theme 'theme-value symbol 'user |
67797
7bdbb812b2f9
* custom.el (custom-push-theme): Fix docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
67793
diff
changeset
|
2896 'set (custom-quote (widget-value child))) |
25685 | 2897 (funcall set symbol (widget-value child)) |
2898 (put symbol 'variable-comment comment) | |
2899 (put symbol 'saved-variable-comment comment))) | |
17334 | 2900 (put symbol 'customized-value nil) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2901 (put symbol 'customized-variable-comment nil))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2902 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2903 (defsubst custom-variable-state-set-and-redraw (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2904 "Set state of variable widget WIDGET and redraw with current settings." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2905 (custom-variable-state-set widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2906 (custom-redraw-magic widget)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2907 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2908 (defun custom-variable-save (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2909 "Save value of variable edited by widget WIDGET." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2910 (custom-variable-mark-to-save widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2911 (custom-save-all) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2912 (custom-variable-state-set-and-redraw widget)) |
17334 | 2913 |
2914 (defun custom-variable-reset-saved (widget) | |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2915 "Restore the saved value for the variable being edited by WIDGET. |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
2916 This also updates the buffer to show that value. |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2917 The value that was current before this operation |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2918 becomes the backup value, so you can get it again." |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2919 (let* ((symbol (widget-value widget)) |
25685 | 2920 (set (or (get symbol 'custom-set) 'set-default)) |
2921 (value (get symbol 'saved-value)) | |
2922 (comment (get symbol 'saved-variable-comment))) | |
2923 (cond ((or value comment) | |
2924 (put symbol 'variable-comment comment) | |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2925 (custom-variable-backup-value widget) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2926 (custom-push-theme 'theme-value symbol 'user 'set (car-safe value)) |
25685 | 2927 (condition-case nil |
2928 (funcall set symbol (eval (car value))) | |
2929 (error nil))) | |
2930 (t | |
2931 (error "No saved value for %s" symbol))) | |
17334 | 2932 (put symbol 'customized-value nil) |
25685 | 2933 (put symbol 'customized-variable-comment nil) |
17334 | 2934 (widget-put widget :custom-state 'unknown) |
25685 | 2935 ;; This call will possibly make the comment invisible |
17334 | 2936 (custom-redraw widget))) |
2937 | |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2938 (defun custom-variable-mark-to-reset-standard (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2939 "Mark to restore standard setting for the variable edited by widget WIDGET. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2940 If `custom-reset-standard-variables-list' is nil, save, reset and |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2941 redraw the widget immediately." |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2942 (let* ((symbol (widget-value widget))) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2943 (if (get symbol 'standard-value) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2944 (custom-variable-backup-value widget) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
2945 (error "No standard setting known for %S" symbol)) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2946 (put symbol 'variable-comment nil) |
17334 | 2947 (put symbol 'customized-value nil) |
25685 | 2948 (put symbol 'customized-variable-comment nil) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2949 (custom-push-theme 'theme-value symbol 'user 'reset) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2950 (custom-theme-recalc-variable symbol) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2951 (if (and custom-reset-standard-variables-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2952 (or (get symbol 'saved-value) (get symbol 'saved-variable-comment))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2953 (progn |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2954 (put symbol 'saved-value nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2955 (put symbol 'saved-variable-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2956 ;; Append this to `custom-reset-standard-variables-list' to |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2957 ;; have `custom-reset-standard-save-and-update' save setting |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2958 ;; to the file, update the widget's state, and redraw it. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2959 (setq custom-reset-standard-variables-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2960 (cons widget custom-reset-standard-variables-list))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2961 (when (or (get symbol 'saved-value) (get symbol 'saved-variable-comment)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2962 (put symbol 'saved-value nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2963 (put symbol 'saved-variable-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2964 (custom-save-all)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2965 (widget-put widget :custom-state 'unknown) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2966 ;; This call will possibly make the comment invisible |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2967 (custom-redraw widget)))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2968 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2969 (defun custom-variable-reset-standard (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2970 "Restore standard setting for the variable edited by WIDGET. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2971 This operation eliminates any saved setting for the variable, |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2972 restoring it to the state of a variable that has never been customized. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2973 The value that was current before this operation |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2974 becomes the backup value, so you can get it again." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2975 (let (custom-reset-standard-variables-list) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
2976 (custom-variable-mark-to-reset-standard widget))) |
17334 | 2977 |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2978 (defun custom-variable-backup-value (widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2979 "Back up the current value for WIDGET's variable. |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2980 The backup value is kept in the car of the `backup-value' property." |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2981 (let* ((symbol (widget-value widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2982 (get (or (get symbol 'custom-get) 'default-value)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2983 (type (custom-variable-type symbol)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2984 (conv (widget-convert type)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2985 (value (if (default-boundp symbol) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2986 (funcall get symbol) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2987 (widget-get conv :value)))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2988 (put symbol 'backup-value (list value)))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2989 |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2990 (defun custom-variable-reset-backup (widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2991 "Restore the backup value for the variable being edited by WIDGET. |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2992 The value that was current before this operation |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2993 becomes the backup value, so you can use this operation repeatedly |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2994 to switch between two values." |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2995 (let* ((symbol (widget-value widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2996 (set (or (get symbol 'custom-set) 'set-default)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2997 (value (get symbol 'backup-value)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2998 (comment-widget (widget-get widget :comment-widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2999 (comment (widget-value comment-widget))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3000 (if value |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3001 (progn |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3002 (custom-variable-backup-value widget) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
3003 (custom-push-theme 'theme-value symbol 'user 'set value) |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3004 (condition-case nil |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3005 (funcall set symbol (car value)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3006 (error nil))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3007 (error "No backup value for %s" symbol)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3008 (put symbol 'customized-value (list (car value))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3009 (put symbol 'variable-comment comment) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3010 (put symbol 'customized-variable-comment comment) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3011 (custom-variable-state-set widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3012 ;; This call will possibly make the comment invisible |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3013 (custom-redraw widget))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
3014 |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3015 ;;; The `custom-visibility' Widget |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3016 |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3017 (define-widget 'custom-visibility 'visibility |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3018 "Show or hide a documentation string." |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3019 :button-face 'custom-visibility |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3020 :pressed-face 'custom-visibility |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3021 :mouse-face 'highlight |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3022 :pressed-face 'highlight |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3023 :on-image nil |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3024 :off-image nil) |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3025 |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3026 (defface custom-visibility |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3027 '((t :height 0.8 :inherit link)) |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3028 "Face for the `custom-visibility' widget." |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3029 :version "23.1" |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3030 :group 'custom-faces) |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
3031 |
17334 | 3032 ;;; The `custom-face-edit' Widget. |
3033 | |
3034 (define-widget 'custom-face-edit 'checklist | |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3035 "Widget for editing face attributes." |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3036 :format "%v" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3037 :extra-offset 3 |
25685 | 3038 :button-args '(:help-echo "Control whether this attribute has any effect.") |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
3039 :value-to-internal 'custom-face-edit-fix-value |
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
3040 :match (lambda (widget value) |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
3041 (widget-checklist-match widget |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
3042 (custom-face-edit-fix-value widget value))) |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3043 :value-create 'custom-face-edit-value-create |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3044 :convert-widget 'custom-face-edit-convert-widget |
17334 | 3045 :args (mapcar (lambda (att) |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3046 (list 'group :inline t |
17334 | 3047 :sibling-args (widget-get (nth 1 att) :sibling-args) |
25685 | 3048 (list 'const :format "" :value (nth 0 att)) |
17334 | 3049 (nth 1 att))) |
3050 custom-face-attributes)) | |
3051 | |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3052 (defun custom-face-edit-value-create (widget) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3053 (let* ((value (widget-get widget :value)) ; list of key-value pairs |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3054 (alist (widget-checklist-match-find widget value)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3055 (args (widget-get widget :args)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3056 (show-all (widget-get widget :show-all-attributes)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3057 (buttons (widget-get widget :buttons)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3058 entry) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3059 (unless (looking-back "^ *") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3060 (insert ?\n)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3061 (insert-char ?\s (widget-get widget :extra-offset)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3062 (if (or alist show-all) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3063 (dolist (prop args) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3064 (setq entry (assq prop alist)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3065 (if (or entry show-all) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3066 (widget-checklist-add-item widget prop entry))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3067 (insert (propertize "-- Empty face --" 'face 'shadow) ?\n)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3068 (let ((indent (widget-get widget :indent))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3069 (if indent (insert-char ?\s (widget-get widget :indent)))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3070 (push (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3071 widget 'visibility |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3072 :help-echo "Show or hide all face attributes." |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3073 :button-face 'custom-visibility |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3074 :pressed-face 'custom-visibility |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3075 :mouse-face 'highlight |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3076 :on "Hide Unused Attributes" :off "Show All Attributes" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3077 :on-image nil :off-image nil |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3078 :always-active t |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3079 :action 'custom-face-edit-value-visibility-action |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3080 show-all) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3081 buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3082 (insert ?\n) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3083 (widget-put widget :buttons buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3084 (widget-put widget :children (nreverse (widget-get widget :children))))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3085 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3086 (defun custom-face-edit-value-visibility-action (widget &rest ignore) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3087 ;; Toggle hiding of face attributes. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3088 (let ((parent (widget-get widget :parent))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3089 (widget-put parent :show-all-attributes |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3090 (not (widget-get parent :show-all-attributes))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3091 (custom-redraw parent))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3092 |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
3093 (defun custom-face-edit-fix-value (widget value) |
48709
d1efe2b99d8a
(custom-face-edit-fix-value): Change :reverse-video to :inverse-video.
Andreas Schwab <schwab@suse.de>
parents:
48633
diff
changeset
|
3094 "Ignoring WIDGET, convert :bold and :italic in VALUE to new form. |
d1efe2b99d8a
(custom-face-edit-fix-value): Change :reverse-video to :inverse-video.
Andreas Schwab <schwab@suse.de>
parents:
48633
diff
changeset
|
3095 Also change :reverse-video to :inverse-video." |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3096 (if (listp value) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3097 (let (result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3098 (while value |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3099 (let ((key (car value)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3100 (val (car (cdr value)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3101 (cond ((eq key :italic) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3102 (push :slant result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3103 (push (if val 'italic 'normal) result)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3104 ((eq key :bold) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3105 (push :weight result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3106 (push (if val 'bold 'normal) result)) |
48709
d1efe2b99d8a
(custom-face-edit-fix-value): Change :reverse-video to :inverse-video.
Andreas Schwab <schwab@suse.de>
parents:
48633
diff
changeset
|
3107 ((eq key :reverse-video) |
d1efe2b99d8a
(custom-face-edit-fix-value): Change :reverse-video to :inverse-video.
Andreas Schwab <schwab@suse.de>
parents:
48633
diff
changeset
|
3108 (push :inverse-video result) |
d1efe2b99d8a
(custom-face-edit-fix-value): Change :reverse-video to :inverse-video.
Andreas Schwab <schwab@suse.de>
parents:
48633
diff
changeset
|
3109 (push val result)) |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
3110 (t |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3111 (push key result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3112 (push val result)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3113 (setq value (cdr (cdr value)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3114 (setq result (nreverse result)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3115 result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3116 value)) |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
3117 |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3118 (defun custom-face-edit-convert-widget (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3119 "Convert :args as widget types in WIDGET." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3120 (widget-put |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3121 widget |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3122 :args (mapcar (lambda (arg) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3123 (widget-convert arg |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3124 :deactivate 'custom-face-edit-deactivate |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3125 :activate 'custom-face-edit-activate |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3126 :delete 'custom-face-edit-delete)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3127 (widget-get widget :args))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3128 widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3129 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3130 (defun custom-face-edit-deactivate (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3131 "Make face widget WIDGET inactive for user modifications." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3132 (unless (widget-get widget :inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3133 (let ((tag (custom-face-edit-attribute-tag widget)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3134 (from (copy-marker (widget-get widget :from))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3135 (value (widget-value widget)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3136 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3137 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3138 (save-excursion |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3139 (goto-char from) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3140 (widget-default-delete widget) |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3141 (insert tag ": " (propertize "--" 'face 'shadow) "\n") |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3142 (widget-put widget :inactive |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3143 (cons value (cons from (- (point) from)))))))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3144 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3145 (defun custom-face-edit-activate (widget) |
78803
6b503866d323
Drew Adams <drew.adams at oracle.com>
Glenn Morris <rgm@gnu.org>
parents:
78394
diff
changeset
|
3146 "Make face widget WIDGET active for user modifications." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3147 (let ((inactive (widget-get widget :inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3148 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3149 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3150 (when (consp inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3151 (save-excursion |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3152 (goto-char (car (cdr inactive))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3153 (delete-region (point) (+ (point) (cdr (cdr inactive)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3154 (widget-put widget :inactive nil) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3155 (widget-apply widget :create) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3156 (widget-value-set widget (car inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3157 (widget-setup))))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3158 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3159 (defun custom-face-edit-delete (widget) |
55789
e004c3c8a4b6
(customize-face, customize-face-other-window, custom-face-edit-delete):
Juanma Barranquero <lekktu@gmail.com>
parents:
55272
diff
changeset
|
3160 "Remove WIDGET from the buffer." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3161 (let ((inactive (widget-get widget :inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3162 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3163 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3164 (if (not inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3165 ;; Widget is alive, we don't have to do anything special |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3166 (widget-default-delete widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3167 ;; WIDGET is already deleted because we did so to inactivate it; |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3168 ;; now just get rid of the label we put in its place. |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3169 (delete-region (car (cdr inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3170 (+ (car (cdr inactive)) (cdr (cdr inactive)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3171 (widget-put widget :inactive nil)))) |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
3172 |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3173 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3174 (defun custom-face-edit-attribute-tag (widget) |
99298
225286546090
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
98001
diff
changeset
|
3175 "Return the first :tag property in WIDGET or one of its children." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3176 (let ((tag (widget-get widget :tag))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3177 (or (and (not (equal tag "")) tag) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3178 (let ((children (widget-get widget :children))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3179 (while (and (null tag) children) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3180 (setq tag (custom-face-edit-attribute-tag (pop children)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3181 tag)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3182 |
17334 | 3183 ;;; The `custom-display' Widget. |
3184 | |
3185 (define-widget 'custom-display 'menu-choice | |
3186 "Select a display type." | |
3187 :tag "Display" | |
3188 :value t | |
3189 :help-echo "Specify frames where the face attributes should be used." | |
3190 :args '((const :tag "all" t) | |
58941
a7271df99c36
(custom-display): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58940
diff
changeset
|
3191 (const :tag "defaults" default) |
17334 | 3192 (checklist |
3193 :offset 0 | |
3194 :extra-offset 9 | |
3195 :args ((group :sibling-args (:help-echo "\ | |
3196 Only match the specified window systems.") | |
3197 (const :format "Type: " | |
3198 type) | |
3199 (checklist :inline t | |
3200 :offset 0 | |
3201 (const :format "X " | |
3202 :sibling-args (:help-echo "\ | |
3203 The X11 Window System.") | |
3204 x) | |
3205 (const :format "PM " | |
3206 :sibling-args (:help-echo "\ | |
3207 OS/2 Presentation Manager.") | |
3208 pm) | |
19684
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3209 (const :format "W32 " |
17334 | 3210 :sibling-args (:help-echo "\ |
19684
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3211 Windows NT/9X.") |
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3212 w32) |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
94678
diff
changeset
|
3213 (const :format "NS " |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
94678
diff
changeset
|
3214 :sibling-args (:help-echo "\ |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
94678
diff
changeset
|
3215 GNUstep or Macintosh OS Cocoa interface.") |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
94678
diff
changeset
|
3216 ns) |
17334 | 3217 (const :format "DOS " |
3218 :sibling-args (:help-echo "\ | |
3219 Plain MS-DOS.") | |
3220 pc) | |
3221 (const :format "TTY%n" | |
3222 :sibling-args (:help-echo "\ | |
3223 Plain text terminals.") | |
3224 tty))) | |
3225 (group :sibling-args (:help-echo "\ | |
3226 Only match the frames with the specified color support.") | |
3227 (const :format "Class: " | |
3228 class) | |
3229 (checklist :inline t | |
3230 :offset 0 | |
3231 (const :format "Color " | |
3232 :sibling-args (:help-echo "\ | |
3233 Match color frames.") | |
3234 color) | |
3235 (const :format "Grayscale " | |
3236 :sibling-args (:help-echo "\ | |
3237 Match grayscale frames.") | |
3238 grayscale) | |
3239 (const :format "Monochrome%n" | |
3240 :sibling-args (:help-echo "\ | |
3241 Match frames with no color support.") | |
3242 mono))) | |
3243 (group :sibling-args (:help-echo "\ | |
55944
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3244 The minimum number of colors the frame should support.") |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3245 (const :format "" min-colors) |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3246 (integer :tag "Minimum number of colors" )) |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3247 (group :sibling-args (:help-echo "\ |
17334 | 3248 Only match frames with the specified intensity.") |
3249 (const :format "\ | |
3250 Background brightness: " | |
3251 background) | |
3252 (checklist :inline t | |
3253 :offset 0 | |
3254 (const :format "Light " | |
3255 :sibling-args (:help-echo "\ | |
3256 Match frames with light backgrounds.") | |
3257 light) | |
3258 (const :format "Dark\n" | |
3259 :sibling-args (:help-echo "\ | |
3260 Match frames with dark backgrounds.") | |
45724
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3261 dark))) |
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3262 (group :sibling-args (:help-echo "\ |
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3263 Only match frames that support the specified face attributes.") |
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3264 (const :format "Supports attributes:" supports) |
45725
abb237aa3c61
(custom-display): Use correct syntax for `supports' attributes.
Miles Bader <miles@gnu.org>
parents:
45724
diff
changeset
|
3265 (custom-face-edit :inline t :format "%n%v")))))) |
17334 | 3266 |
3267 ;;; The `custom-face' Widget. | |
3268 | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3269 (defface custom-face-tag |
97091
49ee444c9f1b
(custom-face-tag): Inherit from custom-variable-tag
Juri Linkov <juri@jurta.org>
parents:
97043
diff
changeset
|
3270 `((t :inherit custom-variable-tag)) |
17334 | 3271 "Face used for face tags." |
17415 | 3272 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
3273 (define-obsolete-face-alias 'custom-face-tag-face 'custom-face-tag "22.1") |
17334 | 3274 |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3275 (defcustom custom-face-default-form 'selected |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3276 "Default form of displaying face definition." |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3277 :type '(choice (const all) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3278 (const selected) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3279 (const lisp)) |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
3280 :group 'custom-buffer |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
3281 :version "20.3") |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3282 |
17334 | 3283 (define-widget 'custom-face 'custom |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3284 "Widget for customizing a face. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3285 The widget value is the face name (a symbol). |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3286 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3287 The following properties have special meanings for this widget: |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3288 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3289 :custom-form should be a symbol describing how to display and |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3290 edit the face attributes---either `selected' (attributes for |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3291 selected display only), `all' (all attributes), `lisp' (as a |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3292 Lisp sexp), or `mismatch' (should not happen); if nil, use |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3293 the return value of `custom-face-default-form'." |
99404
16c6946eeb2e
(custom-variable-value-create, custom-face):
Glenn Morris <rgm@gnu.org>
parents:
99403
diff
changeset
|
3294 :sample-face 'custom-face-tag |
17334 | 3295 :help-echo "Set or reset this face." |
28716
e9fb71a3e51d
(custom-face): Fix parenthesis.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28700
diff
changeset
|
3296 :documentation-property #'face-doc-string |
17334 | 3297 :value-create 'custom-face-value-create |
3298 :action 'custom-face-action | |
18089 | 3299 :custom-category 'face |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3300 :custom-form nil |
17334 | 3301 :custom-set 'custom-face-set |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3302 :custom-mark-to-save 'custom-face-mark-to-save |
17334 | 3303 :custom-reset-current 'custom-redraw |
3304 :custom-reset-saved 'custom-face-reset-saved | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3305 :custom-reset-standard 'custom-face-reset-standard |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3306 :custom-mark-to-reset-standard 'custom-face-mark-to-reset-standard |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3307 :custom-standard-value 'custom-face-standard-value |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3308 :custom-state-set-and-redraw 'custom-face-state-set-and-redraw |
17334 | 3309 :custom-menu 'custom-face-menu-create) |
3310 | |
25685 | 3311 (define-widget 'custom-face-all 'editable-list |
17334 | 3312 "An editable list of display specifications and attributes." |
3313 :entry-format "%i %d %v" | |
3314 :insert-button-args '(:help-echo "Insert new display specification here.") | |
3315 :append-button-args '(:help-echo "Append new display specification here.") | |
3316 :delete-button-args '(:help-echo "Delete this display specification.") | |
3317 :args '((group :format "%v" custom-display custom-face-edit))) | |
3318 | |
3319 (defconst custom-face-all (widget-convert 'custom-face-all) | |
3320 "Converted version of the `custom-face-all' widget.") | |
3321 | |
3322 (define-widget 'custom-display-unselected 'item | |
3323 "A display specification that doesn't match the selected display." | |
3324 :match 'custom-display-unselected-match) | |
3325 | |
3326 (defun custom-display-unselected-match (widget value) | |
3327 "Non-nil if VALUE is an unselected display specification." | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
3328 (not (face-spec-set-match-display value (selected-frame)))) |
17334 | 3329 |
25685 | 3330 (define-widget 'custom-face-selected 'group |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3331 "Widget for editing the attributes of a face on the selected display." |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3332 :args '((group :tag "No Defaults" :inline t |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3333 (repeat :format "" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3334 :inline t |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3335 (group custom-display-unselected sexp)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3336 (group (sexp :format "") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3337 (custom-face-edit :tag "\n Attributes")) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3338 (repeat :format "" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3339 :inline t |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3340 sexp)))) |
17334 | 3341 |
3342 (defconst custom-face-selected (widget-convert 'custom-face-selected) | |
3343 "Converted version of the `custom-face-selected' widget.") | |
3344 | |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3345 (defun custom-filter-face-spec (spec filter-index &optional default-filter) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3346 "Return a canonicalized version of SPEC using. |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3347 FILTER-INDEX is the index in the entry for each attribute in |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3348 `custom-face-attributes' at which the appropriate filter function can be |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3349 found, and DEFAULT-FILTER is the filter to apply for attributes that |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3350 don't specify one." |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3351 (mapcar (lambda (entry) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3352 ;; Filter a single face-spec entry |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3353 (let ((tests (car entry)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3354 (unfiltered-attrs |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3355 ;; Handle both old- and new-style attribute syntax |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3356 (if (listp (car (cdr entry))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3357 (car (cdr entry)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3358 (cdr entry))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3359 (filtered-attrs nil)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3360 ;; Filter each face attribute |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3361 (while unfiltered-attrs |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3362 (let* ((attr (pop unfiltered-attrs)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3363 (pre-filtered-value (pop unfiltered-attrs)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3364 (filter |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3365 (or (nth filter-index (assq attr custom-face-attributes)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3366 default-filter)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3367 (filtered-value |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3368 (if filter |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3369 (funcall filter pre-filtered-value) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3370 pre-filtered-value))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3371 (push filtered-value filtered-attrs) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3372 (push attr filtered-attrs))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3373 ;; |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3374 (list tests filtered-attrs))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3375 spec)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3376 |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3377 (defun custom-pre-filter-face-spec (spec) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3378 "Return SPEC changed as necessary for editing by the face customization widget. |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3379 SPEC must be a full face spec." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3380 (custom-filter-face-spec spec 2)) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3381 |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3382 (defun custom-post-filter-face-spec (spec) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3383 "Return the customized SPEC in a form suitable for setting the face." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3384 (custom-filter-face-spec spec 3)) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3385 |
17334 | 3386 (defun custom-face-value-create (widget) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3387 "Create a list of the display specifications for WIDGET." |
110811
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3388 (let* ((buttons (widget-get widget :buttons)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3389 (symbol (widget-get widget :value)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3390 (tag (or (widget-get widget :tag) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3391 (prin1-to-string symbol))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3392 (hiddenp (eq (widget-get widget :custom-state) 'hidden)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3393 children) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3394 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3395 (if (eq custom-buffer-style 'tree) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3396 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3397 ;; Draw a tree-style `custom-face' widget |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3398 (progn |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3399 (insert (widget-get widget :custom-prefix) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3400 (if (widget-get widget :custom-last) " `--- " " |--- ")) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3401 (push (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3402 widget 'custom-browse-face-tag) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3403 buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3404 (insert " " tag "\n") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3405 (widget-put widget :buttons buttons)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3406 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3407 ;; Draw an ordinary `custom-face' widget |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3408 (let ((opoint (point))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3409 ;; Visibility indicator. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3410 (push (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3411 widget 'custom-visibility |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3412 :help-echo "Hide or show this face." |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3413 :on "Hide" :off "Show" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3414 :on-image "down" :off-image "right" |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3415 :action 'custom-toggle-parent |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3416 (not hiddenp)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3417 buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3418 ;; Face name (tag). |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3419 (insert " " tag) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3420 (widget-specify-sample widget opoint (point))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3421 (insert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3422 (cond ((eq custom-buffer-style 'face) " ") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3423 ((string-match "face\\'" tag) ":") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3424 (t " face: "))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3425 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3426 ;; Face sample. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3427 (push (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3428 widget 'item |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3429 :format "(%{%t%})" :sample-face symbol :tag "sample") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3430 buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3431 ;; Magic. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3432 (insert "\n") |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3433 (let ((magic (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3434 widget 'custom-magic nil))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3435 (widget-put widget :custom-magic magic) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3436 (push magic buttons)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3437 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3438 ;; Update buttons. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3439 (widget-put widget :buttons buttons) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3440 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3441 ;; Insert documentation. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3442 (widget-put widget :documentation-indent 3) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3443 (widget-add-documentation-string-button |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3444 widget :visibility-widget 'custom-visibility) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3445 ;; The comment field |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3446 (unless hiddenp |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3447 (let* ((comment (get symbol 'face-comment)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3448 (comment-widget |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3449 (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3450 widget 'custom-comment |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3451 :parent widget |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3452 :value (or comment "")))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3453 (widget-put widget :comment-widget comment-widget) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3454 (push comment-widget children))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3455 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3456 ;; Editor. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3457 (unless (eq (preceding-char) ?\n) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3458 (insert "\n")) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3459 (unless hiddenp |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3460 (custom-load-widget widget) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3461 (unless (widget-get widget :custom-form) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3462 (widget-put widget :custom-form custom-face-default-form)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3463 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3464 (let* ((spec (or (get symbol 'customized-face) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3465 (get symbol 'saved-face) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3466 (get symbol 'face-defface-spec) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3467 ;; Attempt to construct it. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3468 (list (list t (custom-face-attributes-get |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3469 symbol (selected-frame)))))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3470 (form (widget-get widget :custom-form)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3471 (indent (widget-get widget :indent)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3472 edit-widget-type edit) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3473 ;; If the user has changed this face in some other way, |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3474 ;; edit it as the user has specified it. |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3475 (if (not (face-spec-match-p symbol spec (selected-frame))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3476 (setq spec `((t ,(face-attr-construct symbol |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3477 (selected-frame)))))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3478 (setq spec (custom-pre-filter-face-spec spec)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3479 |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3480 (cond ((and (eq form 'selected) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3481 (widget-apply custom-face-selected :match spec)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3482 (when indent (insert-char ?\s indent)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3483 (setq edit-widget-type 'custom-face-selected)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3484 ((and (not (eq form 'lisp)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3485 (widget-apply custom-face-all :match spec)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3486 (setq edit-widget-type 'custom-face-all)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3487 (t |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3488 (when indent |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3489 (insert-char ?\s indent)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3490 (setq edit-widget-type 'sexp))) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3491 (setq edit (widget-create-child-and-convert |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3492 widget edit-widget-type :value spec)) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3493 (custom-face-state-set widget) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3494 (push edit children) |
4d1b1a2c88c6
Improvements to face customization interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
110015
diff
changeset
|
3495 (widget-put widget :children children)))))) |
17334 | 3496 |
25685 | 3497 (defvar custom-face-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3498 `(("Set for Current Session" custom-face-set) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
3499 ,@(when (or custom-file init-file-user) |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3500 '(("Save for Future Sessions" custom-face-save))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3501 ("Undo Edits" custom-redraw |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3502 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3503 (memq (widget-get widget :custom-state) '(modified changed)))) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3504 ("Reset to Saved" custom-face-reset-saved |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
3505 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
3506 (or (get (widget-value widget) 'saved-face) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
3507 (get (widget-value widget) 'saved-face-comment)))) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
3508 ,@(when (or custom-file init-file-user) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3509 '(("Erase Customization" custom-face-reset-standard |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
3510 (lambda (widget) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
3511 (get (widget-value widget) 'face-defface-spec))))) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3512 ("---" ignore ignore) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3513 ("Add Comment" custom-comment-show custom-comment-invisible-p) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3514 ("---" ignore ignore) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3515 ("For Current Display" custom-face-edit-selected |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3516 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3517 (not (eq (widget-get widget :custom-form) 'selected)))) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3518 ("For All Kinds of Displays" custom-face-edit-all |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3519 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3520 (not (eq (widget-get widget :custom-form) 'all)))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3521 ("Show Lisp Expression" custom-face-edit-lisp |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3522 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3523 (not (eq (widget-get widget :custom-form) 'lisp))))) |
17334 | 3524 "Alist of actions for the `custom-face' widget. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3525 Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3526 the menu entry, ACTION is the function to call on the widget when the |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3527 menu is selected, and FILTER is a predicate which takes a `custom-face' |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3528 widget as an argument, and returns non-nil if ACTION is valid on that |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
3529 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 3530 |
3531 (defun custom-face-edit-selected (widget) | |
3532 "Edit selected attributes of the value of WIDGET." | |
3533 (widget-put widget :custom-state 'unknown) | |
3534 (widget-put widget :custom-form 'selected) | |
3535 (custom-redraw widget)) | |
3536 | |
3537 (defun custom-face-edit-all (widget) | |
3538 "Edit all attributes of the value of WIDGET." | |
3539 (widget-put widget :custom-state 'unknown) | |
3540 (widget-put widget :custom-form 'all) | |
3541 (custom-redraw widget)) | |
3542 | |
3543 (defun custom-face-edit-lisp (widget) | |
28130 | 3544 "Edit the Lisp representation of the value of WIDGET." |
17334 | 3545 (widget-put widget :custom-state 'unknown) |
3546 (widget-put widget :custom-form 'lisp) | |
3547 (custom-redraw widget)) | |
3548 | |
3549 (defun custom-face-state-set (widget) | |
3550 "Set the state of WIDGET." | |
25685 | 3551 (let* ((symbol (widget-value widget)) |
3552 (comment (get symbol 'face-comment)) | |
51277
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3553 tmp temp |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3554 (state |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3555 (cond ((progn |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3556 (setq tmp (get symbol 'customized-face)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3557 (setq temp (get symbol 'customized-face-comment)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3558 (or tmp temp)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3559 (if (equal temp comment) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3560 'set |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3561 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3562 ((progn |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3563 (setq tmp (get symbol 'saved-face)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3564 (setq temp (get symbol 'saved-face-comment)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3565 (or tmp temp)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3566 (if (equal temp comment) |
67784
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3567 (cond |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3568 ((eq 'user (caar (get symbol 'theme-face))) |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3569 'saved) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
3570 ((eq 'changed (caar (get symbol 'theme-face))) |
67784
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3571 'changed) |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3572 (t 'themed)) |
51277
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3573 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3574 ((get symbol 'face-defface-spec) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3575 (if (equal comment nil) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3576 'standard |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3577 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3578 (t |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3579 'rogue)))) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3580 ;; If the user called set-face-attribute to change the default |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3581 ;; for new frames, this face is "set outside of Customize". |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3582 (if (and (not (eq state 'rogue)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3583 (get symbol 'face-modified)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3584 (setq state 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3585 (widget-put widget :custom-state state))) |
17334 | 3586 |
3587 (defun custom-face-action (widget &optional event) | |
3588 "Show the menu for `custom-face' WIDGET. | |
3589 Optional EVENT is the location for the menu." | |
3590 (if (eq (widget-get widget :custom-state) 'hidden) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3591 (custom-toggle-hide widget) |
17334 | 3592 (let* ((completion-ignore-case t) |
3593 (symbol (widget-get widget :value)) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3594 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3595 (custom-unlispify-tag-name symbol)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3596 (custom-menu-filter custom-face-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3597 widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3598 event))) |
17334 | 3599 (if answer |
3600 (funcall answer widget))))) | |
3601 | |
3602 (defun custom-face-set (widget) | |
3603 "Make the face attributes in WIDGET take effect." | |
3604 (let* ((symbol (widget-value widget)) | |
3605 (child (car (widget-get widget :children))) | |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3606 (value (custom-post-filter-face-spec (widget-value child))) |
25685 | 3607 (comment-widget (widget-get widget :comment-widget)) |
3608 (comment (widget-value comment-widget))) | |
3609 (when (equal comment "") | |
3610 (setq comment nil) | |
3611 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
3612 (custom-comment-hide comment-widget)) |
17334 | 3613 (put symbol 'customized-face value) |
69624
efd1add5bedf
* cus-edit.el (custom-face-set): Call custom-push-theme before
Chong Yidong <cyd@stupidchicken.com>
parents:
69540
diff
changeset
|
3614 (custom-push-theme 'theme-face symbol 'user 'set value) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3615 (if (face-spec-choose value) |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3616 (face-spec-set symbol value t) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3617 ;; face-set-spec ignores empty attribute lists, so just give it |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3618 ;; something harmless instead. |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3619 (face-spec-set symbol '((t :foreground unspecified)) t)) |
25685 | 3620 (put symbol 'customized-face-comment comment) |
3621 (put symbol 'face-comment comment) | |
17334 | 3622 (custom-face-state-set widget) |
3623 (custom-redraw-magic widget))) | |
3624 | |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3625 (defun custom-face-mark-to-save (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3626 "Mark for saving the face edited by WIDGET." |
17334 | 3627 (let* ((symbol (widget-value widget)) |
3628 (child (car (widget-get widget :children))) | |
35441
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3629 (value (custom-post-filter-face-spec (widget-value child))) |
25685 | 3630 (comment-widget (widget-get widget :comment-widget)) |
3631 (comment (widget-value comment-widget))) | |
3632 (when (equal comment "") | |
3633 (setq comment nil) | |
3634 ;; Make the comment invisible by hand if it's empty | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
3635 (custom-comment-hide comment-widget)) |
68026
c7ec296cf313
* cus-edit.el (custom-face-save): Push to theme-face before
Chong Yidong <cyd@stupidchicken.com>
parents:
68021
diff
changeset
|
3636 (custom-push-theme 'theme-face symbol 'user 'set value) |
35441
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3637 (if (face-spec-choose value) |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3638 (face-spec-set symbol value t) |
35441
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3639 ;; face-set-spec ignores empty attribute lists, so just give it |
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3640 ;; something harmless instead. |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3641 (face-spec-set symbol '((t :foreground unspecified)) t)) |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3642 (unless (eq (widget-get widget :custom-state) 'standard) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3643 (put symbol 'saved-face value)) |
17334 | 3644 (put symbol 'customized-face nil) |
25685 | 3645 (put symbol 'face-comment comment) |
3646 (put symbol 'customized-face-comment nil) | |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3647 (put symbol 'saved-face-comment comment))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3648 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3649 (defsubst custom-face-state-set-and-redraw (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3650 "Set state of face widget WIDGET and redraw with current settings." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3651 (custom-face-state-set widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3652 (custom-redraw-magic widget)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3653 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3654 (defun custom-face-save (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3655 "Save the face edited by WIDGET." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3656 (custom-face-mark-to-save widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3657 (custom-save-all) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3658 (custom-face-state-set-and-redraw widget)) |
17334 | 3659 |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3660 ;; For backward compatibility. |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3661 (define-obsolete-function-alias 'custom-face-save-command 'custom-face-save |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3662 "22.1") |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3663 |
17334 | 3664 (defun custom-face-reset-saved (widget) |
3665 "Restore WIDGET to the face's default attributes." | |
3666 (let* ((symbol (widget-value widget)) | |
3667 (child (car (widget-get widget :children))) | |
25685 | 3668 (value (get symbol 'saved-face)) |
3669 (comment (get symbol 'saved-face-comment)) | |
3670 (comment-widget (widget-get widget :comment-widget))) | |
3671 (unless (or value comment) | |
17334 | 3672 (error "No saved value for this face")) |
3673 (put symbol 'customized-face nil) | |
25685 | 3674 (put symbol 'customized-face-comment nil) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
3675 (custom-push-theme 'theme-face symbol 'user 'set value) |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3676 (face-spec-set symbol value t) |
25685 | 3677 (put symbol 'face-comment comment) |
17334 | 3678 (widget-value-set child value) |
25685 | 3679 ;; This call manages the comment visibility |
3680 (widget-value-set comment-widget (or comment "")) | |
17334 | 3681 (custom-face-state-set widget) |
3682 (custom-redraw-magic widget))) | |
3683 | |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3684 (defun custom-face-standard-value (widget) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3685 (get (widget-value widget) 'face-defface-spec)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3686 |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3687 (defun custom-face-mark-to-reset-standard (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3688 "Restore widget WIDGET to the face's standard attribute values. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3689 If `custom-reset-standard-faces-list' is nil, save, reset and |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3690 redraw the widget immediately." |
17334 | 3691 (let* ((symbol (widget-value widget)) |
3692 (child (car (widget-get widget :children))) | |
25685 | 3693 (value (get symbol 'face-defface-spec)) |
3694 (comment-widget (widget-get widget :comment-widget))) | |
17334 | 3695 (unless value |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
3696 (error "No standard setting for this face")) |
17334 | 3697 (put symbol 'customized-face nil) |
25685 | 3698 (put symbol 'customized-face-comment nil) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
3699 (custom-push-theme 'theme-face symbol 'user 'reset) |
87486
a4cfa0059507
(custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
Richard M. Stallman <rms@gnu.org>
parents:
86334
diff
changeset
|
3700 (face-spec-set symbol value t) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
3701 (custom-theme-recalc-face symbol) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3702 (if (and custom-reset-standard-faces-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3703 (or (get symbol 'saved-face) (get symbol 'saved-face-comment))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3704 ;; Do this later. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3705 (progn |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3706 (put symbol 'saved-face nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3707 (put symbol 'saved-face-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3708 ;; Append this to `custom-reset-standard-faces-list' and have |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3709 ;; `custom-reset-standard-save-and-update' save setting to the |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3710 ;; file, update the widget's state, and redraw it. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3711 (setq custom-reset-standard-faces-list |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3712 (cons widget custom-reset-standard-faces-list))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3713 (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3714 (put symbol 'saved-face nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3715 (put symbol 'saved-face-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3716 (custom-save-all)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3717 (put symbol 'face-comment nil) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3718 (widget-value-set child |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3719 (custom-pre-filter-face-spec |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3720 (list (list t (custom-face-attributes-get |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3721 symbol nil))))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3722 ;; This call manages the comment visibility |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3723 (widget-value-set comment-widget "") |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3724 (custom-face-state-set widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3725 (custom-redraw-magic widget)))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3726 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3727 (defun custom-face-reset-standard (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3728 "Restore WIDGET to the face's standard attribute values. |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3729 This operation eliminates any saved attributes for the face, |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3730 restoring it to the state of a face that has never been customized." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3731 (let (custom-reset-standard-faces-list) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3732 (custom-face-mark-to-reset-standard widget))) |
17334 | 3733 |
3734 ;;; The `face' Widget. | |
3735 | |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3736 (defvar widget-face-prompt-value-history nil |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3737 "History of input to `widget-face-prompt-value'.") |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3738 |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3739 (define-widget 'face 'symbol |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3740 "A Lisp face name (with sample)." |
66941
1710aca8150f
(Custom-reset-standard): Verify that
Richard M. Stallman <rms@gnu.org>
parents:
66904
diff
changeset
|
3741 :format "%{%t%}: (%{sample%}) %v" |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3742 :tag "Face" |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3743 :value 'default |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3744 :sample-face-get 'widget-face-sample-face-get |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3745 :notify 'widget-face-notify |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3746 :match (lambda (widget value) (facep value)) |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3747 :complete-function (lambda () |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3748 (interactive) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3749 (lisp-complete-symbol 'facep)) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3750 :prompt-match 'facep |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3751 :prompt-history 'widget-face-prompt-value-history |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3752 :validate (lambda (widget) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3753 (unless (facep (widget-value widget)) |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3754 (widget-put widget |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3755 :error (format "Invalid face: %S" |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3756 (widget-value widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3757 widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3758 |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3759 (defun widget-face-sample-face-get (widget) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3760 (let ((value (widget-value widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3761 (if (facep value) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3762 value |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3763 'default))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3764 |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3765 (defun widget-face-notify (widget child &optional event) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3766 "Update the sample, and notify the parent." |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3767 (overlay-put (widget-get widget :sample-overlay) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3768 'face (widget-apply widget :sample-face-get)) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3769 (widget-default-notify widget child event)) |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3770 |
17334 | 3771 |
3772 ;;; The `hook' Widget. | |
3773 | |
3774 (define-widget 'hook 'list | |
73797
2e5ad09135ff
(hook): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
73795
diff
changeset
|
3775 "An Emacs Lisp hook." |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3776 :value-to-internal (lambda (widget value) |
19886
539d06d1f0da
(customize-group): Handle groups not yet loaded.
Richard M. Stallman <rms@gnu.org>
parents:
19883
diff
changeset
|
3777 (if (and value (symbolp value)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3778 (list value) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3779 value)) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3780 :match (lambda (widget value) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3781 (or (symbolp value) |
20174
e1ca1fe89e6e
(hook): Use `widget-group-match' instead of
Karl Heuer <kwzh@gnu.org>
parents:
20100
diff
changeset
|
3782 (widget-group-match widget value))) |
28130 | 3783 ;; Avoid adding undefined functions to the hook, especially for |
3784 ;; things like `find-file-hook' or even more basic ones, to avoid | |
3785 ;; chaos. | |
3786 :set (lambda (symbol value) | |
28310
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3787 (dolist (elt value) |
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3788 (if (fboundp elt) |
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3789 (add-hook symbol elt)))) |
17334 | 3790 :convert-widget 'custom-hook-convert-widget |
3791 :tag "Hook") | |
3792 | |
3793 (defun custom-hook-convert-widget (widget) | |
27250
807fc106b24c
(custom-hook-convert-widget): Fix comment.
Gerd Moellmann <gerd@gnu.org>
parents:
26803
diff
changeset
|
3794 ;; Handle `:options'. |
17334 | 3795 (let* ((options (widget-get widget :options)) |
25685 | 3796 (other `(editable-list :inline t |
17334 | 3797 :entry-format "%i %d%v" |
3798 (function :format " %v"))) | |
3799 (args (if options | |
3800 (list `(checklist :inline t | |
3801 ,@(mapcar (lambda (entry) | |
3802 `(function-item ,entry)) | |
3803 options)) | |
3804 other) | |
3805 (list other)))) | |
3806 (widget-put widget :args args) | |
3807 widget)) | |
3808 | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3809 ;;; The `custom-group-link' Widget. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3810 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3811 (define-widget 'custom-group-link 'link |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3812 "Show parent in other window when activated." |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
3813 :button-face 'custom-link |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
3814 :mouse-face 'highlight |
68892
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
3815 :pressed-face 'highlight |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
3816 :help-echo "Create customization buffer for this group." |
73795
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
3817 :keymap custom-mode-link-map |
4064a5037466
(custom-mode-map): Move defvar above code using it.
Chong Yidong <cyd@stupidchicken.com>
parents:
73762
diff
changeset
|
3818 :follow-link 'mouse-face |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3819 :action 'custom-group-link-action) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3820 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3821 (defun custom-group-link-action (widget &rest ignore) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3822 (customize-group (widget-value widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3823 |
17334 | 3824 ;;; The `custom-group' Widget. |
3825 | |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
3826 (defcustom custom-group-tag-faces nil |
17334 | 3827 ;; In XEmacs, this ought to play games with font size. |
25685 | 3828 ;; Fixme: make it do so in Emacs. |
17334 | 3829 "Face used for group tags. |
3830 The first member is used for level 1 groups, the second for level 2, | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3831 and so forth. The remaining group tags are shown with `custom-group-tag'." |
17334 | 3832 :type '(repeat face) |
17415 | 3833 :group 'custom-faces) |
17334 | 3834 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3835 (defface custom-group-tag-1 |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3836 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3837 (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3838 (:foreground "pink" :weight bold :height 1.2 :inherit variable-pitch)) |
61394
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3839 (((min-colors 88) (class color) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3840 (background light)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3841 (:foreground "red1" :weight bold :height 1.2 :inherit variable-pitch)) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3842 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3843 (background light)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3844 (:foreground "red" :weight bold :height 1.2 :inherit variable-pitch)) |
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3845 (t (:weight bold))) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3846 "Face used for group tags." |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3847 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
3848 (define-obsolete-face-alias 'custom-group-tag-face-1 'custom-group-tag-1 "22.1") |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3849 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3850 (defface custom-group-tag |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3851 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3852 (background dark)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
3853 (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch)) |
61394
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3854 (((min-colors 88) (class color) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3855 (background light)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
3856 (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch)) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3857 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3858 (background light)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
3859 (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3860 (t (:weight bold))) |
17334 | 3861 "Face used for low level group tags." |
17415 | 3862 :group 'custom-faces) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104543
diff
changeset
|
3863 (define-obsolete-face-alias 'custom-group-tag-face 'custom-group-tag "22.1") |
17334 | 3864 |
3865 (define-widget 'custom-group 'custom | |
3866 "Customize group." | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3867 :format "%v" |
17334 | 3868 :sample-face-get 'custom-group-sample-face-get |
3869 :documentation-property 'group-documentation | |
3870 :help-echo "Set or reset all members of this group." | |
3871 :value-create 'custom-group-value-create | |
3872 :action 'custom-group-action | |
18089 | 3873 :custom-category 'group |
17334 | 3874 :custom-set 'custom-group-set |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3875 :custom-mark-to-save 'custom-group-mark-to-save |
17334 | 3876 :custom-reset-current 'custom-group-reset-current |
3877 :custom-reset-saved 'custom-group-reset-saved | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3878 :custom-reset-standard 'custom-group-reset-standard |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3879 :custom-mark-to-reset-standard 'custom-group-mark-to-reset-standard |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
3880 :custom-state-set-and-redraw 'custom-group-state-set-and-redraw |
17334 | 3881 :custom-menu 'custom-group-menu-create) |
3882 | |
3883 (defun custom-group-sample-face-get (widget) | |
3884 ;; Use :sample-face. | |
3885 (or (nth (1- (widget-get widget :custom-level)) custom-group-tag-faces) | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3886 'custom-group-tag)) |
17334 | 3887 |
18430
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3888 (define-widget 'custom-group-visibility 'visibility |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3889 "An indicator and manipulator for hidden group contents." |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3890 :create 'custom-group-visibility-create) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3891 |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3892 (defun custom-group-visibility-create (widget) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3893 (let ((visible (widget-value widget))) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3894 (if visible |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3895 (insert "--------"))) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3896 (widget-default-create widget)) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3897 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3898 (defun custom-group-members (symbol groups-only) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3899 "Return SYMBOL's custom group members. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3900 If GROUPS-ONLY non-nil, return only those members that are groups." |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3901 (if (not groups-only) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3902 (get symbol 'custom-group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3903 (let (members) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3904 (dolist (entry (get symbol 'custom-group)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3905 (when (eq (nth 1 entry) 'custom-group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3906 (push entry members))) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3907 (nreverse members)))) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3908 |
17334 | 3909 (defun custom-group-value-create (widget) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3910 "Insert a customize group for WIDGET in the current buffer." |
49126
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
3911 (unless (eq (widget-get widget :custom-state) 'hidden) |
49300
b99be2b86231
(customize-changed-options): Undo last doc change.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49218
diff
changeset
|
3912 (custom-load-widget widget)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3913 (let* ((state (widget-get widget :custom-state)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3914 (level (widget-get widget :custom-level)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3915 ;; (indent (widget-get widget :indent)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3916 (prefix (widget-get widget :custom-prefix)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3917 (buttons (widget-get widget :buttons)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3918 (tag (widget-get widget :tag)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3919 (symbol (widget-value widget)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3920 (members (custom-group-members symbol |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3921 (and (eq custom-buffer-style 'tree) |
102101
93915a70e1a4
(custom-group-value-create): Don't throw an error
Martin Rudalics <rudalics@gmx.at>
parents:
100908
diff
changeset
|
3922 custom-browse-only-groups))) |
93915a70e1a4
(custom-group-value-create): Don't throw an error
Martin Rudalics <rudalics@gmx.at>
parents:
100908
diff
changeset
|
3923 (doc (widget-docstring widget))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3924 (cond ((and (eq custom-buffer-style 'tree) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3925 (eq state 'hidden) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3926 (or members (custom-unloaded-widget-p widget))) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3927 (custom-browse-insert-prefix prefix) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3928 (push (widget-create-child-and-convert |
25685 | 3929 widget 'custom-browse-visibility |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3930 ;; :tag-glyph "plus" |
18856
03eeb83520d8
(custom-group-value-create) <tree>: Don't distinguish
Richard M. Stallman <rms@gnu.org>
parents:
18812
diff
changeset
|
3931 :tag "+") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3932 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3933 (insert "-- ") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3934 ;; (widget-glyph-insert nil "-- " "horizontal") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3935 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3936 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3937 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3938 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3939 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3940 ((and (eq custom-buffer-style 'tree) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3941 (zerop (length members))) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3942 (custom-browse-insert-prefix prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3943 (insert "[ ]-- ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3944 ;; (widget-glyph-insert nil "[ ]" "empty") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3945 ;; (widget-glyph-insert nil "-- " "horizontal") |
25685 | 3946 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3947 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3948 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3949 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3950 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3951 ((eq custom-buffer-style 'tree) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3952 (custom-browse-insert-prefix prefix) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3953 (if (zerop (length members)) |
25685 | 3954 (progn |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3955 (custom-browse-insert-prefix prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3956 (insert "[ ]-- ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3957 ;; (widget-glyph-insert nil "[ ]" "empty") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3958 ;; (widget-glyph-insert nil "-- " "horizontal") |
25685 | 3959 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3960 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3961 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3962 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3963 (widget-put widget :buttons buttons)) |
25685 | 3964 (push (widget-create-child-and-convert |
3965 widget 'custom-browse-visibility | |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3966 ;; :tag-glyph "minus" |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3967 :tag "-") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3968 buttons) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3969 (insert "-\\ ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3970 ;; (widget-glyph-insert nil "-\\ " "top") |
25685 | 3971 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3972 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3973 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3974 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3975 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3976 (message "Creating group...") |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3977 (let* ((members (custom-sort-items |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3978 members |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3979 ;; Never sort the top-level custom group. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3980 (unless (eq symbol 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
3981 custom-browse-sort-alphabetically) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3982 custom-browse-order-groups)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3983 (prefixes (widget-get widget :custom-prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3984 (custom-prefix-list (custom-prefix-add symbol prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3985 (extra-prefix (if (widget-get widget :custom-last) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3986 " " |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3987 " | ")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3988 (prefix (concat prefix extra-prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3989 children entry) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3990 (while members |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3991 (setq entry (car members) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3992 members (cdr members)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3993 (push (widget-create-child-and-convert |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3994 widget (nth 1 entry) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3995 :group widget |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3996 :tag (custom-unlispify-tag-name (nth 0 entry)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3997 :custom-prefixes custom-prefix-list |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3998 :custom-level (1+ level) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3999 :custom-last (null members) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4000 :value (nth 0 entry) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4001 :custom-prefix prefix) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4002 children)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4003 (widget-put widget :children (reverse children))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4004 (message "Creating group...done"))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4005 ;; Nested style. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4006 ((eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4007 ;; Create level indicator. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4008 ;; Create tag. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4009 (if (eq custom-buffer-style 'links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4010 (push (widget-create-child-and-convert |
25685 | 4011 widget 'custom-group-link |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4012 :tag tag |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4013 symbol) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4014 buttons) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4015 (insert-char ?\ (* custom-buffer-indent (1- level))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4016 (insert "-- ") |
25685 | 4017 (push (widget-create-child-and-convert |
20100
0db4553d47cc
(custom-group-value-create): Use
Karl Heuer <kwzh@gnu.org>
parents:
19886
diff
changeset
|
4018 widget 'custom-group-visibility |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4019 :help-echo "Show members of this group." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4020 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4021 (not (eq state 'hidden))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4022 buttons)) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4023 (insert " : ") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4024 ;; Create magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4025 (let ((magic (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4026 widget 'custom-magic nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4027 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4028 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4029 ;; Update buttons. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4030 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4031 ;; Insert documentation. |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
4032 (if (and (eq custom-buffer-style 'links) (> level 1)) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
4033 (widget-put widget :documentation-indent 0)) |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
4034 (widget-add-documentation-string-button |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
4035 widget :visibility-widget 'custom-visibility)) |
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
4036 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4037 ;; Nested style. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4038 (t ;Visible. |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4039 ;; Draw a horizontal line (this works for both graphical |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4040 ;; and text displays): |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4041 (let ((p (point))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4042 (insert "\n") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4043 (put-text-property p (1+ p) 'face '(:underline t)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4044 (overlay-put (make-overlay p (1+ p)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4045 'before-string |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4046 (propertize "\n" 'face '(:underline t) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4047 'display '(space :align-to 999)))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4048 |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4049 ;; Add parent groups references above the group. |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4050 (when (eq level 1) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4051 (if (custom-add-parent-links widget "Parent groups:") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4052 (insert "\n"))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4053 (insert-char ?\ (* custom-buffer-indent (1- level))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4054 ;; Create tag. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4055 (let ((start (point))) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4056 (insert tag " group: ") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4057 (widget-specify-sample widget start (point))) |
102104
be12df124dbd
(custom-group-value-create): Insert some
Martin Rudalics <rudalics@gmx.at>
parents:
102101
diff
changeset
|
4058 (cond |
be12df124dbd
(custom-group-value-create): Insert some
Martin Rudalics <rudalics@gmx.at>
parents:
102101
diff
changeset
|
4059 ((not doc) |
be12df124dbd
(custom-group-value-create): Insert some
Martin Rudalics <rudalics@gmx.at>
parents:
102101
diff
changeset
|
4060 (insert " Group definition missing. ")) |
be12df124dbd
(custom-group-value-create): Insert some
Martin Rudalics <rudalics@gmx.at>
parents:
102101
diff
changeset
|
4061 ((< (length doc) 50) |
be12df124dbd
(custom-group-value-create): Insert some
Martin Rudalics <rudalics@gmx.at>
parents:
102101
diff
changeset
|
4062 (insert doc))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4063 ;; Create visibility indicator. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4064 (unless (eq custom-buffer-style 'links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4065 (insert "--------") |
25685 | 4066 (push (widget-create-child-and-convert |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4067 widget 'visibility |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4068 :help-echo "Hide members of this group." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4069 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4070 (not (eq state 'hidden))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4071 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4072 (insert " ")) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4073 (insert "\n") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4074 ;; Create magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4075 (let ((magic (widget-create-child-and-convert |
25685 | 4076 widget 'custom-magic |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4077 :indent 0 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4078 nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4079 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4080 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4081 ;; Update buttons. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4082 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4083 ;; Insert documentation. |
102101
93915a70e1a4
(custom-group-value-create): Don't throw an error
Martin Rudalics <rudalics@gmx.at>
parents:
100908
diff
changeset
|
4084 (when (and doc (>= (length doc) 50)) |
93915a70e1a4
(custom-group-value-create): Don't throw an error
Martin Rudalics <rudalics@gmx.at>
parents:
100908
diff
changeset
|
4085 (widget-add-documentation-string-button |
93915a70e1a4
(custom-group-value-create): Don't throw an error
Martin Rudalics <rudalics@gmx.at>
parents:
100908
diff
changeset
|
4086 widget :visibility-widget 'custom-visibility)) |
81429
fb627c8fac18
(custom-split-regexp-maybe): Simplify.
Chong Yidong <cyd@stupidchicken.com>
parents:
77997
diff
changeset
|
4087 |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4088 ;; Parent groups. |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4089 (if nil ;;; This should test that the buffer |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4090 ;;; was not made to display a group. |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4091 (when (eq level 1) |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4092 (insert-char ?\ custom-buffer-indent) |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
4093 (custom-add-parent-links widget))) |
25685 | 4094 (custom-add-see-also widget |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4095 (make-string (* custom-buffer-indent level) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4096 ?\ )) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4097 ;; Members. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4098 (message "Creating group...") |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4099 (let* ((members (custom-sort-items |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4100 members |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4101 ;; Never sort the top-level custom group. |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4102 (unless (eq symbol 'emacs) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4103 custom-buffer-sort-alphabetically) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4104 custom-buffer-order-groups)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4105 (prefixes (widget-get widget :custom-prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4106 (custom-prefix-list (custom-prefix-add symbol prefixes)) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4107 (len (length members)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4108 (count 0) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4109 (reporter (make-progress-reporter |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4110 "Creating group entries..." 0 len)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4111 children) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4112 (setq children |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4113 (mapcar |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4114 (lambda (entry) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4115 (widget-insert "\n") |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4116 (progress-reporter-update reporter (setq count (1+ count))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4117 (let ((sym (nth 0 entry)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4118 (type (nth 1 entry)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4119 hidden-p) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4120 (prog1 |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4121 (widget-create-child-and-convert |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4122 widget type |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4123 :group widget |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4124 :tag (custom-unlispify-tag-name sym) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4125 :custom-prefixes custom-prefix-list |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4126 :custom-level (1+ level) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4127 :value sym) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4128 (unless (eq (preceding-char) ?\n) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4129 (widget-insert "\n"))))) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4130 members)) |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
4131 (mapc 'custom-magic-reset children) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4132 (widget-put widget :children children) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4133 (custom-group-state-update widget) |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4134 (progress-reporter-done reporter)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4135 ;; End line |
109908
f5eee071d705
* cus-edit.el (custom-group-value-create): Add extra newline before end line (Bug#6876).
Chong Yidong <cyd@stupidchicken.com>
parents:
109751
diff
changeset
|
4136 (let ((p (1+ (point)))) |
f5eee071d705
* cus-edit.el (custom-group-value-create): Add extra newline before end line (Bug#6876).
Chong Yidong <cyd@stupidchicken.com>
parents:
109751
diff
changeset
|
4137 (insert "\n\n") |
107381
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4138 (put-text-property p (1+ p) 'face '(:underline t)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4139 (overlay-put (make-overlay p (1+ p)) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4140 'before-string |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4141 (propertize "\n" 'face '(:underline t) |
c97f25cea7c4
Improvements to the Custom interface.
Chong Yidong <cyd@stupidchicken.com>
parents:
107379
diff
changeset
|
4142 'display '(space :align-to 999)))))))) |
17334 | 4143 |
25685 | 4144 (defvar custom-group-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4145 `(("Set for Current Session" custom-group-set |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
4146 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
4147 (eq (widget-get widget :custom-state) 'modified))) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
4148 ,@(when (or custom-file init-file-user) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4149 '(("Save for Future Sessions" custom-group-save |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
4150 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
4151 (memq (widget-get widget :custom-state) '(modified set)))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4152 ("Undo Edits" custom-group-reset-current |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
4153 (lambda (widget) |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
4154 (memq (widget-get widget :custom-state) '(modified)))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4155 ("Reset to Saved" custom-group-reset-saved |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
4156 (lambda (widget) |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
4157 (memq (widget-get widget :custom-state) '(modified set)))) |
79040
853a17baf2b0
(custom-variable-menu, custom-face-menu)
Glenn Morris <rgm@gnu.org>
parents:
78803
diff
changeset
|
4158 ,@(when (or custom-file init-file-user) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4159 '(("Erase Customization" custom-group-reset-standard |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
4160 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
4161 (memq (widget-get widget :custom-state) '(modified set saved))))))) |
17334 | 4162 "Alist of actions for the `custom-group' widget. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4163 Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4164 the menu entry, ACTION is the function to call on the widget when the |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4165 menu is selected, and FILTER is a predicate which takes a `custom-group' |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4166 widget as an argument, and returns non-nil if ACTION is valid on that |
25685 | 4167 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 4168 |
4169 (defun custom-group-action (widget &optional event) | |
4170 "Show the menu for `custom-group' WIDGET. | |
4171 Optional EVENT is the location for the menu." | |
4172 (if (eq (widget-get widget :custom-state) 'hidden) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4173 (custom-toggle-hide widget) |
17334 | 4174 (let* ((completion-ignore-case t) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4175 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4176 (custom-unlispify-tag-name |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4177 (widget-get widget :value))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4178 (custom-menu-filter custom-group-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
4179 widget) |
17334 | 4180 event))) |
4181 (if answer | |
4182 (funcall answer widget))))) | |
4183 | |
4184 (defun custom-group-set (widget) | |
4185 "Set changes in all modified group members." | |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4186 (dolist (child (widget-get widget :children)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4187 (when (eq (widget-get child :custom-state) 'modified) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4188 (widget-apply child :custom-set)))) |
17334 | 4189 |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4190 (defun custom-group-mark-to-save (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4191 "Mark all modified group members for saving." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4192 (dolist (child (widget-get widget :children)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4193 (when (memq (widget-get child :custom-state) '(modified set)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4194 (widget-apply child :custom-mark-to-save)))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4195 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4196 (defsubst custom-group-state-set-and-redraw (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4197 "Set state of group widget WIDGET and redraw with current settings." |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4198 (dolist (child (widget-get widget :children)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4199 (when (memq (widget-get child :custom-state) '(modified set)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4200 (widget-apply child :custom-state-set-and-redraw)))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4201 |
17334 | 4202 (defun custom-group-save (widget) |
4203 "Save all modified group members." | |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4204 (custom-group-mark-to-save widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4205 (custom-save-all) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4206 (custom-group-state-set-and-redraw widget)) |
17334 | 4207 |
4208 (defun custom-group-reset-current (widget) | |
4209 "Reset all modified group members." | |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4210 (dolist (child (widget-get widget :children)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4211 (when (eq (widget-get child :custom-state) 'modified) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4212 (widget-apply child :custom-reset-current)))) |
17334 | 4213 |
4214 (defun custom-group-reset-saved (widget) | |
4215 "Reset all modified or set group members." | |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4216 (dolist (child (widget-get widget :children)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4217 (when (memq (widget-get child :custom-state) '(modified set)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4218 (widget-apply child :custom-reset-saved)))) |
17334 | 4219 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4220 (defun custom-group-reset-standard (widget) |
17334 | 4221 "Reset all modified, set, or saved group members." |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4222 (let ((custom-reset-standard-variables-list '(t)) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4223 (custom-reset-standard-faces-list '(t))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4224 (custom-group-mark-to-reset-standard widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4225 (custom-reset-standard-save-and-update))) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4226 |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4227 (defun custom-group-mark-to-reset-standard (widget) |
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4228 "Mark to reset all modified, set, or saved group members." |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4229 (dolist (child (widget-get widget :children)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4230 (when (memq (widget-get child :custom-state) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4231 '(modified set saved)) |
87795
299387a1f305
(custom-reset-standard-variables-list)
Martin Rudalics <rudalics@gmx.at>
parents:
87597
diff
changeset
|
4232 (widget-apply child :custom-mark-to-reset-standard)))) |
17334 | 4233 |
4234 (defun custom-group-state-update (widget) | |
4235 "Update magic." | |
4236 (unless (eq (widget-get widget :custom-state) 'hidden) | |
4237 (let* ((children (widget-get widget :children)) | |
4238 (states (mapcar (lambda (child) | |
4239 (widget-get child :custom-state)) | |
4240 children)) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4241 (magics custom-magic-alist) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4242 (found 'standard)) |
17334 | 4243 (while magics |
4244 (let ((magic (car (car magics)))) | |
4245 (if (and (not (eq magic 'hidden)) | |
4246 (memq magic states)) | |
4247 (setq found magic | |
4248 magics nil) | |
4249 (setq magics (cdr magics))))) | |
4250 (widget-put widget :custom-state found))) | |
4251 (custom-magic-reset widget)) | |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4252 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4253 ;;; Reading and writing the custom file. |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4254 |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
4255 ;;;###autoload |
19822
b5c12a2d1c26
*** empty log message ***
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19684
diff
changeset
|
4256 (defcustom custom-file nil |
17334 | 4257 "File used for storing customization information. |
19822
b5c12a2d1c26
*** empty log message ***
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19684
diff
changeset
|
4258 The default is nil, which means to use your init file |
58797
0b90a17a09e1
(custom-file): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
58779
diff
changeset
|
4259 as specified by `user-init-file'. If the value is not nil, |
0b90a17a09e1
(custom-file): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
58779
diff
changeset
|
4260 it should be an absolute file name. |
0b90a17a09e1
(custom-file): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
58779
diff
changeset
|
4261 |
59335
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4262 You can set this option through Custom, if you carefully read the |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4263 last paragraph below. However, usually it is simpler to write |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4264 something like the following in your init file: |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4265 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4266 \(setq custom-file \"~/.emacs-custom.el\") |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4267 \(load custom-file) |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4268 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4269 Note that both lines are necessary: the first line tells Custom to |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4270 save all customizations in this file, but does not load it. |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4271 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4272 When you change this variable outside Custom, look in the |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4273 previous custom file \(usually your init file) for the |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4274 forms `(custom-set-variables ...)' and `(custom-set-faces ...)', |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4275 and copy them (whichever ones you find) to the new custom file. |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4276 This will preserve your existing customizations. |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4277 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4278 If you save this option using Custom, Custom will write all |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4279 currently saved customizations, including the new one for this |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4280 option itself, into the file you specify, overwriting any |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4281 `custom-set-variables' and `custom-set-faces' forms already |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4282 present in that file. It will not delete any customizations from |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4283 the old custom file. You should do that manually if that is what you |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4284 want. You also have to put something like `\(load \"CUSTOM-FILE\") |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4285 in your init file, where CUSTOM-FILE is the actual name of the |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4286 file. Otherwise, Emacs will not load the file when it starts up, |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4287 and hence will not set `custom-file' to that file either." |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4288 :type '(choice (const :tag "Your Emacs init file" nil) |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4289 (file :format "%t:%v%d" |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4290 :doc |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4291 "Please read entire docstring below before setting \ |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4292 this through Custom. |
99298
225286546090
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
98001
diff
changeset
|
4293 Click on \"More\" \(or position point there and press RETURN) |
59335
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4294 if only the first line of the docstring is shown.")) |
17334 | 4295 :group 'customize) |
4296 | |
20974 | 4297 (defun custom-file () |
4298 "Return the file name for saving customizations." | |
62211
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4299 (file-chase-links |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4300 (or custom-file |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4301 (let ((user-init-file user-init-file) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4302 (default-init-file |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4303 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs"))) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4304 (when (null user-init-file) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4305 (if (or (file-exists-p default-init-file) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4306 (and (eq system-type 'windows-nt) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4307 (file-exists-p "~/_emacs"))) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4308 ;; Started with -q, i.e. the file containing |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4309 ;; Custom settings hasn't been read. Saving |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4310 ;; settings there would overwrite other settings. |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4311 (error "Saving settings from \"emacs -q\" would overwrite existing customizations")) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4312 (setq user-init-file default-init-file)) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4313 user-init-file)))) |
20974 | 4314 |
86219
16c8cf994132
(recentf-expand-file-name): Declare as function.
Glenn Morris <rgm@gnu.org>
parents:
85724
diff
changeset
|
4315 ;; If recentf-mode is non-nil, this is defined. |
16c8cf994132
(recentf-expand-file-name): Declare as function.
Glenn Morris <rgm@gnu.org>
parents:
85724
diff
changeset
|
4316 (declare-function recentf-expand-file-name "recentf" (name)) |
16c8cf994132
(recentf-expand-file-name): Declare as function.
Glenn Morris <rgm@gnu.org>
parents:
85724
diff
changeset
|
4317 |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4318 ;;;###autoload |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4319 (defun custom-save-all () |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4320 "Save all customizations in `custom-file'." |
73702
2bd04d2f629a
(custom-save-all): Error if saving in .emacs and it had an error when loaded.
Richard M. Stallman <rms@gnu.org>
parents:
73643
diff
changeset
|
4321 (when (and (null custom-file) init-file-had-error) |
2bd04d2f629a
(custom-save-all): Error if saving in .emacs and it had an error when loaded.
Richard M. Stallman <rms@gnu.org>
parents:
73643
diff
changeset
|
4322 (error "Cannot save customizations; init file was not fully loaded")) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4323 (let* ((filename (custom-file)) |
76100
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4324 (recentf-exclude |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4325 (if recentf-mode |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4326 (cons (concat "\\`" |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4327 (regexp-quote |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4328 (recentf-expand-file-name (custom-file))) |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4329 "\\'") |
3556f653e301
(custom-save-all): Canonicalize custom-file before storing it in
Eli Zaretskii <eliz@gnu.org>
parents:
75347
diff
changeset
|
4330 recentf-exclude))) |
97242
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4331 (old-buffer (find-buffer-visiting filename)) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4332 old-buffer-name) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4333 |
73942
a1e596bbf76d
(custom-save-all): Use find-file-visit-truename for visiting the custom file.
Richard M. Stallman <rms@gnu.org>
parents:
73797
diff
changeset
|
4334 (with-current-buffer (let ((find-file-visit-truename t)) |
a1e596bbf76d
(custom-save-all): Use find-file-visit-truename for visiting the custom file.
Richard M. Stallman <rms@gnu.org>
parents:
73797
diff
changeset
|
4335 (or old-buffer (find-file-noselect filename))) |
97242
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4336 ;; We'll save using file-precious-flag, so avoid destroying |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4337 ;; symlinks. (If we're not already visiting the buffer, this is |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4338 ;; handled by find-file-visit-truename, above.) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4339 (when old-buffer |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4340 (setq old-buffer-name (buffer-file-name)) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4341 (set-visited-file-name (file-chase-links filename))) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4342 |
73169
f11aa3b5788d
* cus-edit.el (custom-save-all): Switch to emacs-lisp mode before
Chong Yidong <cyd@stupidchicken.com>
parents:
73062
diff
changeset
|
4343 (unless (eq major-mode 'emacs-lisp-mode) |
f11aa3b5788d
* cus-edit.el (custom-save-all): Switch to emacs-lisp mode before
Chong Yidong <cyd@stupidchicken.com>
parents:
73062
diff
changeset
|
4344 (emacs-lisp-mode)) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4345 (let ((inhibit-read-only t)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4346 (custom-save-variables) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4347 (custom-save-faces)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4348 (let ((file-precious-flag t)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4349 (save-buffer)) |
97242
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4350 (if old-buffer |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4351 (progn |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4352 (set-visited-file-name old-buffer-name) |
cc5f94eeb1d8
(custom-save-all): Avoid destrying symlink if already visiting the
Chong Yidong <cyd@stupidchicken.com>
parents:
97142
diff
changeset
|
4353 (set-buffer-modified-p nil)) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4354 (kill-buffer (current-buffer)))))) |
67939
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4355 |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4356 ;;;###autoload |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4357 (defun customize-save-customized () |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4358 "Save all user options which have been set in this session." |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4359 (interactive) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4360 (mapatoms (lambda (symbol) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4361 (let ((face (get symbol 'customized-face)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4362 (value (get symbol 'customized-value)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4363 (face-comment (get symbol 'customized-face-comment)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4364 (variable-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4365 (get symbol 'customized-variable-comment))) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4366 (when face |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4367 (put symbol 'saved-face face) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4368 (custom-push-theme 'theme-face symbol 'user 'set value) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4369 (put symbol 'customized-face nil)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4370 (when value |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4371 (put symbol 'saved-value value) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4372 (custom-push-theme 'theme-value symbol 'user 'set value) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4373 (put symbol 'customized-value nil)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4374 (when variable-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4375 (put symbol 'saved-variable-comment variable-comment) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4376 (put symbol 'customized-variable-comment nil)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4377 (when face-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4378 (put symbol 'saved-face-comment face-comment) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4379 (put symbol 'customized-face-comment nil))))) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4380 ;; We really should update all custom buffers here. |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4381 (custom-save-all)) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4382 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4383 ;; Editing the custom file contents in a buffer. |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4384 |
17334 | 4385 (defun custom-save-delete (symbol) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4386 "Delete all calls to SYMBOL from the contents of the current buffer. |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4387 Leave point at the old location of the first such call, |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4388 or (if there were none) at the end of the buffer. |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4389 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4390 This function does not save the buffer." |
17334 | 4391 (goto-char (point-min)) |
25058
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4392 ;; Skip all whitespace and comments. |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4393 (while (forward-comment 1)) |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4394 (or (eobp) |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4395 (save-excursion (forward-sexp (buffer-size)))) ; Test for scan errors. |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4396 (let (first) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4397 (catch 'found |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4398 (while t ;; We exit this loop only via throw. |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4399 ;; Skip all whitespace and comments. |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4400 (while (forward-comment 1)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4401 (let ((start (point)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4402 (sexp (condition-case nil |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4403 (read (current-buffer)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4404 (end-of-file (throw 'found nil))))) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4405 (when (and (listp sexp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4406 (eq (car sexp) symbol)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4407 (delete-region start (point)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4408 (unless first |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4409 (setq first (point))))))) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4410 (if first |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4411 (goto-char first) |
36628
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4412 ;; Move in front of local variables, otherwise long Custom |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4413 ;; entries would make them ineffective. |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4414 (let ((pos (point-max)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4415 (case-fold-search t)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4416 (save-excursion |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4417 (goto-char (point-max)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4418 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4419 'move) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4420 (when (search-forward "Local Variables:" nil t) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4421 (setq pos (line-beginning-position)))) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4422 (goto-char pos))))) |
17334 | 4423 |
4424 (defun custom-save-variables () | |
4425 "Save all customized variables in `custom-file'." | |
4426 (save-excursion | |
4427 (custom-save-delete 'custom-set-variables) | |
25059
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4428 (let ((standard-output (current-buffer)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4429 (saved-list (make-list 1 0)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4430 sort-fold-case) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4431 ;; First create a sorted list of saved variables. |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4432 (mapatoms |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4433 (lambda (symbol) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4434 (if (and (get symbol 'saved-value) |
69004
f4a06252f47c
* cus-edit.el (custom-save-variables): Allow unthemed values.
Chong Yidong <cyd@stupidchicken.com>
parents:
68913
diff
changeset
|
4435 ;; ignore theme values |
f4a06252f47c
* cus-edit.el (custom-save-variables): Allow unthemed values.
Chong Yidong <cyd@stupidchicken.com>
parents:
68913
diff
changeset
|
4436 (or (null (get symbol 'theme-value)) |
f4a06252f47c
* cus-edit.el (custom-save-variables): Allow unthemed values.
Chong Yidong <cyd@stupidchicken.com>
parents:
68913
diff
changeset
|
4437 (eq 'user (caar (get symbol 'theme-value))))) |
25059
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4438 (nconc saved-list (list symbol))))) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4439 (setq saved-list (sort (cdr saved-list) 'string<)) |
17334 | 4440 (unless (bolp) |
4441 (princ "\n")) | |
26653
ea8ae3c8fad5
(custom-save-variables, custom-save-faces): Write a
Dave Love <fx@gnu.org>
parents:
26625
diff
changeset
|
4442 (princ "(custom-set-variables |
109751
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4443 ;; custom-set-variables was added by Custom. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4444 ;; If you edit it by hand, you could mess it up, so be careful. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4445 ;; Your init file should contain only one such instance. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4446 ;; If there is more than one, they won't work right.\n") |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4447 (dolist (symbol saved-list) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4448 (let ((spec (car-safe (get symbol 'theme-value))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4449 (value (get symbol 'saved-value)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4450 (requests (get symbol 'custom-requests)) |
72588
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4451 (now (and (not (custom-variable-p symbol)) |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4452 (or (boundp symbol) |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4453 (eq (get symbol 'force-value) |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4454 'rogue)))) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
4455 (comment (get symbol 'saved-variable-comment))) |
73797
2e5ad09135ff
(hook): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
73795
diff
changeset
|
4456 ;; Check REQUESTS for validity. |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4457 (dolist (request requests) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4458 (when (and (symbolp request) (not (featurep request))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4459 (message "Unknown requested feature: %s" request) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4460 (setq requests (delq request requests)))) |
72588
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4461 ;; Is there anything customized about this variable? |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4462 (when (or (and spec (eq (car spec) 'user)) |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4463 comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4464 (and (null spec) (get symbol 'saved-value))) |
72588
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4465 ;; Output an element for this variable. |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4466 ;; It has the form (SYMBOL VALUE-FORM NOW REQUESTS COMMENT). |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4467 ;; SYMBOL is the variable name. |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4468 ;; VALUE-FORM is an expression to return the customized value. |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4469 ;; NOW if non-nil means always set the variable immediately |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4470 ;; when the customizations are reloaded. This is used |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4471 ;; for rogue variables |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4472 ;; REQUESTS is a list of packages to load before setting the |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4473 ;; variable. Each element of it will be passed to `require'. |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4474 ;; COMMENT is whatever comment the user has specified |
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4475 ;; with the customize facility. |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4476 (unless (bolp) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4477 (princ "\n")) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4478 (princ " '(") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4479 (prin1 symbol) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4480 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4481 (prin1 (car value)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4482 (when (or now requests comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4483 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4484 (prin1 now) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4485 (when (or requests comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4486 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4487 (prin1 requests) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4488 (when comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4489 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4490 (prin1 comment)))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4491 (princ ")")))) |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4492 (if (bolp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4493 (princ " ")) |
17334 | 4494 (princ ")") |
4495 (unless (looking-at "\n") | |
4496 (princ "\n"))))) | |
4497 | |
4498 (defun custom-save-faces () | |
4499 "Save all customized faces in `custom-file'." | |
4500 (save-excursion | |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
4501 (custom-save-delete 'custom-reset-faces) |
17334 | 4502 (custom-save-delete 'custom-set-faces) |
25059
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4503 (let ((standard-output (current-buffer)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4504 (saved-list (make-list 1 0)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4505 sort-fold-case) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4506 ;; First create a sorted list of saved faces. |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4507 (mapatoms |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4508 (lambda (symbol) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4509 (if (and (get symbol 'saved-face) |
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4510 (eq 'user (car (car-safe (get symbol 'theme-face))))) |
25059
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4511 (nconc saved-list (list symbol))))) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4512 (setq saved-list (sort (cdr saved-list) 'string<)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4513 ;; The default face must be first, since it affects the others. |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4514 (if (memq 'default saved-list) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4515 (setq saved-list (cons 'default (delq 'default saved-list)))) |
17334 | 4516 (unless (bolp) |
4517 (princ "\n")) | |
26653
ea8ae3c8fad5
(custom-save-variables, custom-save-faces): Write a
Dave Love <fx@gnu.org>
parents:
26625
diff
changeset
|
4518 (princ "(custom-set-faces |
109751
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4519 ;; custom-set-faces was added by Custom. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4520 ;; If you edit it by hand, you could mess it up, so be careful. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4521 ;; Your init file should contain only one such instance. |
90428e3ef1f1
* lisp/cus-edit.el (custom-save-variables, custom-save-faces): Fix up
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
108024
diff
changeset
|
4522 ;; If there is more than one, they won't work right.\n") |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4523 (dolist (symbol saved-list) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4524 (let ((spec (car-safe (get symbol 'theme-face))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4525 (value (get symbol 'saved-face)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4526 (now (not (or (get symbol 'face-defface-spec) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4527 (and (not (custom-facep symbol)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4528 (not (get symbol 'force-face)))))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4529 (comment (get symbol 'saved-face-comment))) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4530 (when (or (and spec (eq (nth 0 spec) 'user)) |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4531 comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4532 (and (null spec) (get symbol 'saved-face))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4533 ;; Don't print default face here. |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4534 (unless (bolp) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4535 (princ "\n")) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4536 (princ " '(") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4537 (prin1 symbol) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4538 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4539 (prin1 value) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4540 (when (or now comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4541 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4542 (prin1 now) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4543 (when comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4544 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4545 (prin1 comment))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4546 (princ ")")))) |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4547 (if (bolp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4548 (princ " ")) |
17334 | 4549 (princ ")") |
4550 (unless (looking-at "\n") | |
48958
6b4f6412de76
(custom-save-faces): Fix typo.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48949
diff
changeset
|
4551 (princ "\n"))))) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4552 |
17334 | 4553 ;;; The Customize Menu. |
4554 | |
17415 | 4555 ;;; Menu support |
4556 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4557 (defcustom custom-menu-nesting 2 |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4558 "Maximum nesting in custom menus." |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4559 :type 'integer |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
4560 :group 'custom-menu) |
17334 | 4561 |
4562 (defun custom-face-menu-create (widget symbol) | |
4563 "Ignoring WIDGET, create a menu entry for customization face SYMBOL." | |
4564 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4565 `(customize-face ',symbol) |
17334 | 4566 t)) |
4567 | |
4568 (defun custom-variable-menu-create (widget symbol) | |
4569 "Ignoring WIDGET, create a menu entry for customization variable SYMBOL." | |
4570 (let ((type (get symbol 'custom-type))) | |
4571 (unless (listp type) | |
4572 (setq type (list type))) | |
4573 (if (and type (widget-get type :custom-menu)) | |
4574 (widget-apply type :custom-menu symbol) | |
4575 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4576 `(customize-variable ',symbol) |
17334 | 4577 t)))) |
4578 | |
17415 | 4579 ;; Add checkboxes to boolean variable entries. |
17334 | 4580 (widget-put (get 'boolean 'widget-type) |
4581 :custom-menu (lambda (widget symbol) | |
4582 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4583 `(customize-variable ',symbol) |
17334 | 4584 ':style 'toggle |
4585 ':selected symbol))) | |
4586 | |
30184
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4587 (defun custom-group-menu-create (widget symbol) |
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4588 "Ignoring WIDGET, create a menu entry for customization group SYMBOL." |
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4589 `( ,(custom-unlispify-menu-entry symbol t) |
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4590 :filter (lambda (&rest junk) |
72715
b51738f67f62
(custom-menu-create): Bind deactivate-mark here
Richard M. Stallman <rms@gnu.org>
parents:
72629
diff
changeset
|
4591 (let* ((menu (custom-menu-create ',symbol))) |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4592 (if (consp menu) (cdr menu) menu))))) |
17334 | 4593 |
17415 | 4594 ;;;###autoload |
4595 (defun custom-menu-create (symbol) | |
17334 | 4596 "Create menu for customization group SYMBOL. |
4597 The menu is in a format applicable to `easy-menu-define'." | |
72715
b51738f67f62
(custom-menu-create): Bind deactivate-mark here
Richard M. Stallman <rms@gnu.org>
parents:
72629
diff
changeset
|
4598 (let* ((deactivate-mark nil) |
b51738f67f62
(custom-menu-create): Bind deactivate-mark here
Richard M. Stallman <rms@gnu.org>
parents:
72629
diff
changeset
|
4599 (item (vector (custom-unlispify-menu-entry symbol) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4600 `(customize-group ',symbol) |
17415 | 4601 t))) |
4602 (if (and (or (not (boundp 'custom-menu-nesting)) | |
4603 (>= custom-menu-nesting 0)) | |
49126
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4604 (progn |
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4605 (custom-load-symbol symbol) |
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4606 (< (length (get symbol 'custom-group)) widget-menu-max-size))) |
17334 | 4607 (let ((custom-prefix-list (custom-prefix-add symbol |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4608 custom-prefix-list)) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4609 (members (custom-sort-items (get symbol 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4610 custom-menu-sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4611 custom-menu-order-groups))) |
17334 | 4612 `(,(custom-unlispify-menu-entry symbol t) |
4613 ,item | |
4614 "--" | |
4615 ,@(mapcar (lambda (entry) | |
4616 (widget-apply (if (listp (nth 1 entry)) | |
4617 (nth 1 entry) | |
4618 (list (nth 1 entry))) | |
4619 :custom-menu (nth 0 entry))) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4620 members))) |
17334 | 4621 item))) |
4622 | |
4623 ;;;###autoload | |
17415 | 4624 (defun customize-menu-create (symbol &optional name) |
4625 "Return a customize menu for customization group SYMBOL. | |
25685 | 4626 If optional NAME is given, use that as the name of the menu. |
17415 | 4627 Otherwise the menu will be named `Customize'. |
4628 The format is suitable for use with `easy-menu-define'." | |
4629 (unless name | |
4630 (setq name "Customize")) | |
30184
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4631 `(,name |
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4632 :filter (lambda (&rest junk) |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4633 (let ((menu (custom-menu-create ',symbol))) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4634 (if (consp menu) (cdr menu) menu))))) |
17334 | 4635 |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4636 ;;; Toolbar and menubar support |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4637 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4638 (easy-menu-define |
86232
74f276f67957
(custom-field-keymap): Move to other Custom mode
Martin Rudalics <rudalics@gmx.at>
parents:
86219
diff
changeset
|
4639 Custom-mode-menu (list custom-mode-map custom-field-keymap) |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4640 "Menu used in customization buffers." |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4641 (nconc (list "Custom" |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4642 (customize-menu-create 'customize)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4643 (mapcar (lambda (arg) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4644 (let ((tag (nth 0 arg)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4645 (command (nth 1 arg)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4646 (active (nth 2 arg)) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4647 (help (nth 3 arg))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4648 (vector tag command :active (eval active) :help help))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4649 custom-commands))) |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4650 |
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4651 (defvar tool-bar-map) |
87597
d71a9a15e3d2
(custom-tool-bar-map): Move initialization of this
Martin Rudalics <rudalics@gmx.at>
parents:
87519
diff
changeset
|
4652 |
d71a9a15e3d2
(custom-tool-bar-map): Move initialization of this
Martin Rudalics <rudalics@gmx.at>
parents:
87519
diff
changeset
|
4653 ;;; `custom-tool-bar-map' used to be set up here. This will fail to |
d71a9a15e3d2
(custom-tool-bar-map): Move initialization of this
Martin Rudalics <rudalics@gmx.at>
parents:
87519
diff
changeset
|
4654 ;;; DTRT when `display-graphic-p' returns nil during compilation. Hence |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4655 ;;; we set this up lazily in `Custom-mode'. |
87597
d71a9a15e3d2
(custom-tool-bar-map): Move initialization of this
Martin Rudalics <rudalics@gmx.at>
parents:
87519
diff
changeset
|
4656 (defvar custom-tool-bar-map nil |
d71a9a15e3d2
(custom-tool-bar-map): Move initialization of this
Martin Rudalics <rudalics@gmx.at>
parents:
87519
diff
changeset
|
4657 "Keymap for toolbar in Custom mode.") |
81707
cfd3797706aa
(custom-commands): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
81429
diff
changeset
|
4658 |
17415 | 4659 ;;; The Custom Mode. |
4660 | |
72588
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4661 (defun Custom-no-edit (pos &optional event) |
72149
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
4662 "Invoke button at POS, or refuse to allow editing of Custom buffer." |
dd56da5d679d
(customize-package-emacs-version-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
71953
diff
changeset
|
4663 (interactive "@d") |
72159
97e2fe60196f
* cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that
Chong Yidong <cyd@stupidchicken.com>
parents:
72149
diff
changeset
|
4664 (error "You can't edit this part of the Custom buffer")) |
71847
61f3d6be1e92
(custom-no-edit): New command.
Richard M. Stallman <rms@gnu.org>
parents:
71438
diff
changeset
|
4665 |
72588
97860dfadca5
(custom-save-variables): Slight cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
72409
diff
changeset
|
4666 (defun Custom-newline (pos &optional event) |
72409
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4667 "Invoke button at POS, or refuse to allow editing of Custom buffer." |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4668 (interactive "@d") |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4669 (let ((button (get-char-property pos 'button))) |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4670 (if button |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4671 (widget-apply-action button event) |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4672 (error "You can't edit this part of the Custom buffer")))) |
4130a8f38950
(custom-newline): New function.
Richard M. Stallman <rms@gnu.org>
parents:
72159
diff
changeset
|
4673 |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4674 (defun Custom-goto-parent () |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4675 "Go to the parent group listed at the top of this buffer. |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4676 If several parents are listed, go to the first of them." |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4677 (interactive) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4678 (save-excursion |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4679 (goto-char (point-min)) |
78377
8a9d5af6fdf2
Fix parent groups link
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
78236
diff
changeset
|
4680 (if (search-forward "\nParent groups: " nil t) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4681 (let* ((button (get-char-property (point) 'button)) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4682 (parent (downcase (widget-get button :tag)))) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4683 (customize-group parent))))) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4684 |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4685 (defcustom Custom-mode-hook nil |
25685 | 4686 "Hook called when entering Custom mode." |
17415 | 4687 :type 'hook |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4688 :group 'custom-buffer) |
17415 | 4689 |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4690 (defun custom-state-buffer-message (widget) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4691 (if (eq (widget-get (widget-get widget :parent) :custom-state) 'modified) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4692 (message "To install your edits, invoke [State] and choose the Set operation"))) |
18430
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
4693 |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4694 (define-derived-mode Custom-mode nil "Custom" |
17415 | 4695 "Major mode for editing customization buffers. |
4696 | |
4697 The following commands are available: | |
4698 | |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4699 \\<widget-keymap>\ |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4700 Move to next button, link or editable field. \\[widget-forward] |
104988
3edc5799260a
(Custom-mode): Don't use advertised-widget-backward in the docstring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104778
diff
changeset
|
4701 Move to previous button, link or editable field. \\[widget-backward] |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4702 \\<custom-field-keymap>\ |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4703 Complete content of editable text field. \\[widget-complete] |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4704 \\<custom-mode-map>\ |
68913
08407ff48591
* cus-edit.el (custom-mode): Update docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
68911
diff
changeset
|
4705 Invoke button under the mouse pointer. \\[widget-button-click] |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4706 Invoke button under point. \\[widget-button-press] |
67970
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
4707 Set all options from current text. \\[Custom-set] |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
4708 Make values in current text permanent. \\[Custom-save] |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4709 Make text match actual option values. \\[Custom-reset-current] |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4710 Reset options to permanent settings. \\[Custom-reset-saved] |
67970
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
4711 Erase customizations; set options |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
4712 and buffer text to the standard values. \\[Custom-reset-standard] |
17415 | 4713 |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4714 Entry to this mode calls the value of `Custom-mode-hook' |
17415 | 4715 if that value is non-nil." |
4716 (use-local-map custom-mode-map) | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
4717 (easy-menu-add Custom-mode-menu) |
99481
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4718 (set (make-local-variable 'tool-bar-map) |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4719 (or custom-tool-bar-map |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4720 ;; Set up `custom-tool-bar-map'. |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4721 (let ((map (make-sparse-keymap))) |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4722 (mapc |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4723 (lambda (arg) |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4724 (tool-bar-local-item-from-menu |
108024
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
4725 (nth 1 arg) (nth 4 arg) map custom-mode-map |
4d8277a44bb4
Gtk tool bars can be text, icons with text or just icons.
Jan D. <jan.h.d@swipnet.se>
parents:
107723
diff
changeset
|
4726 :label (nth 5 arg))) |
99481
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4727 custom-commands) |
54d148d6078b
(Custom-mode): Set up tool-bar-map unconditionally.
Chong Yidong <cyd@stupidchicken.com>
parents:
99404
diff
changeset
|
4728 (setq custom-tool-bar-map map)))) |
17415 | 4729 (make-local-variable 'custom-options) |
50283
73ab8e5b6d65
2003-03-24 Luc Teirlinck <teirllm@mail.auburn.edu>
John Paul Wallington <jpw@pobox.com>
parents:
50077
diff
changeset
|
4730 (make-local-variable 'custom-local-buffer) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4731 (make-local-variable 'widget-documentation-face) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
4732 (setq widget-documentation-face 'custom-documentation) |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
4733 (make-local-variable 'widget-button-face) |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
4734 (setq widget-button-face custom-button) |
86334
005ad07af670
(custom-mode): Define with `define-derived-mode'.
Juanma Barranquero <lekktu@gmail.com>
parents:
86232
diff
changeset
|
4735 (setq show-trailing-whitespace nil) |
73194
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4736 |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4737 ;; We need this because of the "More" button on docstrings. |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4738 ;; Otherwise clicking on "More" can push point offscreen, which |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4739 ;; causes the window to recenter on point, which pushes the |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4740 ;; newly-revealed docstring offscreen; which is annoying. -- cyd. |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4741 (set (make-local-variable 'widget-button-click-moves-point) t) |
1a9d85f409b8
* wid-edit.el (widget-button-click-moves-point): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
73169
diff
changeset
|
4742 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
4743 (set (make-local-variable 'widget-button-pressed-face) custom-button-pressed) |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
4744 (set (make-local-variable 'widget-mouse-face) custom-button-mouse) |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
4745 |
25685 | 4746 ;; When possible, use relief for buttons, not bracketing. This test |
4747 ;; may not be optimal. | |
4748 (when custom-raised-buttons | |
4749 (set (make-local-variable 'widget-push-button-prefix) "") | |
4750 (set (make-local-variable 'widget-push-button-suffix) "") | |
4751 (set (make-local-variable 'widget-link-prefix) "") | |
4752 (set (make-local-variable 'widget-link-suffix) "")) | |
86334
005ad07af670
(custom-mode): Define with `define-derived-mode'.
Juanma Barranquero <lekktu@gmail.com>
parents:
86232
diff
changeset
|
4753 (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t)) |
17334 | 4754 |
92307
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4755 (put 'Custom-mode 'mode-class 'special) |
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4756 |
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4757 ;; backward-compatibility |
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4758 (defun custom-mode () |
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4759 "Non-interactive variant of `Custom-mode'." |
55f83f57568d
(custom-mode-map, custom-mode-link-map):
Juri Linkov <juri@jurta.org>
parents:
87795
diff
changeset
|
4760 (Custom-mode)) |
92321
01ce588fc626
(custom-mode, custom-mode-hook): Use 23.1 as version
Juanma Barranquero <lekktu@gmail.com>
parents:
92307
diff
changeset
|
4761 (make-obsolete 'custom-mode 'Custom-mode "23.1") |
32904
2109c5fb0c3f
(custom-mode): Add `special' mode-class property.
Dave Love <fx@gnu.org>
parents:
32883
diff
changeset
|
4762 (put 'custom-mode 'mode-class 'special) |
92321
01ce588fc626
(custom-mode, custom-mode-hook): Use 23.1 as version
Juanma Barranquero <lekktu@gmail.com>
parents:
92307
diff
changeset
|
4763 (define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1") |
32904
2109c5fb0c3f
(custom-mode): Add `special' mode-class property.
Dave Love <fx@gnu.org>
parents:
32883
diff
changeset
|
4764 |
71438
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4765 (dolist (regexp |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4766 '("^No user option defaults have been changed since Emacs " |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4767 "^Invalid face:? " |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4768 "^No \\(?:customized\\|rogue\\|saved\\) user options" |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4769 "^No customizable items matching " |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4770 "^There are unset changes" |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4771 "^Cannot set hidden variable" |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4772 "^No \\(?:saved\\|backup\\) value for " |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4773 "^No standard setting known for " |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4774 "^No standard setting for this face" |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4775 "^Saving settings from \"emacs -q\" would overwrite existing customizations")) |
2c067711ec9e
(customize-apropos): A better error message.
Eli Zaretskii <eliz@gnu.org>
parents:
71390
diff
changeset
|
4776 (add-to-list 'debug-ignored-errors regexp)) |
28130 | 4777 |
17334 | 4778 ;;; The End. |
4779 | |
4780 (provide 'cus-edit) | |
4781 | |
59759
c8a0d09474af
(customize-group-other-window, custom-buffer-create-other-window):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59434
diff
changeset
|
4782 ;; arch-tag: 64533aa4-1b1a-48c3-8812-f9dc718e8a6f |
25685 | 4783 ;;; cus-edit.el ends here |