Mercurial > emacs
annotate lisp/cus-edit.el @ 69595:f57904524ef9
(x_term_init): Remove unnecessary GCPRO.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 20 Mar 2006 06:23:55 +0000 |
parents | a22167168ac4 |
children | efd1add5bedf e3bacb89536a |
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 ;; |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64494
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
4 ;; 2005, 2006 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 |
9 | |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
10 ;; 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
|
11 |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
14 ;; the Free Software Foundation; either version 2, or (at your option) |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
15 ;; any later version. |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
16 |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
17 ;; 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
|
18 ;; 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
|
19 ;; 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
|
20 ;; 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
|
21 |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 ;; Boston, MA 02110-1301, USA. | |
17521
ddce9ecc6f6a
(custom-face-set): Don't copy an empty face,
Richard M. Stallman <rms@gnu.org>
parents:
17415
diff
changeset
|
26 |
17334 | 27 ;;; Commentary: |
28 ;; | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
29 ;; 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
|
30 ;; |
17334 | 31 ;; See `custom.el'. |
32 | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
33 ;; 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
|
34 ;; 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
|
35 ;; 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
|
36 |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
37 ;; The identity of a customize option is represented by a Lisp symbol. |
60214 | 38 ;; 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
|
39 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
40 ;; 0. The current value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
41 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
42 ;; 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
|
43 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
44 ;; 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
|
45 ;; 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
|
46 ;; 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
|
47 ;; can set it. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
48 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
49 ;; 1. The widget value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
50 |
60214 | 51 ;; 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
|
52 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
53 ;; 2. The customized value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
54 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
55 ;; 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
|
56 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
57 ;; It is stored in the 'customized-value' property of the option, in a |
60214 | 58 ;; 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
|
59 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
60 ;; 3. The saved value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
61 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
62 ;; 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
|
63 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
64 ;; It is stored in the 'saved-value' property of the option, in a |
60214 | 65 ;; 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
|
66 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
67 ;; 4. The standard value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
68 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
69 ;; 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
|
70 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
71 ;; It is stored in the 'standard-value' property of the option, in a |
60214 | 72 ;; 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
|
73 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
74 ;; 5. The "think" value. |
60214 | 75 |
76 ;; This is what customize thinks the current value should be. | |
77 | |
78 ;; 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
|
79 ;; the saved value, if that exists, and as a last resort the standard |
60214 | 80 ;; value. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
81 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
82 ;; 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
|
83 ;; values that depend on the environment. For example, you can have a |
60214 | 84 ;; 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
|
85 ;; system, and another value on a tty. Since the evaluation is only done |
60214 | 86 ;; 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
|
87 ;; 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
|
88 ;; compatibility. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
89 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
90 ;; 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
|
91 ;; "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
|
92 ;; 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
|
93 ;; unevaluated standard value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
94 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
95 ;; 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
|
96 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
97 ;; 0. unknown |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
98 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
99 ;; 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
|
100 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
101 ;; 1. modified |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
102 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
103 ;; 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
|
104 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
105 ;; 2. changed |
60214 | 106 |
107 ;; 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
|
108 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
109 ;; 3. set |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
110 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
111 ;; 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
|
112 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
113 ;; 4. saved |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
114 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
115 ;; 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
|
116 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
117 ;; 5. standard |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
118 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
119 ;; 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
|
120 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
121 ;; 6. rogue |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
122 |
60214 | 123 ;; 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
|
124 ;; not defined with defcustom, nor handled in cus-start.el. Most |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
125 ;; standard interactive Custom commands do not let you create a |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
126 ;; Custom buffer containing such variables. However, such Custom |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
127 ;; buffers can be created, for instance, by calling |
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
128 ;; `customize-apropos' with a prefix arg or by calling |
60296 | 129 ;; `customize-option' non-interactively. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
130 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
131 ;; 7. hidden |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
132 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
133 ;; There is no widget value. |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
134 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
135 ;; 8. mismatch |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
136 |
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
137 ;; The widget value is not valid member of the :type specified for the |
60214 | 138 ;; option. |
60004
2832745c4aee
(custom-buffer-create-internal): Improve help-echo.
Richard M. Stallman <rms@gnu.org>
parents:
59996
diff
changeset
|
139 |
17334 | 140 ;;; Code: |
141 | |
142 (require 'cus-face) | |
143 (require 'wid-edit) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
144 (eval-when-compile |
64931
94a635fcc582
(custom-save-all, custom-save-delete): Bind recentf-exclude to exclude
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
145 (defvar custom-versions-load-alist) ; from cus-load |
94a635fcc582
(custom-save-all, custom-save-delete): Bind recentf-exclude to exclude
Eli Zaretskii <eliz@gnu.org>
parents:
64762
diff
changeset
|
146 (defvar recentf-exclude)) ; from recentf.el |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
147 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
148 (condition-case nil |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
149 (require 'cus-load) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
150 (error nil)) |
17334 | 151 |
18089 | 152 (condition-case nil |
153 (require 'cus-start) | |
154 (error nil)) | |
155 | |
17415 | 156 (put 'custom-define-hook 'custom-type 'hook) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
157 (put 'custom-define-hook 'standard-value '(nil)) |
17415 | 158 (custom-add-to-group 'customize 'custom-define-hook 'custom-variable) |
159 | |
17334 | 160 ;;; Customization Groups. |
161 | |
162 (defgroup emacs nil | |
163 "Customization of the One True Editor." | |
164 :link '(custom-manual "(emacs)Top")) | |
165 | |
166 ;; Most of these groups are stolen from `finder.el', | |
167 (defgroup editing nil | |
168 "Basic text editing facilities." | |
169 :group 'emacs) | |
170 | |
171 (defgroup abbrev nil | |
172 "Abbreviation handling, typing shortcuts, macros." | |
173 :tag "Abbreviations" | |
174 :group 'editing) | |
175 | |
176 (defgroup matching nil | |
177 "Various sorts of searching and matching." | |
178 :group 'editing) | |
179 | |
180 (defgroup emulations nil | |
181 "Emulations of other editors." | |
52281 | 182 :link '(custom-manual "(emacs)Emulation") |
17334 | 183 :group 'editing) |
184 | |
185 (defgroup mouse nil | |
186 "Mouse support." | |
187 :group 'editing) | |
188 | |
189 (defgroup outlines nil | |
190 "Support for hierarchical outlining." | |
191 :group 'editing) | |
192 | |
193 (defgroup external nil | |
194 "Interfacing to external utilities." | |
195 :group 'emacs) | |
196 | |
197 (defgroup processes nil | |
198 "Process, subshell, compilation, and job control support." | |
199 :group 'external | |
200 :group 'development) | |
201 | |
22068
82db88d21acd
(convenience): New group.
Richard M. Stallman <rms@gnu.org>
parents:
22001
diff
changeset
|
202 (defgroup convenience nil |
82db88d21acd
(convenience): New group.
Richard M. Stallman <rms@gnu.org>
parents:
22001
diff
changeset
|
203 "Convenience features for faster editing." |
82db88d21acd
(convenience): New group.
Richard M. Stallman <rms@gnu.org>
parents:
22001
diff
changeset
|
204 :group 'emacs) |
82db88d21acd
(convenience): New group.
Richard M. Stallman <rms@gnu.org>
parents:
22001
diff
changeset
|
205 |
17334 | 206 (defgroup programming nil |
207 "Support for programming in other languages." | |
208 :group 'emacs) | |
209 | |
210 (defgroup languages nil | |
211 "Specialized modes for editing programming languages." | |
212 :group 'programming) | |
213 | |
214 (defgroup lisp nil | |
215 "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
|
216 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
17334 | 217 :group 'languages |
218 :group 'development) | |
219 | |
220 (defgroup c nil | |
221 "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
|
222 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
52281 | 223 :link '(custom-manual "(ccmode)") |
17334 | 224 :group 'languages) |
225 | |
226 (defgroup tools nil | |
227 "Programming tools." | |
228 :group 'programming) | |
229 | |
230 (defgroup oop nil | |
231 "Support for object-oriented programming." | |
232 :group 'programming) | |
233 | |
234 (defgroup applications nil | |
235 "Applications written in Emacs." | |
236 :group 'emacs) | |
237 | |
238 (defgroup calendar nil | |
239 "Calendar and time management support." | |
240 :group 'applications) | |
241 | |
242 (defgroup mail nil | |
243 "Modes for electronic-mail handling." | |
244 :group 'applications) | |
245 | |
246 (defgroup news nil | |
247 "Support for netnews reading and posting." | |
52281 | 248 :link '(custom-manual "(gnus)") |
17334 | 249 :group 'applications) |
250 | |
251 (defgroup games nil | |
252 "Games, jokes and amusements." | |
253 :group 'applications) | |
254 | |
255 (defgroup development nil | |
256 "Support for further development of Emacs." | |
257 :group 'emacs) | |
258 | |
259 (defgroup docs nil | |
260 "Support for Emacs documentation." | |
261 :group 'development) | |
262 | |
263 (defgroup extensions nil | |
264 "Emacs Lisp language extensions." | |
265 :group 'development) | |
266 | |
267 (defgroup internal nil | |
268 "Code for Emacs internals, build process, defaults." | |
269 :group 'development) | |
270 | |
271 (defgroup maint nil | |
272 "Maintenance aids for the Emacs development group." | |
273 :tag "Maintenance" | |
274 :group 'development) | |
275 | |
276 (defgroup environment nil | |
277 "Fitting Emacs with its environment." | |
278 :group 'emacs) | |
279 | |
280 (defgroup comm nil | |
281 "Communications, networking, remote access to files." | |
282 :tag "Communication" | |
283 :group 'environment) | |
284 | |
285 (defgroup hardware nil | |
286 "Support for interfacing with exotic hardware." | |
287 :group 'environment) | |
288 | |
289 (defgroup terminals nil | |
290 "Support for terminal types." | |
291 :group 'environment) | |
292 | |
293 (defgroup unix nil | |
294 "Front-ends/assistants for, or emulators of, UNIX features." | |
295 :group 'environment) | |
296 | |
297 (defgroup vms nil | |
298 "Support code for vms." | |
299 :group 'environment) | |
300 | |
301 (defgroup i18n nil | |
302 "Internationalization and alternate character-set support." | |
52281 | 303 :link '(custom-manual "(emacs)International") |
17334 | 304 :group 'environment |
305 :group 'editing) | |
306 | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
307 (defgroup x nil |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
308 "The X Window system." |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
309 :group 'environment) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
310 |
17334 | 311 (defgroup frames nil |
312 "Support for Emacs frames and window systems." | |
313 :group 'environment) | |
314 | |
315 (defgroup data nil | |
316 "Support editing files of data." | |
317 :group 'emacs) | |
318 | |
18320
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
319 (defgroup files nil |
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
320 "Support editing files." |
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
321 :group 'emacs) |
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
322 |
17334 | 323 (defgroup wp nil |
324 "Word processing." | |
325 :group 'emacs) | |
326 | |
327 (defgroup tex nil | |
328 "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
|
329 :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
17334 | 330 :group 'wp) |
331 | |
332 (defgroup faces nil | |
333 "Support for multiple fonts." | |
334 :group 'emacs) | |
335 | |
336 (defgroup hypermedia nil | |
337 "Support for links between text or other media types." | |
338 :group 'emacs) | |
339 | |
340 (defgroup help nil | |
341 "Support for on-line help systems." | |
342 :group 'emacs) | |
343 | |
25685 | 344 (defgroup multimedia nil |
345 "Non-textual support, specifically images and sound." | |
346 :group 'emacs) | |
347 | |
17334 | 348 (defgroup local nil |
349 "Code local to your site." | |
350 :group 'emacs) | |
351 | |
352 (defgroup customize '((widgets custom-group)) | |
353 "Customization of the Customization support." | |
354 :prefix "custom-" | |
17415 | 355 :group 'help) |
356 | |
357 (defgroup custom-faces nil | |
358 "Faces used by customize." | |
359 :group 'customize | |
17334 | 360 :group 'faces) |
361 | |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
362 (defgroup custom-browse nil |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
363 "Control customize browser." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
364 :prefix "custom-" |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
365 :group 'customize) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
366 |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
367 (defgroup custom-buffer nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
368 "Control customize buffers." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
369 :prefix "custom-" |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
370 :group 'customize) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
371 |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
372 (defgroup custom-menu nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
373 "Control customize menus." |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
374 :prefix "custom-" |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
375 :group 'customize) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
376 |
17415 | 377 (defgroup abbrev-mode nil |
378 "Word abbreviations mode." | |
52281 | 379 :link '(custom-manual "(emacs)Abbrevs") |
17415 | 380 :group 'abbrev) |
381 | |
382 (defgroup alloc nil | |
383 "Storage allocation and gc for GNU Emacs Lisp interpreter." | |
384 :tag "Storage Allocation" | |
385 :group 'internal) | |
386 | |
387 (defgroup undo nil | |
388 "Undoing changes in buffers." | |
52281 | 389 :link '(custom-manual "(emacs)Undo") |
17415 | 390 :group 'editing) |
391 | |
392 (defgroup modeline nil | |
393 "Content of the modeline." | |
394 :group 'environment) | |
395 | |
396 (defgroup editing-basics nil | |
397 "Most basic editing facilities." | |
398 :group 'editing) | |
399 | |
400 (defgroup display nil | |
401 "How characters are displayed in buffers." | |
402 :group 'environment) | |
403 | |
404 (defgroup execute nil | |
405 "Executing external commands." | |
406 :group 'processes) | |
407 | |
408 (defgroup installation nil | |
409 "The Emacs installation." | |
410 :group 'environment) | |
411 | |
412 (defgroup dired nil | |
413 "Directory editing." | |
414 :group 'environment) | |
415 | |
416 (defgroup limits nil | |
417 "Internal Emacs limits." | |
418 :group 'internal) | |
419 | |
420 (defgroup debug nil | |
421 "Debugging Emacs itself." | |
422 :group 'development) | |
423 | |
424 (defgroup minibuffer nil | |
63249
32b12a7e7c4f
(minibuffer): Fix spellings in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
63194
diff
changeset
|
425 "Controling the behavior of the minibuffer." |
52281 | 426 :link '(custom-manual "(emacs)Minibuffer") |
17415 | 427 :group 'environment) |
428 | |
429 (defgroup keyboard nil | |
430 "Input from the keyboard." | |
431 :group 'environment) | |
432 | |
433 (defgroup mouse nil | |
434 "Input from the mouse." | |
435 :group 'environment) | |
436 | |
437 (defgroup menu nil | |
438 "Input from the menus." | |
439 :group 'environment) | |
440 | |
61475
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
441 (defgroup dnd nil |
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
442 "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
|
443 :group 'environment) |
89d32002193d
* cus-edit.el (dnd): New group.
Jan Djärv <jan.h.d@swipnet.se>
parents:
61396
diff
changeset
|
444 |
17415 | 445 (defgroup auto-save nil |
446 "Preventing accidential loss of data." | |
18320
bb83860447d0
(files): New group `files'.
Richard M. Stallman <rms@gnu.org>
parents:
18258
diff
changeset
|
447 :group 'files) |
17415 | 448 |
449 (defgroup processes-basics nil | |
450 "Basic stuff dealing with processes." | |
451 :group 'processes) | |
452 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
453 (defgroup mule nil |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
454 "MULE Emacs internationalization." |
18053
941f5d1a241e
(cus-start): Require cus-start.
Richard M. Stallman <rms@gnu.org>
parents:
18033
diff
changeset
|
455 :group 'i18n) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
456 |
17415 | 457 (defgroup windows nil |
458 "Windows within a frame." | |
52281 | 459 :link '(custom-manual "(emacs)Windows") |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
460 :group 'environment) |
17415 | 461 |
67660
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
462 (defgroup mac nil |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
463 "Mac specific features." |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
464 :link '(custom-manual "(emacs)Mac OS") |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
465 :group 'environment |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
466 :version "22.1" |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
467 :prefix "mac-") |
ae5e8c21dbf1
(mac): New group.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67600
diff
changeset
|
468 |
17334 | 469 ;;; Utilities. |
470 | |
471 (defun custom-split-regexp-maybe (regexp) | |
472 "If REGEXP is a string, split it to a list at `\\|'. | |
25685 | 473 You can get the original back with from the result with: |
17334 | 474 (mapconcat 'identity result \"\\|\") |
475 | |
476 IF REGEXP is not a string, return it unchanged." | |
477 (if (stringp regexp) | |
478 (let ((start 0) | |
479 all) | |
480 (while (string-match "\\\\|" regexp start) | |
481 (setq all (cons (substring regexp start (match-beginning 0)) all) | |
482 start (match-end 0))) | |
483 (nreverse (cons (substring regexp start) all))) | |
484 regexp)) | |
485 | |
17415 | 486 (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
|
487 "Prompt for a custom variable, defaulting to the variable at point. |
17415 | 488 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
|
489 (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
|
490 (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
|
491 (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
|
492 val) |
38c5bc4332b9
(lisp, c, tex): Add :link (custom-group-link font-lock-faces) to defgroup.
Juri Linkov <juri@jurta.org>
parents:
66941
diff
changeset
|
493 (setq val (completing-read |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
494 (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
|
495 "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
|
496 obarray 'custom-variable-p t nil nil default)) |
17415 | 497 (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
|
498 (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
|
499 (intern val))))) |
17415 | 500 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
501 (defun custom-menu-filter (menu widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
502 "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
|
503 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
|
504 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
|
505 (let ((result nil) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
506 current name action filter) |
25685 | 507 (while menu |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
508 (setq current (car menu) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
509 name (nth 0 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
510 action (nth 1 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
511 filter (nth 2 current) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
512 menu (cdr menu)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
513 (if (or (null filter) (funcall filter widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
514 (push (cons name action) result) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
515 (push name result))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
516 (nreverse result))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
517 |
17415 | 518 ;;; Unlispify. |
519 | |
17334 | 520 (defvar custom-prefix-list nil |
28130 | 521 "List of prefixes that should be ignored by `custom-unlispify'.") |
17334 | 522 |
523 (defcustom custom-unlispify-menu-entries t | |
524 "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
|
525 :group 'custom-menu |
17334 | 526 :type 'boolean) |
527 | |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
528 (defcustom custom-unlispify-remove-prefixes nil |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
529 "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
|
530 :group 'custom-menu |
43508
c092c3c65251
2002-02-24 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43246
diff
changeset
|
531 :group 'custom-buffer |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
532 :type 'boolean) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
533 |
17334 | 534 (defun custom-unlispify-menu-entry (symbol &optional no-suffix) |
28130 | 535 "Convert SYMBOL into a menu entry." |
17334 | 536 (cond ((not custom-unlispify-menu-entries) |
537 (symbol-name symbol)) | |
538 ((get symbol 'custom-tag) | |
539 (if no-suffix | |
540 (get symbol 'custom-tag) | |
541 (concat (get symbol 'custom-tag) "..."))) | |
542 (t | |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
543 (with-current-buffer (get-buffer-create " *Custom-Work*") |
17334 | 544 (erase-buffer) |
545 (princ symbol (current-buffer)) | |
546 (goto-char (point-min)) | |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
547 ;; 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
|
548 ;; end with `-p'. -stef |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
549 ;; (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
|
550 ;; (re-search-forward "-p\\'" nil t)) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
551 ;; (replace-match "" t t) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
552 ;; (goto-char (point-min))) |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
553 (if custom-unlispify-remove-prefixes |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
554 (let ((prefixes custom-prefix-list) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
555 prefix) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
556 (while prefixes |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
557 (setq prefix (car prefixes)) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
558 (if (search-forward prefix (+ (point) (length prefix)) t) |
25685 | 559 (progn |
18812
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
560 (setq prefixes nil) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
561 (delete-region (point-min) (point))) |
82c80b23fa9d
(custom-unlispify-remove-prefixes): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18669
diff
changeset
|
562 (setq prefixes (cdr prefixes)))))) |
17334 | 563 (subst-char-in-region (point-min) (point-max) ?- ?\ t) |
564 (capitalize-region (point-min) (point-max)) | |
25685 | 565 (unless no-suffix |
17334 | 566 (goto-char (point-max)) |
567 (insert "...")) | |
568 (buffer-string))))) | |
569 | |
570 (defcustom custom-unlispify-tag-names t | |
571 "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
|
572 :group 'custom-buffer |
17334 | 573 :type 'boolean) |
574 | |
575 (defun custom-unlispify-tag-name (symbol) | |
28130 | 576 "Convert SYMBOL into a menu entry." |
17334 | 577 (let ((custom-unlispify-menu-entries custom-unlispify-tag-names)) |
578 (custom-unlispify-menu-entry symbol t))) | |
579 | |
580 (defun custom-prefix-add (symbol prefixes) | |
28130 | 581 "Add SYMBOL to list of ignored PREFIXES." |
17334 | 582 (cons (or (get symbol 'custom-prefix) |
583 (concat (symbol-name symbol) "-")) | |
584 prefixes)) | |
585 | |
17415 | 586 ;;; Guess. |
587 | |
588 (defcustom custom-guess-name-alist | |
589 '(("-p\\'" boolean) | |
590 ("-hook\\'" hook) | |
591 ("-face\\'" face) | |
592 ("-file\\'" file) | |
593 ("-function\\'" function) | |
594 ("-functions\\'" (repeat function)) | |
595 ("-list\\'" (repeat sexp)) | |
596 ("-alist\\'" (repeat (cons sexp sexp)))) | |
597 "Alist of (MATCH TYPE). | |
598 | |
25685 | 599 MATCH should be a regexp matching the name of a symbol, and TYPE should |
17415 | 600 be a widget suitable for editing the value of that symbol. The TYPE |
601 of the first entry where MATCH matches the name of the symbol will be | |
25685 | 602 used. |
17415 | 603 |
604 This is used for guessing the type of variables not declared with | |
605 customize." | |
606 :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
|
607 :group 'custom-buffer) |
17415 | 608 |
609 (defcustom custom-guess-doc-alist | |
610 '(("\\`\\*?Non-nil " boolean)) | |
611 "Alist of (MATCH TYPE). | |
612 | |
613 MATCH should be a regexp matching a documentation string, and TYPE | |
614 should be a widget suitable for editing the value of a variable with | |
615 that documentation string. The TYPE of the first entry where MATCH | |
616 matches the name of the symbol will be used. | |
617 | |
618 This is used for guessing the type of variables not declared with | |
619 customize." | |
620 :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
|
621 :group 'custom-buffer) |
17415 | 622 |
623 (defun custom-guess-type (symbol) | |
624 "Guess a widget suitable for editing the value of SYMBOL. | |
25685 | 625 This is done by matching SYMBOL with `custom-guess-name-alist' and |
17415 | 626 if that fails, the doc string with `custom-guess-doc-alist'." |
627 (let ((name (symbol-name symbol)) | |
628 (names custom-guess-name-alist) | |
629 current found) | |
630 (while names | |
631 (setq current (car names) | |
632 names (cdr names)) | |
633 (when (string-match (nth 0 current) name) | |
634 (setq found (nth 1 current) | |
635 names nil))) | |
636 (unless found | |
637 (let ((doc (documentation-property symbol 'variable-documentation)) | |
638 (docs custom-guess-doc-alist)) | |
25685 | 639 (when doc |
17415 | 640 (while docs |
641 (setq current (car docs) | |
642 docs (cdr docs)) | |
643 (when (string-match (nth 0 current) doc) | |
644 (setq found (nth 1 current) | |
645 docs nil)))))) | |
646 found)) | |
647 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
648 ;;; Sorting. |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
649 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
650 (defcustom custom-browse-sort-alphabetically nil |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
651 "If non-nil, sort members of each customization group alphabetically." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
652 :type 'boolean |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
653 :group 'custom-browse) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
654 |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
655 (defcustom custom-browse-order-groups nil |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
656 "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
|
657 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
658 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
659 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
660 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
661 (const :tag "none" nil)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
662 :group 'custom-browse) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
663 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
664 (defcustom custom-browse-only-groups nil |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
665 "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
|
666 :type 'boolean |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
667 :group 'custom-browse) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
668 |
65736
d87f6cfbe849
(custom-buffer-sort-alphabetically): Default to nil.
Juri Linkov <juri@jurta.org>
parents:
65680
diff
changeset
|
669 (defcustom custom-buffer-sort-alphabetically nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
670 "If non-nil, sort members of each customization group alphabetically." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
671 :type 'boolean |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
672 :group 'custom-buffer) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
673 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
674 (defcustom custom-buffer-order-groups 'last |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
675 "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
|
676 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
677 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
678 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
679 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
680 (const :tag "none" nil)) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
681 :group 'custom-buffer) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
682 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
683 (defcustom custom-menu-sort-alphabetically nil |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
684 "If non-nil, sort members of each customization group alphabetically." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
685 :type 'boolean |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
686 :group 'custom-menu) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
687 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
688 (defcustom custom-menu-order-groups 'first |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
689 "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
|
690 If `first', order groups before non-groups. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
691 If `last', order groups after non-groups." |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
692 :type '(choice (const first) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
693 (const last) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
694 (const :tag "none" nil)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
695 :group 'custom-menu) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
696 |
22332
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
697 ;;;###autoload (add-hook 'same-window-regexps "\\`\\*Customiz.*\\*\\'") |
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
698 |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
699 (defun custom-sort-items (items sort-alphabetically order-groups) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
700 "Return a sorted copy of ITEMS. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
701 ITEMS should be a `custom-group' property. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
702 If SORT-ALPHABETICALLY non-nil, sort alphabetically. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
703 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
|
704 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
|
705 (sort (copy-sequence items) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
706 (lambda (a b) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
707 (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
|
708 (namea (nth 0 a)) (nameb (nth 0 b))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
709 (cond ((not order-groups) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
710 ;; 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
|
711 (when sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
712 (string-lessp namea nameb))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
713 ((eq typea 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
714 ;; 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
|
715 (if (eq typeb 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
716 (when sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
717 (string-lessp namea nameb)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
718 (eq order-groups 'first))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
719 ((eq typeb 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
720 ;; 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
|
721 (eq order-groups 'last)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
722 (sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
723 ;; Since A and B cannot be groups, sort. |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
724 (string-lessp namea nameb))))))) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
725 |
17415 | 726 ;;; Custom Mode Commands. |
17334 | 727 |
728 (defvar custom-options nil | |
729 "Customization widgets in the current buffer.") | |
730 | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
731 (defun Custom-set () |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
732 "Set the current value of all edited settings in the buffer." |
17334 | 733 (interactive) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
734 (let ((children custom-options)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
735 (if (or (and (= 1 (length children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
736 (memq (widget-type (car children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
737 '(custom-variable custom-face))) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
738 (y-or-n-p "Set all values according to this buffer? ")) |
67970
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
739 (mapc (lambda (child) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
740 (when (eq (widget-get child :custom-state) 'modified) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
741 (widget-apply child :custom-set))) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
742 children) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
743 (message "Aborted")))) |
17334 | 744 |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
745 (defun Custom-save () |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
746 "Set all edited settings, then save all settings that have been set. |
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
747 If a setting was edited and set before, this saves it. |
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
748 If a setting was merely edited before, this sets it then saves it." |
17334 | 749 (interactive) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
750 (let ((children custom-options)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
751 (if (or (and (= 1 (length children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
752 (memq (widget-type (car children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
753 '(custom-variable custom-face))) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
754 (yes-or-no-p "Save all settings in this buffer? ")) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
755 (progn |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
756 (mapc (lambda (child) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
757 (when (memq (widget-get child :custom-state) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
758 '(modified set changed rogue)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
759 (widget-apply child :custom-save))) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
760 children) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
761 (custom-save-all)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
762 (message "Aborted")))) |
17334 | 763 |
25685 | 764 (defvar custom-reset-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
765 '(("Undo Edits" . Custom-reset-current) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
766 ("Reset to Saved" . Custom-reset-saved) |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
767 ("Erase Customization (use standard values)" . Custom-reset-standard)) |
17334 | 768 "Alist of actions for the `Reset' button. |
769 The key is a string containing the name of the action, the value is a | |
28130 | 770 Lisp function taking the widget as an element which will be called |
17334 | 771 when the action is chosen.") |
772 | |
773 (defun custom-reset (event) | |
774 "Select item from reset menu." | |
775 (let* ((completion-ignore-case t) | |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
776 (answer (widget-choose "Reset settings" |
17334 | 777 custom-reset-menu |
778 event))) | |
779 (if answer | |
780 (funcall answer)))) | |
781 | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
782 (defun Custom-reset-current (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
783 "Reset all edited settings in the buffer to show their current values." |
17334 | 784 (interactive) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
785 (let ((children custom-options)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
786 (if (or (and (= 1 (length children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
787 (memq (widget-type (car children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
788 '(custom-variable custom-face))) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
789 (y-or-n-p "Reset all settings' buffer text to show current values? ")) |
67970
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
790 (mapc (lambda (widget) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
791 (if (memq (widget-get widget :custom-state) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
792 '(modified changed)) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
793 (widget-apply widget :custom-reset-current))) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
794 children) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
795 (message "Aborted")))) |
17334 | 796 |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
797 (defun Custom-reset-saved (&rest ignore) |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
798 "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
|
799 This also shows the saved values in the buffer." |
17334 | 800 (interactive) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
801 (let ((children custom-options)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
802 (if (or (and (= 1 (length children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
803 (memq (widget-type (car children)) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
804 '(custom-variable custom-face))) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
805 (y-or-n-p "Reset all settings (current values and buffer text) to saved values? ")) |
67970
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
806 (mapc (lambda (widget) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
807 (if (memq (widget-get widget :custom-state) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
808 '(modified set changed rogue)) |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
809 (widget-apply widget :custom-reset-saved))) |
68194
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
810 children) |
f4bca1157746
(Custom-set, Custom-save, Custom-reset-current, Custom-reset-saved):
Luc Teirlinck <teirllm@auburn.edu>
parents:
68178
diff
changeset
|
811 (message "Aborted")))) |
17334 | 812 |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
813 (defun Custom-reset-standard (&rest ignore) |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
814 "Erase all customization (either current or saved) for the group members. |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
815 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
|
816 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
|
817 making them as if they had never been customized at all." |
17334 | 818 (interactive) |
67972 | 819 (let ((children custom-options)) |
820 (if (or (and (= 1 (length children)) | |
821 (memq (widget-type (car children)) | |
822 '(custom-variable custom-face))) | |
68086
742bf2516c24
(Custom-set, Custom-save): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
68028
diff
changeset
|
823 (yes-or-no-p "Erase all customizations for settings in this buffer? ")) |
67972 | 824 (mapc (lambda (widget) |
825 (and (if (widget-get widget :custom-standard-value) | |
826 (widget-apply widget :custom-standard-value) | |
827 t) | |
828 (memq (widget-get widget :custom-state) | |
829 '(modified set changed saved rogue)) | |
830 (widget-apply widget :custom-reset-standard))) | |
831 children) | |
832 (message "Aborted")))) | |
17334 | 833 |
834 ;;; The Customize Commands | |
835 | |
25685 | 836 (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
|
837 "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
|
838 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
|
839 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
|
840 the name of the variable. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
841 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
842 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
|
843 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
|
844 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
845 If the variable has a `custom-type' property, it must be a widget and the |
25685 | 846 `:prompt-value' property of that widget will be used for reading the value. |
847 | |
848 If optional COMMENT argument is non nil, also prompt for a comment and return | |
849 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
|
850 (let* ((var (read-variable prompt-var)) |
25685 | 851 (minibuffer-help-form '(describe-variable var)) |
852 (val | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
853 (let ((prop (get var 'variable-interactive)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
854 (type (get var 'custom-type)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
855 (prompt (format prompt-val var))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
856 (unless (listp type) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
857 (setq type (list type))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
858 (cond (prop |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
859 ;; Use VAR's `variable-interactive' property |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
860 ;; as an interactive spec for prompting. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
861 (call-interactively (list 'lambda '(arg) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
862 (list 'interactive prop) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
863 'arg))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
864 (type |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
865 (widget-prompt-value type |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
866 prompt |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
867 (if (boundp var) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
868 (symbol-value var)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
869 (not (boundp var)))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
870 (t |
25685 | 871 (eval-minibuffer prompt)))))) |
872 (if comment | |
873 (list var val | |
874 (read-string "Comment: " (get var 'variable-comment))) | |
875 (list var val)))) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
876 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
877 ;;;###autoload |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
878 (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
|
879 "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
|
880 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
881 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
|
882 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
|
883 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
884 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 885 `:prompt-value' property of that widget will be used for reading the value. |
886 | |
887 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
|
888 (interactive (custom-prompt-variable "Set variable: " |
25685 | 889 "Set %s to value: " |
890 current-prefix-arg)) | |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
891 |
25685 | 892 (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
|
893 (put variable 'variable-comment nil)) |
25685 | 894 (comment |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
895 (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
|
896 (set variable value)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
897 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
898 ;;;###autoload |
28130 | 899 (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
|
900 "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
|
901 VALUE is a Lisp object. |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
902 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
903 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
|
904 VARIABLE, otherwise `set-default' is used. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
905 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
906 The `customized-value' property of the VARIABLE will be set to a list |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
907 with a quoted VALUE as its sole list member. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
908 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
909 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
|
910 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
|
911 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
912 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 913 `:prompt-value' property of that widget will be used for reading the value. |
914 | |
915 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
|
916 (interactive (custom-prompt-variable "Set variable: " |
25685 | 917 "Set customized value for %s to: " |
918 current-prefix-arg)) | |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
919 (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
|
920 (custom-push-theme 'theme-value variable 'user 'set (custom-quote value)) |
28130 | 921 (funcall (or (get variable 'custom-set) 'set-default) variable value) |
922 (put variable 'customized-value (list (custom-quote value))) | |
25685 | 923 (cond ((string= comment "") |
28130 | 924 (put variable 'variable-comment nil) |
925 (put variable 'customized-variable-comment nil)) | |
25685 | 926 (comment |
28130 | 927 (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
|
928 (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
|
929 value) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
930 |
17334 | 931 ;;;###autoload |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
932 (defun customize-save-variable (variable value &optional comment) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
933 "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
|
934 Return VALUE. |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
935 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
936 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
|
937 VARIABLE, otherwise `set-default' is used. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
938 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
939 The `customized-value' property of the VARIABLE will be set to a list |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
940 with a quoted VALUE as its sole list member. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
941 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
942 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
|
943 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
|
944 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
945 If VARIABLE has a `custom-type' property, it must be a widget and the |
25685 | 946 `:prompt-value' property of that widget will be used for reading the value. |
947 | |
948 If given a prefix (or a COMMENT argument), also prompt for a comment." | |
43063 | 949 (interactive (custom-prompt-variable "Set and save variable: " |
25685 | 950 "Set and save value for %s as: " |
951 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
|
952 (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
|
953 (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
|
954 (custom-push-theme 'theme-value variable 'user 'set (custom-quote value)) |
25685 | 955 (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
|
956 (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
|
957 (put variable 'saved-variable-comment nil)) |
25685 | 958 (comment |
45244
3fe5828abc37
(customize-set-value): Rename `var' to `variable' and `val' to `value'.
Pavel Janík <Pavel@Janik.cz>
parents:
45102
diff
changeset
|
959 (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
|
960 (put variable 'saved-variable-comment comment))) |
43246
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
961 (custom-save-all) |
c187056ac630
2002-02-11 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43167
diff
changeset
|
962 value) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
963 |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
964 ;;;###autoload |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
965 (defun customize () |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
966 "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
|
967 User options are structured into \"groups\". |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
968 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
|
969 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
|
970 (interactive) |
17703 | 971 (customize-group 'emacs)) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
972 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
973 ;;;###autoload |
47823
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
974 (defun customize-mode (mode) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
975 "Customize options related to the current major mode. |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
976 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
|
977 then prompt for the MODE to customize." |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
978 (interactive |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
979 (list |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
980 (let ((completion-regexp-list '("-mode\\'")) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
981 (group (custom-group-of-mode major-mode))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
982 (if (and group (not current-prefix-arg)) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
983 major-mode |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
984 (intern |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
985 (completing-read (if group |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
986 (format "Major mode (default %s): " major-mode) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
987 "Major mode: ") |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
988 obarray |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
989 'custom-group-of-mode |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
990 t nil nil (if group (symbol-name major-mode)))))))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
991 (customize-group (custom-group-of-mode mode))) |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
992 |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
993 |
4649d9cb92dd
(customize-mode): New command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47809
diff
changeset
|
994 ;;;###autoload |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
995 (defun customize-group (group) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
996 "Customize GROUP, which must be a customization group." |
67298
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
997 (interactive |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
998 (list (let ((completion-ignore-case t)) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
999 (completing-read "Customize group (default emacs): " |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1000 obarray |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1001 (lambda (symbol) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1002 (or (and (get symbol 'custom-loads) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1003 (not (get symbol 'custom-autoload))) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1004 (get symbol 'custom-group))) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1005 t)))) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1006 (when (stringp group) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1007 (if (string-equal "" group) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1008 (setq group 'emacs) |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1009 (setq group (intern group)))) |
18359
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1010 (let ((name (format "*Customize Group: %s*" |
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1011 (custom-unlispify-tag-name group)))) |
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1012 (if (get-buffer name) |
22332
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
1013 (pop-to-buffer name) |
18359
057bb638549c
(custom-nest-groups): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18352
diff
changeset
|
1014 (custom-buffer-create (list (list group 'custom-group)) |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1015 name |
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1016 (concat " for group " |
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1017 (custom-unlispify-tag-name group)))))) |
17334 | 1018 |
1019 ;;;###autoload | |
22001
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1020 (defun customize-group-other-window (group) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1021 "Customize GROUP, which must be a customization group." |
67298
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1022 (interactive |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1023 (list (let ((completion-ignore-case t)) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1024 (completing-read "Customize group (default emacs): " |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1025 obarray |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1026 (lambda (symbol) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1027 (or (and (get symbol 'custom-loads) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1028 (not (get symbol 'custom-autoload))) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1029 (get symbol 'custom-group))) |
7af5860f4444
(customize-group, customize-group-other-window):
Juri Linkov <juri@jurta.org>
parents:
67086
diff
changeset
|
1030 t)))) |
22001
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1031 (when (stringp group) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1032 (if (string-equal "" group) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1033 (setq group 'emacs) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1034 (setq group (intern group)))) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1035 (let ((name (format "*Customize Group: %s*" |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1036 (custom-unlispify-tag-name group)))) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1037 (if (get-buffer name) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1038 (let ( |
48975
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1039 ;; Copied from `custom-buffer-create-other-window'. |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1040 (pop-up-windows t) |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1041 (same-window-buffer-names nil) |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1042 (same-window-regexps nil)) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1043 (pop-to-buffer name)) |
22001
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1044 (custom-buffer-create-other-window |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1045 (list (list group 'custom-group)) |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1046 name |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1047 (concat " for group " |
e35aafba190f
(customize-group-other-window): Handle groups not
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
1048 (custom-unlispify-tag-name group)))))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1049 |
18089 | 1050 ;;;###autoload |
1051 (defalias 'customize-variable 'customize-option) | |
18086
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1052 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1053 ;;;###autoload |
18086
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1054 (defun customize-option (symbol) |
dbae3eb8b351
(customize-option): Renamed from custom-variable.
Richard M. Stallman <rms@gnu.org>
parents:
18085
diff
changeset
|
1055 "Customize SYMBOL, which must be a user option variable." |
17415 | 1056 (interactive (custom-variable-prompt)) |
64151
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1057 (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
|
1058 (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
|
1059 (format "*Customize Option: %s*" |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1060 (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
|
1061 (unless (eq symbol basevar) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1062 (message "`%s' is an alias for `%s'" symbol basevar)))) |
17334 | 1063 |
48975
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1064 ;;;###autoload |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1065 (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
|
1066 |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1067 ;;;###autoload |
227f251b919a
(customize-group-other-window): Use pop-to-buffer in
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48958
diff
changeset
|
1068 (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
|
1069 "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
|
1070 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
|
1071 (interactive (custom-variable-prompt)) |
64151
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1072 (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
|
1073 (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
|
1074 (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
|
1075 (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
|
1076 (unless (eq symbol basevar) |
292d83423c40
(customize-option, customize-option-other-window): Make them handle aliases.
Luc Teirlinck <teirllm@auburn.edu>
parents:
64091
diff
changeset
|
1077 (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
|
1078 |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1079 (defvar customize-changed-options-previous-release "21.1" |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1080 "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
|
1081 |
17334 | 1082 ;;;###autoload |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1083 (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
|
1084 |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1085 ;;;###autoload |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1086 (defun customize-changed-options (since-version) |
67747
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1087 "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
|
1088 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
|
1089 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
|
1090 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
|
1091 |
3b325979ccee
(customize-changed-options-previous-release): Prev release is 21.1.
Richard M. Stallman <rms@gnu.org>
parents:
67745
diff
changeset
|
1092 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
|
1093 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
|
1094 |
69540
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1095 (interactive |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1096 (list |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1097 (read-from-minibuffer |
a22167168ac4
(customize-changed-options): Mention explicit version number as
Luc Teirlinck <teirllm@auburn.edu>
parents:
69268
diff
changeset
|
1098 (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
|
1099 customize-changed-options-previous-release)))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1100 (if (equal since-version "") |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1101 (setq since-version nil) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1102 (unless (condition-case nil |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1103 (numberp (read since-version)) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1104 (error nil)) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1105 (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
|
1106 (unless since-version |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1107 (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
|
1108 |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1109 ;; 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
|
1110 ;; custom-load-symbol for this. |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1111 (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
|
1112 (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
|
1113 (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
|
1114 (dolist (load (cdr elt)) |
b99be2b86231
(customize-changed-options): Undo last doc change.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49218
diff
changeset
|
1115 (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
|
1116 (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
|
1117 (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
|
1118 |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1119 (let (found) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1120 (mapatoms |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1121 (lambda (symbol) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1122 (let ((version (get symbol 'custom-version))) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1123 (if version |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1124 (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
|
1125 (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
|
1126 (get symbol 'group-documentation)) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1127 (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
|
1128 (if (custom-variable-p symbol) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1129 (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
|
1130 (if (custom-facep symbol) |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1131 (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
|
1132 (if found |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1133 (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
|
1134 "*Customize Changed Options*") |
ddeb57b6c977
(customize-changed-options): Doc addition. Load the
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49126
diff
changeset
|
1135 (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
|
1136 since-version)))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1137 |
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1138 (defun customize-version-lessp (version1 version2) |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1139 ;; 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
|
1140 ;; 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
|
1141 |
23105
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1142 ;; 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
|
1143 ;; in the :version value. |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1144 (if (numberp version2) |
a47a69af14c8
(customize-version-lessp): Handle a number as VERSION2.
Karl Heuer <kwzh@gnu.org>
parents:
22667
diff
changeset
|
1145 (setq version2 (prin1-to-string version2))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1146 (let (major1 major2 minor1 minor2) |
29762
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1147 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1148 (setq major1 (read (or (match-string 1 version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1149 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1150 (setq minor1 (read (or (match-string 3 version1) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1151 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1152 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1153 (setq major2 (read (or (match-string 1 version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1154 "0"))) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1155 (setq minor2 (read (or (match-string 3 version2) |
8c4512ba3671
(customize-changed-options): Check arg.
Dave Love <fx@gnu.org>
parents:
28941
diff
changeset
|
1156 "0"))) |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1157 (or (< major1 major2) |
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1158 (and (= major1 major2) |
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1159 (< minor1 minor2))))) |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
1160 |
20444
a9fbb6791eb7
(customize-changed-options): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20411
diff
changeset
|
1161 ;;;###autoload |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1162 (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
|
1163 "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
|
1164 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
|
1165 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
|
1166 |
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1167 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
|
1168 suggest to customize that face, if it's customizable." |
44841
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1169 (interactive |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1170 (list (read-face-name "Customize face" "all faces" t))) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1171 (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
|
1172 (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
|
1173 (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
|
1174 (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
|
1175 (if (listp face) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1176 (custom-buffer-create (custom-sort-items |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1177 (mapcar (lambda (s) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1178 (list s 'custom-face)) |
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1179 face) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1180 t nil) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1181 "*Customize Faces*") |
63661
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1182 ;; 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
|
1183 (if (get face 'face-alias) |
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1184 (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
|
1185 (unless (facep face) |
49013
4a3d5b9c79b9
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48997
diff
changeset
|
1186 (error "Invalid face %S" face)) |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1187 (custom-buffer-create (list (list face 'custom-face)) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1188 (format "*Customize Face: %s*" |
44887
01a5b217fd7f
(customize-face): Use read-face-name and handle multiple faces.
Richard M. Stallman <rms@gnu.org>
parents:
44846
diff
changeset
|
1189 (custom-unlispify-tag-name face))))) |
17334 | 1190 |
1191 ;;;###autoload | |
44891 | 1192 (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
|
1193 "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
|
1194 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
|
1195 |
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1196 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
|
1197 suggest to customize that face, if it's customizable." |
44841
ca88dc883a8d
(customize-face-other-window, customize-face):
Gerd Moellmann <gerd@gnu.org>
parents:
44682
diff
changeset
|
1198 (interactive |
44888
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1199 (list (read-face-name "Customize face" "all faces" t))) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1200 (if (member face '(nil "")) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1201 (setq face (face-list))) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1202 (if (and (listp face) (null (cdr face))) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1203 (setq face (car face))) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1204 (if (listp face) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1205 (custom-buffer-create-other-window |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1206 (custom-sort-items |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1207 (mapcar (lambda (s) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1208 (list s 'custom-face)) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1209 face) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1210 t nil) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1211 "*Customize Faces*") |
63661
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1212 (if (get face 'face-alias) |
49d95c194532
(customize-face, customize-face-other-window): Handle face aliases.
Glenn Morris <rgm@gnu.org>
parents:
63249
diff
changeset
|
1213 (setq face (get face 'face-alias))) |
44888
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1214 (unless (facep face) |
49013
4a3d5b9c79b9
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48997
diff
changeset
|
1215 (error "Invalid face %S" face)) |
25685 | 1216 (custom-buffer-create-other-window |
44888
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1217 (list (list face 'custom-face)) |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1218 (format "*Customize Face: %s*" |
b74399186334
(customize-face-other-window): Make it work similarly.
Richard M. Stallman <rms@gnu.org>
parents:
44887
diff
changeset
|
1219 (custom-unlispify-tag-name face))))) |
17415 | 1220 |
1221 ;;;###autoload | |
17334 | 1222 (defun customize-customized () |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1223 "Customize all user options set since the last save in this session." |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1224 (interactive) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1225 (let ((found nil)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1226 (mapatoms (lambda (symbol) |
25685 | 1227 (and (or (get symbol 'customized-face) |
1228 (get symbol 'customized-face-comment)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1229 (custom-facep symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1230 (push (list symbol 'custom-face) found)) |
25685 | 1231 (and (or (get symbol 'customized-value) |
1232 (get symbol 'customized-variable-comment)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1233 (boundp symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1234 (push (list symbol 'custom-variable) found)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1235 (if (not found) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1236 (error "No customized user options") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1237 (custom-buffer-create (custom-sort-items found t nil) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1238 "*Customize Customized*")))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1239 |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1240 ;;;###autoload |
50077
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1241 (defun customize-rogue () |
68232
4580b1bedd8a
(customize-rogue): Minor doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
68194
diff
changeset
|
1242 "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
|
1243 (interactive) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1244 (let ((found nil)) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1245 (mapatoms (lambda (symbol) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1246 (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
|
1247 (get symbol 'saved-value) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1248 (get symbol 'standard-value)))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1249 (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
|
1250 (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
|
1251 (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
|
1252 ;; 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
|
1253 (default-value symbol)))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1254 (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
|
1255 (if (not found) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1256 (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
|
1257 (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
|
1258 "*Customize Rogue*")))) |
21135e13f9cd
2003-03-10 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
49556
diff
changeset
|
1259 ;;;###autoload |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1260 (defun customize-saved () |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1261 "Customize all already saved user options." |
17334 | 1262 (interactive) |
1263 (let ((found nil)) | |
1264 (mapatoms (lambda (symbol) | |
25685 | 1265 (and (or (get symbol 'saved-face) |
1266 (get symbol 'saved-face-comment)) | |
17334 | 1267 (custom-facep symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1268 (push (list symbol 'custom-face) found)) |
25685 | 1269 (and (or (get symbol 'saved-value) |
1270 (get symbol 'saved-variable-comment)) | |
17334 | 1271 (boundp symbol) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1272 (push (list symbol 'custom-variable) found)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1273 (if (not found ) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1274 (error "No saved user options") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1275 (custom-buffer-create (custom-sort-items found t nil) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1276 "*Customize Saved*")))) |
17334 | 1277 |
1278 ;;;###autoload | |
1279 (defun customize-apropos (regexp &optional all) | |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1280 "Customize all loaded options, faces and groups matching REGEXP. |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1281 If ALL is `options', include only options. |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1282 If ALL is `faces', include only faces. |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1283 If ALL is `groups', include only groups. |
67510
984ab2cd1b98
(customize-apropos): Avoid listing an option more than once under
Luc Teirlinck <teirllm@auburn.edu>
parents:
67413
diff
changeset
|
1284 If ALL 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
|
1285 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
|
1286 \(but we recommend using `apropos-variable' instead)." |
17334 | 1287 (interactive "sCustomize regexp: \nP") |
1288 (let ((found nil)) | |
1289 (mapatoms (lambda (symbol) | |
1290 (when (string-match regexp (symbol-name symbol)) | |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1291 (when (and (not (memq all '(faces options))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1292 (get symbol 'custom-group)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1293 (push (list symbol 'custom-group) found)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1294 (when (and (not (memq all '(options groups))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1295 (custom-facep symbol)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1296 (push (list symbol 'custom-face) found)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1297 (when (and (not (memq all '(groups faces))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1298 (boundp symbol) |
67510
984ab2cd1b98
(customize-apropos): Avoid listing an option more than once under
Luc Teirlinck <teirllm@auburn.edu>
parents:
67413
diff
changeset
|
1299 (eq (indirect-variable symbol) symbol) |
17334 | 1300 (or (get symbol 'saved-value) |
49104
b74a6560ecbb
(custom-variable-prompt): Doc change. Use custom-variable-p.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49013
diff
changeset
|
1301 (custom-variable-p symbol) |
67510
984ab2cd1b98
(customize-apropos): Avoid listing an option more than once under
Luc Teirlinck <teirllm@auburn.edu>
parents:
67413
diff
changeset
|
1302 (and (not (memq all '(nil options))) |
984ab2cd1b98
(customize-apropos): Avoid listing an option more than once under
Luc Teirlinck <teirllm@auburn.edu>
parents:
67413
diff
changeset
|
1303 (get symbol 'variable-documentation)))) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1304 (push (list symbol 'custom-variable) found))))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1305 (if (not found) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1306 (error "No matches") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1307 (custom-buffer-create (custom-sort-items found t |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1308 custom-buffer-order-groups) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1309 "*Customize Apropos*")))) |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1310 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1311 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1312 (defun customize-apropos-options (regexp &optional arg) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1313 "Customize all loaded customizable options matching REGEXP. |
67677
acbc5122c634
(customize-apropos, customize-apropos-options): Docstring changes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67660
diff
changeset
|
1314 With prefix arg, include variables that are not customizable options |
acbc5122c634
(customize-apropos, customize-apropos-options): Docstring changes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67660
diff
changeset
|
1315 \(but we recommend using `apropos-variable' instead)." |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1316 (interactive "sCustomize regexp: \nP") |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1317 (customize-apropos regexp (or arg 'options))) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1318 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1319 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1320 (defun customize-apropos-faces (regexp) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1321 "Customize all loaded faces matching REGEXP." |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1322 (interactive "sCustomize regexp: \n") |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1323 (customize-apropos regexp 'faces)) |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1324 |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1325 ;;;###autoload |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1326 (defun customize-apropos-groups (regexp) |
67549
9732906a9ef7
(customize-apropos, customize-apropos-options)
Luc Teirlinck <teirllm@auburn.edu>
parents:
67510
diff
changeset
|
1327 "Customize all loaded groups matching REGEXP." |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1328 (interactive "sCustomize regexp: \n") |
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
1329 (customize-apropos regexp 'groups)) |
17334 | 1330 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1331 ;;; Buffer. |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1332 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1333 (defcustom custom-buffer-style 'links |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1334 "Control the presentation style for customization buffers. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1335 The value should be a symbol, one of: |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1336 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1337 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
|
1338 links: groups have links to subgroups." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1339 :type '(radio (const brackets) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1340 (const links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1341 :group 'custom-buffer) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1342 |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1343 (defcustom custom-buffer-done-kill nil |
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1344 "*Non-nil means exiting a Custom buffer should kill it." |
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1345 :type 'boolean |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59795
diff
changeset
|
1346 :version "22.1" |
25685 | 1347 :group 'custom-buffer) |
1348 | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1349 (defcustom custom-buffer-indent 3 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1350 "Number of spaces to indent nested groups." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1351 :type 'integer |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1352 :group 'custom-buffer) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1353 |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1354 (defun custom-get-fresh-buffer (name) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1355 "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
|
1356 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
|
1357 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
|
1358 not for everybody." |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1359 ;; 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
|
1360 ;; 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
|
1361 (let ((buf (get-buffer name))) |
51429
b107764e9a67
(custom-get-fresh-buffer): Test for nonexistence buffer.
Lute Kamstra <lute@gnu.org>
parents:
51381
diff
changeset
|
1362 (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
|
1363 ;; 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
|
1364 (kill-buffer buf) |
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1365 (setq buf nil)) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1366 (if (null buf) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1367 (get-buffer-create name) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1368 (with-current-buffer buf |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1369 (kill-all-local-variables) |
51381
a2b5bb57e1c9
(custom-get-fresh-buffer): Be extra paranoid,
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51362
diff
changeset
|
1370 (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
|
1371 ;; 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
|
1372 ;; 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
|
1373 (let ((ols (overlay-lists))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1374 (dolist (ol (nconc (car ols) (cdr ols))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1375 (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
|
1376 (erase-buffer) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1377 buf)))) |
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1378 |
17334 | 1379 ;;;###autoload |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1380 (defun custom-buffer-create (options &optional name description) |
17334 | 1381 "Create a buffer containing OPTIONS. |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1382 Optional NAME is the name of the buffer. |
17334 | 1383 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
1384 SYMBOL is a customization option, and WIDGET is a widget for editing | |
1385 that option." | |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1386 (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
|
1387 (custom-buffer-create-internal options description)) |
17415 | 1388 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1389 ;;;###autoload |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1390 (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
|
1391 "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
|
1392 The result includes selecting that window. |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1393 Optional NAME is the name of the buffer. |
17415 | 1394 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
1395 SYMBOL is a customization option, and WIDGET is a widget for editing | |
1396 that option." | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1397 (unless name (setq name "*Customization*")) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1398 (let ((pop-up-windows t) |
22332
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
1399 (same-window-buffer-names nil) |
7ad747c6c5a9
(customize-group, customize-group-other-window)
Karl Heuer <kwzh@gnu.org>
parents:
22068
diff
changeset
|
1400 (same-window-regexps nil)) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1401 (pop-to-buffer (custom-get-fresh-buffer name)) |
57896
27e0c6aa31c5
(customize-group-other-window):
Richard M. Stallman <rms@gnu.org>
parents:
56161
diff
changeset
|
1402 (custom-buffer-create-internal options description))) |
18089 | 1403 |
1404 (defcustom custom-reset-button-menu nil | |
1405 "If non-nil, only show a single reset button in customize buffers. | |
1406 This button will have a menu with all three reset operations." | |
1407 :type 'boolean | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1408 :group 'custom-buffer) |
17415 | 1409 |
45102
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1410 (defcustom custom-buffer-verbose-help t |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1411 "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
|
1412 :type 'boolean |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1413 :group 'custom-buffer) |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1414 |
25685 | 1415 (defun Custom-buffer-done (&rest ignore) |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1416 "Exit current Custom buffer according to `custom-buffer-done-kill'." |
25685 | 1417 (interactive) |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1418 (quit-window custom-buffer-done-kill)) |
25685 | 1419 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1420 (defvar custom-button nil |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1421 "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
|
1422 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1423 (defvar custom-button-mouse nil |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1424 "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
|
1425 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1426 (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
|
1427 "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
|
1428 |
25685 | 1429 (defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box) |
1430 '(("unspecified" . unspecified)))) | |
1431 "If non-nil, indicate active buttons in a `raised-button' style. | |
1432 Otherwise use brackets." | |
1433 :type 'boolean | |
1434 :version "21.1" | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1435 :group 'custom-buffer |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1436 :set (lambda (variable value) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1437 (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
|
1438 (setq custom-button |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1439 (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
|
1440 (setq custom-button-mouse |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1441 (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
|
1442 (setq custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1443 (if value |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1444 'custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1445 'custom-button-pressed-unraised)))) |
25685 | 1446 |
18571
1beba85e8c62
(custom-buffer-create-internal): New arg DESCRIPTION
Richard M. Stallman <rms@gnu.org>
parents:
18562
diff
changeset
|
1447 (defun custom-buffer-create-internal (options &optional description) |
17334 | 1448 (custom-mode) |
45102
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1449 (if custom-buffer-verbose-help |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1450 (progn |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1451 (widget-insert "This is a customization buffer") |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1452 (if description |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1453 (widget-insert description)) |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1454 (widget-insert (format ". |
67745
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1455 %s buttons; type RET or click mouse-1 to actuate one. |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1456 Editing a setting changes only the text in the buffer. |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1457 Use the setting's State button to set it or save changes in it. |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1458 Saving a change normally works by editing your Emacs init file. |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1459 See " |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1460 (if custom-raised-buttons |
67745
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1461 "`Raised' text indicates" |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1462 "Square brackets indicate"))) |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1463 (widget-create 'custom-manual |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1464 :tag "Custom file" |
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1465 "(emacs)Saving Customizations") |
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1466 (widget-insert |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1467 " for information on how to save in a different file.\n |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1468 See ") |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1469 (widget-create 'custom-manual |
45102
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1470 :tag "Help" |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1471 :help-echo "Read the online help." |
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1472 "(emacs)Easy Customization") |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1473 (widget-insert " for more information.\n\n") |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
1474 (widget-insert "Operate on all settings in this buffer that \ |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
1475 are not marked HIDDEN:\n ")) |
45102
387844a1f703
(custom-buffer-verbose-help): New variable.
Kim F. Storm <storm@cua.dk>
parents:
44912
diff
changeset
|
1476 (widget-insert " ")) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1477 (widget-create 'push-button |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1478 :tag "Set for Current Session" |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1479 :help-echo "\ |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1480 Make your editing in this buffer take effect for this session." |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1481 :action (lambda (widget &optional event) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1482 (Custom-set))) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1483 (if (not custom-buffer-verbose-help) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1484 (progn |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1485 (widget-insert " ") |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1486 (widget-create 'custom-manual |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1487 :tag "Help" |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1488 :help-echo "Read the online help." |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1489 "(emacs)Easy Customization"))) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1490 (when (or custom-file user-init-file) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1491 (widget-insert " ") |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1492 (widget-create 'push-button |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1493 :tag "Save for Future Sessions" |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1494 :help-echo "\ |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1495 Make your editing in this buffer take effect for future Emacs sessions. |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1496 This updates your Emacs initialization file or creates a new one." |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1497 :action (lambda (widget &optional event) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
1498 (Custom-save)))) |
18089 | 1499 (if custom-reset-button-menu |
18460
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1500 (progn |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1501 (widget-insert " ") |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1502 (widget-create 'push-button |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
1503 :tag "Reset buffer" |
18460
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1504 :help-echo "Show a menu with reset operations." |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1505 :mouse-down-action (lambda (&rest junk) t) |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1506 :action (lambda (widget &optional event) |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1507 (custom-reset event)))) |
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
1508 (widget-insert "\n ") |
18089 | 1509 (widget-create 'push-button |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
1510 :tag "Undo Edits" |
18139
ee3c0d09dcd3
Synched with 1.9908.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18131
diff
changeset
|
1511 :help-echo "\ |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1512 Reset all edited text in this buffer to reflect current values." |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
1513 :action 'Custom-reset-current) |
18089 | 1514 (widget-insert " ") |
1515 (widget-create 'push-button | |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
1516 :tag "Reset to Saved" |
18139
ee3c0d09dcd3
Synched with 1.9908.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18131
diff
changeset
|
1517 :help-echo "\ |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
1518 Reset all settings in this buffer to their saved values." |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
1519 :action 'Custom-reset-saved) |
68017
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1520 (widget-insert " ") |
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1521 (when (or custom-file user-init-file) |
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1522 (widget-create 'push-button |
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1523 :tag "Erase Customization" |
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1524 :help-echo "\ |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
1525 Un-customize all settings in this buffer and save them with standard values." |
68017
025bb43a4fe6
(custom-buffer-create-internal): Move whole buffer "Erase Customization"
Luc Teirlinck <teirllm@auburn.edu>
parents:
67983
diff
changeset
|
1526 :action 'Custom-reset-standard))) |
18373
45ef45c34aa4
(custom-buffer-create-internal):
Richard M. Stallman <rms@gnu.org>
parents:
18371
diff
changeset
|
1527 (widget-insert " ") |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1528 (widget-create 'push-button |
25685 | 1529 :tag "Finish" |
30247
80383e9be1e2
(custom-buffer-create-internal): Use a help-echo function to be more
Dave Love <fx@gnu.org>
parents:
30184
diff
changeset
|
1530 :help-echo |
80383e9be1e2
(custom-buffer-create-internal): Use a help-echo function to be more
Dave Love <fx@gnu.org>
parents:
30184
diff
changeset
|
1531 (lambda (&rest ignore) |
59795
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1532 (if custom-buffer-done-kill |
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1533 "Kill this buffer" |
ba8c5b54e390
(custom-bury-buffer): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
59760
diff
changeset
|
1534 "Bury this buffer")) |
25685 | 1535 :action #'Custom-buffer-done) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1536 (widget-insert "\n\n") |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1537 (message "Creating customization items...") |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1538 (buffer-disable-undo) |
25685 | 1539 (setq custom-options |
17334 | 1540 (if (= (length options) 1) |
1541 (mapcar (lambda (entry) | |
1542 (widget-create (nth 1 entry) | |
18139
ee3c0d09dcd3
Synched with 1.9908.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18131
diff
changeset
|
1543 :documentation-shown t |
17334 | 1544 :custom-state 'unknown |
1545 :tag (custom-unlispify-tag-name | |
1546 (nth 0 entry)) | |
1547 :value (nth 0 entry))) | |
1548 options) | |
1549 (let ((count 0) | |
1550 (length (length options))) | |
1551 (mapcar (lambda (entry) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1552 (prog2 |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1553 (message "Creating customization items ...%2d%%" |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1554 (/ (* 100.0 count) length)) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1555 (widget-create (nth 1 entry) |
17334 | 1556 :tag (custom-unlispify-tag-name |
1557 (nth 0 entry)) | |
1558 :value (nth 0 entry)) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1559 (setq count (1+ count)) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1560 (unless (eq (preceding-char) ?\n) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1561 (widget-insert "\n")) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1562 (widget-insert "\n"))) |
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
1563 options)))) |
17334 | 1564 (unless (eq (preceding-char) ?\n) |
1565 (widget-insert "\n")) | |
39153
001cb5cd0de9
(custom-buffer-create-internal): Remove "100%" from
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
1566 (message "Creating customization items ...done") |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1567 (message "Resetting customization items...") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1568 (unless (eq custom-buffer-style 'tree) |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1569 (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
|
1570 (message "Resetting customization items...done") |
17334 | 1571 (message "Creating customization setup...") |
1572 (widget-setup) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
1573 (buffer-enable-undo) |
17334 | 1574 (goto-char (point-min)) |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1575 (message "Creating customization setup...done")) |
17334 | 1576 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1577 ;;; The Tree Browser. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1578 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1579 ;;;###autoload |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1580 (defun customize-browse (&optional group) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1581 "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
|
1582 (interactive) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1583 (unless group |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1584 (setq group 'emacs)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1585 (let ((name "*Customize Browser*")) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
1586 (pop-to-buffer (custom-get-fresh-buffer name))) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1587 (custom-mode) |
67745
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1588 (widget-insert (format "\ |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1589 %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
|
1590 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
|
1591 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
|
1592 (if custom-raised-buttons |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1593 "`Raised' text indicates" |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1594 "Square brackets indicate"))) |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1595 |
1c2cd41aeda7
(customize-browse): Reword the top-of-buffer help intro.
Richard M. Stallman <rms@gnu.org>
parents:
67744
diff
changeset
|
1596 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1597 (if custom-browse-only-groups |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1598 (widget-insert "\ |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1599 Invoke the [Group] button below to edit that item in another window.\n\n") |
25685 | 1600 (widget-insert "Invoke the ") |
1601 (widget-create 'item | |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1602 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1603 :tag "[Group]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1604 :tag-glyph "folder") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1605 (widget-insert ", ") |
25685 | 1606 (widget-create 'item |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1607 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1608 :tag "[Face]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1609 :tag-glyph "face") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1610 (widget-insert ", and ") |
25685 | 1611 (widget-create 'item |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1612 :format "%t" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1613 :tag "[Option]" |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1614 :tag-glyph "option") |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1615 (widget-insert " buttons below to edit that |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1616 item in another window.\n\n")) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1617 (let ((custom-buffer-style 'tree)) |
25685 | 1618 (widget-create 'custom-group |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1619 :custom-last t |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1620 :custom-state 'unknown |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1621 :tag (custom-unlispify-tag-name group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1622 :value group)) |
48997
eb9dca992edf
(customize-browse): Call `widget-setup'.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48975
diff
changeset
|
1623 (widget-setup) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
1624 (goto-char (point-min))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1625 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1626 (define-widget 'custom-browse-visibility 'item |
20600
323f33e3e92c
(custom-browse-visibility): Doc fix.
Andreas Schwab <schwab@suse.de>
parents:
20562
diff
changeset
|
1627 "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
|
1628 :format "%[[%t]%]" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1629 :action 'custom-browse-visibility-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1630 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1631 (defun custom-browse-visibility-action (widget &rest ignore) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1632 (let ((custom-buffer-style 'tree)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1633 (custom-toggle-parent widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1634 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1635 (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
|
1636 "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
|
1637 :tag "Group" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1638 :tag-glyph "folder" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1639 :action 'custom-browse-group-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1640 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1641 (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
|
1642 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1643 (customize-group-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1644 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1645 (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
|
1646 "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
|
1647 :tag "Option" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1648 :tag-glyph "option" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1649 :action 'custom-browse-variable-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1650 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1651 (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
|
1652 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1653 (customize-variable-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1654 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1655 (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
|
1656 "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
|
1657 :tag "Face" |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1658 :tag-glyph "face" |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1659 :action 'custom-browse-face-tag-action) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1660 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1661 (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
|
1662 (let ((parent (widget-get widget :parent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1663 (customize-face-other-window (widget-value parent)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1664 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1665 (defconst custom-browse-alist '((" " "space") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1666 (" | " "vertical") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1667 ("-\\ " "top") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1668 (" |-" "middle") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1669 (" `-" "bottom"))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1670 |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
1671 (defun custom-browse-insert-prefix (prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1672 "Insert PREFIX. On XEmacs convert it to line graphics." |
25685 | 1673 ;; Fixme: do graphics. |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1674 (if nil ; (string-match "XEmacs" emacs-version) |
25685 | 1675 (progn |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1676 (insert "*") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1677 (while (not (string-equal prefix "")) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1678 (let ((entry (substring prefix 0 3))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1679 (setq prefix (substring prefix 3)) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1680 (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
|
1681 (name (nth 1 (assoc entry custom-browse-alist)))) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1682 (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
|
1683 (overlay-put overlay 'start-open t) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1684 (overlay-put overlay 'end-open t))))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1685 (insert prefix))) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
1686 |
17334 | 1687 ;;; Modification of Basic Widgets. |
1688 ;; | |
1689 ;; We add extra properties to the basic widgets needed here. This is | |
1690 ;; fine, as long as we are careful to stay within out own namespace. | |
1691 ;; | |
1692 ;; We want simple widgets to be displayed by default, but complex | |
1693 ;; widgets to be hidden. | |
1694 | |
1695 (widget-put (get 'item 'widget-type) :custom-show t) | |
1696 (widget-put (get 'editable-field 'widget-type) | |
1697 :custom-show (lambda (widget value) | |
1698 (let ((pp (pp-to-string value))) | |
1699 (cond ((string-match "\n" pp) | |
1700 nil) | |
1701 ((> (length pp) 40) | |
1702 nil) | |
1703 (t t))))) | |
1704 (widget-put (get 'menu-choice 'widget-type) :custom-show t) | |
1705 | |
1706 ;;; The `custom-manual' Widget. | |
1707 | |
1708 (define-widget 'custom-manual 'info-link | |
1709 "Link to the manual entry for this customization option." | |
1710 :help-echo "Read the manual entry for this option." | |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
1711 :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
|
1712 :mouse-face 'highlight |
68892
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
1713 :pressed-face 'highlight |
17334 | 1714 :tag "Manual") |
1715 | |
1716 ;;; The `custom-magic' Widget. | |
1717 | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1718 (defgroup custom-magic-faces nil |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1719 "Faces used by the magic button." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1720 :group 'custom-faces |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1721 :group 'custom-buffer) |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1722 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1723 (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
|
1724 (: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
|
1725 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1726 (:weight bold :slant italic :underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1727 "Face used when the customize item is invalid." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1728 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1729 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1730 (put 'custom-invalid-face 'face-alias 'custom-invalid) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1731 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1732 (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
|
1733 (: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
|
1734 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1735 (:underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1736 "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
|
1737 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1738 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1739 (put 'custom-rogue-face 'face-alias 'custom-rogue) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1740 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1741 (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
|
1742 (: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
|
1743 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1744 (: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
|
1745 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1746 (:slant italic :bold))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1747 "Face used when the customize item has been modified." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1748 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1749 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1750 (put 'custom-modified-face 'face-alias 'custom-modified) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1751 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1752 (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
|
1753 (: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
|
1754 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1755 (: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
|
1756 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1757 (:slant italic))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1758 "Face used when the customize item has been set." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1759 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1760 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1761 (put 'custom-set-face 'face-alias 'custom-set) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1762 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1763 (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
|
1764 (: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
|
1765 (((class color)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1766 (: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
|
1767 (t |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1768 (:slant italic))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1769 "Face used when the customize item has been changed." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1770 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1771 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1772 (put 'custom-changed-face 'face-alias 'custom-changed) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1773 |
67783
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1774 (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
|
1775 (:foreground "white" :background "blue1")) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1776 (((class color)) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1777 (:foreground "white" :background "blue")) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1778 (t |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1779 (:slant italic))) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1780 "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
|
1781 :group 'custom-magic-faces) |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1782 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1783 (defface custom-saved '((t (:underline t))) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1784 "Face used when the customize item has been saved." |
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1785 :group 'custom-magic-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1786 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1787 (put 'custom-saved-face 'face-alias 'custom-saved) |
17334 | 1788 |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1789 (defconst custom-magic-alist |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1790 '((nil "#" underline "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1791 UNINITIALIZED, you should not see this.") |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1792 (unknown "?" italic "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1793 UNKNOWN, you should not see this.") |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
1794 (hidden "-" default "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1795 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
|
1796 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
|
1797 (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
|
1798 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
|
1799 (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
|
1800 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
|
1801 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
|
1802 (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
|
1803 SET for current session only." "\ |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
1804 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
|
1805 (changed ":" custom-changed "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1806 CHANGED outside Customize; operating on it here may be unreliable." "\ |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1807 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
|
1808 (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
|
1809 SAVED and set." "\ |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1810 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
|
1811 (themed "o" custom-themed "\ |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1812 THEMED." "\ |
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
1813 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
|
1814 (rogue "@" custom-rogue "\ |
67600
d14352717f67
Introductory comment change.
Luc Teirlinck <teirllm@auburn.edu>
parents:
67549
diff
changeset
|
1815 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
|
1816 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
|
1817 (standard " " nil "\ |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1818 STANDARD." "\ |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
1819 visible group members are all at standard values.")) |
17334 | 1820 "Alist of customize option states. |
25685 | 1821 Each entry is of the form (STATE MAGIC FACE ITEM-DESC [ GROUP-DESC ]), where |
17334 | 1822 |
1823 STATE is one of the following symbols: | |
1824 | |
1825 `nil' | |
1826 For internal use, should never occur. | |
1827 `unknown' | |
1828 For internal use, should never occur. | |
1829 `hidden' | |
25685 | 1830 This item is not being displayed. |
17334 | 1831 `invalid' |
1832 This item is modified, but has an invalid form. | |
1833 `modified' | |
1834 This item is modified, and has a valid form. | |
1835 `set' | |
1836 This item has been set but not saved. | |
1837 `changed' | |
60295
53b5914886cc
(custom-buffer-create-internal): Slightly reword text at top of Custom
Luc Teirlinck <teirllm@auburn.edu>
parents:
60280
diff
changeset
|
1838 The current value of this item has been changed outside Customize. |
17334 | 1839 `saved' |
1840 This item is marked for saving. | |
1841 `rogue' | |
1842 This item has no customization information. | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1843 `standard' |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1844 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
|
1845 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1846 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
|
1847 |
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
1848 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
|
1849 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1850 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
|
1851 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1852 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
|
1853 left out, ITEM-DESC will be used. |
17334 | 1854 |
18089 | 1855 The string %c in either description will be replaced with the |
1856 category of the item. These are `group'. `option', and `face'. | |
1857 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1858 The list should be sorted most significant first.") |
17334 | 1859 |
1860 (defcustom custom-magic-show 'long | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1861 "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
|
1862 If `long', show a full-line description, not just one word." |
17334 | 1863 :type '(choice (const :tag "no" nil) |
22600
2f3b4c74e9a1
(custom-magic-show): Use `other' widget type.
Andreas Schwab <schwab@suse.de>
parents:
22538
diff
changeset
|
1864 (const long) |
2f3b4c74e9a1
(custom-magic-show): Use `other' widget type.
Andreas Schwab <schwab@suse.de>
parents:
22538
diff
changeset
|
1865 (other :tag "short" short)) |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1866 :group 'custom-buffer) |
17334 | 1867 |
18089 | 1868 (defcustom custom-magic-show-hidden '(option face) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1869 "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
|
1870 The value should be a list with the custom categories where the State |
18089 | 1871 button should be visible. Possible categories are `group', `option', |
1872 and `face'." | |
1873 :type '(set (const group) (const option) (const face)) | |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1874 :group 'custom-buffer) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1875 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1876 (defcustom custom-magic-show-button nil |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1877 "Show a \"magic\" button indicating the state of each customization option." |
17334 | 1878 :type 'boolean |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
1879 :group 'custom-buffer) |
17334 | 1880 |
1881 (define-widget 'custom-magic 'default | |
1882 "Show and manipulate state for a customization option." | |
1883 :format "%v" | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1884 :action 'widget-parent-action |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
1885 :notify 'ignore |
17334 | 1886 :value-get 'ignore |
1887 :value-create 'custom-magic-value-create | |
1888 :value-delete 'widget-children-value-delete) | |
1889 | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1890 (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
|
1891 ;; Non-nil unless hidden. |
25685 | 1892 (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
|
1893 :custom-state) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1894 'hidden))) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1895 |
17334 | 1896 (defun custom-magic-value-create (widget) |
28130 | 1897 "Create compact status report for WIDGET." |
17334 | 1898 (let* ((parent (widget-get widget :parent)) |
1899 (state (widget-get parent :custom-state)) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1900 (hidden (eq state 'hidden)) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1901 (entry (assq state custom-magic-alist)) |
17334 | 1902 (magic (nth 1 entry)) |
1903 (face (nth 2 entry)) | |
18089 | 1904 (category (widget-get parent :custom-category)) |
1905 (text (or (and (eq category 'group) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1906 (nth 4 entry)) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1907 (nth 3 entry))) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1908 (form (widget-get parent :custom-form)) |
17334 | 1909 children) |
18089 | 1910 (while (string-match "\\`\\(.*\\)%c\\(.*\\)\\'" text) |
25685 | 1911 (setq text (concat (match-string 1 text) |
18089 | 1912 (symbol-name category) |
1913 (match-string 2 text)))) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1914 (when (and custom-magic-show |
18089 | 1915 (or (not hidden) |
1916 (memq category custom-magic-show-hidden))) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1917 (insert " ") |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1918 (when (and (eq category 'group) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1919 (not (and (eq custom-buffer-style 'links) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1920 (> (widget-get parent :custom-level) 1)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1921 (insert-char ?\ (* custom-buffer-indent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1922 (widget-get parent :custom-level)))) |
25685 | 1923 (push (widget-create-child-and-convert |
1924 widget 'choice-item | |
18087 | 1925 :help-echo "Change the state of this item." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1926 :format (if hidden "%t" "%[%t%]") |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1927 :button-prefix 'widget-push-button-prefix |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
1928 :button-suffix 'widget-push-button-suffix |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1929 :mouse-down-action 'widget-magic-mouse-down-action |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1930 :tag "State") |
17334 | 1931 children) |
1932 (insert ": ") | |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1933 (let ((start (point))) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1934 (if (eq custom-magic-show 'long) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1935 (insert text) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
1936 (insert (symbol-name state))) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1937 (cond ((eq form 'lisp) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1938 (insert " (lisp)")) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1939 ((eq form 'mismatch) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1940 (insert " (mismatch)"))) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1941 (put-text-property start (point) 'face 'custom-state)) |
17334 | 1942 (insert "\n")) |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1943 (when (and (eq category 'group) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1944 (not (and (eq custom-buffer-style 'links) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
1945 (> (widget-get parent :custom-level) 1)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1946 (insert-char ?\ (* custom-buffer-indent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
1947 (widget-get parent :custom-level)))) |
17334 | 1948 (when custom-magic-show-button |
1949 (when custom-magic-show | |
1950 (let ((indent (widget-get parent :indent))) | |
1951 (when indent | |
1952 (insert-char ? indent)))) | |
25685 | 1953 (push (widget-create-child-and-convert |
1954 widget 'choice-item | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1955 :mouse-down-action 'widget-magic-mouse-down-action |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1956 :button-face face |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1957 :button-prefix "" |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1958 :button-suffix "" |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1959 :help-echo "Change the state." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
1960 :format (if hidden "%t" "%[%t%]") |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
1961 :tag (if (memq form '(lisp mismatch)) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1962 (concat "(" magic ")") |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
1963 (concat "[" magic "]"))) |
17334 | 1964 children) |
1965 (insert " ")) | |
1966 (widget-put widget :children children))) | |
1967 | |
1968 (defun custom-magic-reset (widget) | |
1969 "Redraw the :custom-magic property of WIDGET." | |
1970 (let ((magic (widget-get widget :custom-magic))) | |
1971 (widget-value-set magic (widget-value magic)))) | |
1972 | |
1973 ;;; The `custom' Widget. | |
1974 | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1975 (defface custom-button |
32883
105ad8d20e29
(custom-button-face, custom-button-pressed-face): Merge x w32 and mac
Jason Rumney <jasonr@gnu.org>
parents:
32752
diff
changeset
|
1976 '((((type x w32 mac) (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
|
1977 (: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
|
1978 :background "lightgrey" :foreground "black")) |
25685 | 1979 (t |
1980 nil)) | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1981 "Face for custom buffer buttons if `custom-raised-buttons' is non-nil." |
25685 | 1982 :version "21.1" |
1983 :group 'custom-faces) | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1984 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1985 (put 'custom-button-face 'face-alias 'custom-button) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
1986 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1987 (defface custom-button-mouse |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1988 '((((type x w32 mac) (class color)) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1989 (: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
|
1990 :background "grey90" :foreground "black")) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1991 (t |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1992 nil)) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1993 "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
|
1994 :version "22.1" |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1995 :group 'custom-faces) |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
1996 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1997 (defface custom-button-unraised |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
1998 '((t :inherit underline)) |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
1999 "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
|
2000 :version "22.1" |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2001 :group 'custom-faces) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2002 |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2003 (setq custom-button |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2004 (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
|
2005 |
67961
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2006 (setq custom-button-mouse |
52f526ce11f6
* cus-edit.el (custom-button-mouse): New variable.
Chong Yidong <cyd@stupidchicken.com>
parents:
67941
diff
changeset
|
2007 (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
|
2008 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2009 (defface custom-button-pressed |
32883
105ad8d20e29
(custom-button-face, custom-button-pressed-face): Merge x w32 and mac
Jason Rumney <jasonr@gnu.org>
parents:
32752
diff
changeset
|
2010 '((((type x w32 mac) (class color)) |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31744
diff
changeset
|
2011 (: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
|
2012 :background "lightgrey" :foreground "black")) |
25685 | 2013 (t |
2014 (:inverse-video t))) | |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2015 "Face for pressed custom buttons if `custom-raised-buttons' is non-nil." |
25685 | 2016 :version "21.1" |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2017 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2018 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2019 (put 'custom-button-pressed-face 'face-alias 'custom-button-pressed) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2020 |
66336
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2021 (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
|
2022 '((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
|
2023 (((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
|
2024 (((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
|
2025 "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
|
2026 :version "22.1" |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2027 :group 'custom-faces) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2028 |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2029 (setq custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2030 (if custom-raised-buttons |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2031 'custom-button-pressed |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2032 'custom-button-pressed-unraised)) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
2033 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2034 (defface custom-documentation nil |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2035 "Face used for documentation strings in customization buffers." |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2036 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2037 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2038 (put 'custom-documentation-face 'face-alias 'custom-documentation) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2039 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2040 (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
|
2041 (background dark)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2042 (: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
|
2043 (((class color) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2044 (background light)) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2045 (: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
|
2046 (t nil)) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2047 "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
|
2048 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2049 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2050 (put 'custom-state-face 'face-alias 'custom-state) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2051 |
68020
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
2052 (defface custom-link |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2053 '((t :inherit link)) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2054 "Face for links in customization buffers." |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2055 :version "22.1" |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
2056 :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
|
2057 |
17334 | 2058 (define-widget 'custom 'default |
2059 "Customize a user option." | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2060 :format "%v" |
17334 | 2061 :convert-widget 'custom-convert-widget |
2062 :notify 'custom-notify | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2063 :custom-prefix "" |
17334 | 2064 :custom-level 1 |
2065 :custom-state 'hidden | |
2066 :documentation-property 'widget-subclass-responsibility | |
2067 :value-create 'widget-subclass-responsibility | |
2068 :value-delete 'widget-children-value-delete | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2069 :value-get 'widget-value-value-get |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2070 :validate 'widget-children-validate |
17334 | 2071 :match (lambda (widget value) (symbolp value))) |
2072 | |
2073 (defun custom-convert-widget (widget) | |
28130 | 2074 "Initialize :value and :tag from :args in WIDGET." |
17334 | 2075 (let ((args (widget-get widget :args))) |
25685 | 2076 (when args |
17334 | 2077 (widget-put widget :value (widget-apply widget |
2078 :value-to-internal (car args))) | |
2079 (widget-put widget :tag (custom-unlispify-tag-name (car args))) | |
2080 (widget-put widget :args nil))) | |
2081 widget) | |
2082 | |
2083 (defun custom-notify (widget &rest args) | |
2084 "Keep track of changes." | |
18090 | 2085 (let ((state (widget-get widget :custom-state))) |
2086 (unless (eq state 'modified) | |
2087 (unless (memq state '(nil unknown hidden)) | |
2088 (widget-put widget :custom-state 'modified)) | |
2089 (custom-magic-reset widget) | |
2090 (apply 'widget-default-notify widget args)))) | |
17334 | 2091 |
2092 (defun custom-redraw (widget) | |
2093 "Redraw WIDGET with current settings." | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2094 (let ((line (count-lines (point-min) (point))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2095 (column (current-column)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2096 (pos (point)) |
17334 | 2097 (from (marker-position (widget-get widget :from))) |
2098 (to (marker-position (widget-get widget :to)))) | |
2099 (save-excursion | |
2100 (widget-value-set widget (widget-value widget)) | |
2101 (custom-redraw-magic widget)) | |
2102 (when (and (>= pos from) (<= pos to)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2103 (condition-case nil |
25685 | 2104 (progn |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2105 (if (> column 0) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2106 (goto-line line) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2107 (goto-line (1+ line))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2108 (move-to-column column)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2109 (error nil))))) |
17334 | 2110 |
2111 (defun custom-redraw-magic (widget) | |
2112 "Redraw WIDGET state with current settings." | |
25685 | 2113 (while widget |
17334 | 2114 (let ((magic (widget-get widget :custom-magic))) |
25685 | 2115 (cond (magic |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2116 (widget-value-set magic (widget-value magic)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2117 (when (setq widget (widget-get widget :group)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2118 (custom-group-state-update widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2119 (t |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2120 (setq widget nil))))) |
17334 | 2121 (widget-setup)) |
2122 | |
2123 (defun custom-show (widget value) | |
2124 "Non-nil if WIDGET should be shown with VALUE by default." | |
2125 (let ((show (widget-get widget :custom-show))) | |
2126 (cond ((null show) | |
2127 nil) | |
2128 ((eq t show) | |
2129 t) | |
2130 (t | |
2131 (funcall show widget value))))) | |
2132 | |
2133 (defun custom-load-widget (widget) | |
2134 "Load all dependencies for WIDGET." | |
2135 (custom-load-symbol (widget-value widget))) | |
2136 | |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2137 (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
|
2138 "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
|
2139 (let ((found nil) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2140 (loads (get symbol 'custom-loads)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2141 load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2142 (while loads |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2143 (setq load (car loads) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2144 loads (cdr loads)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2145 (cond ((symbolp load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2146 (unless (featurep load) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2147 (setq found t))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2148 ((assoc load load-history)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2149 ((assoc (locate-library load) load-history) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2150 (message nil)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2151 (t |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2152 (setq found t)))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2153 found)) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2154 |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2155 (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
|
2156 "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
|
2157 (custom-unloaded-symbol-p (widget-value widget))) |
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2158 |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2159 (defun custom-toggle-hide (widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2160 "Toggle visibility of WIDGET." |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2161 (custom-load-widget widget) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2162 (let ((state (widget-get widget :custom-state))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2163 (cond ((memq state '(invalid modified)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2164 (error "There are unset changes")) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2165 ((eq state 'hidden) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2166 (widget-put widget :custom-state 'unknown)) |
25685 | 2167 (t |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2168 (widget-put widget :documentation-shown nil) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2169 (widget-put widget :custom-state 'hidden))) |
18258
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2170 (custom-redraw widget) |
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2171 (widget-setup))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2172 |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2173 (defun custom-toggle-parent (widget &rest ignore) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2174 "Toggle visibility of parent of WIDGET." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2175 (custom-toggle-hide (widget-get widget :parent))) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2176 |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2177 (defun custom-add-see-also (widget &optional prefix) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2178 "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
|
2179 Insert PREFIX first if non-nil." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2180 (let* ((symbol (widget-get widget :value)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2181 (links (get symbol 'custom-links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2182 (many (> (length links) 2)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2183 (buttons (widget-get widget :buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2184 (indent (widget-get widget :indent))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2185 (when links |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2186 (when indent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2187 (insert-char ?\ indent)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2188 (when prefix |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2189 (insert prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2190 (insert "See also ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2191 (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
|
2192 (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
|
2193 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
|
2194 :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
|
2195 :mouse-face 'highlight |
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
2196 :pressed-face 'highlight) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2197 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2198 (setq links (cdr links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2199 (cond ((null links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2200 (insert ".\n")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2201 ((null (cdr links)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2202 (if many |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2203 (insert ", and ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2204 (insert " and "))) |
25685 | 2205 (t |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2206 (insert ", ")))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2207 (widget-put widget :buttons buttons)))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2208 |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
2209 (defun custom-add-parent-links (widget &optional initial-string) |
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
2210 "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
|
2211 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
|
2212 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
|
2213 (let ((name (widget-value widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2214 (type (widget-type widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2215 (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
|
2216 (start (point)) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2217 (parents nil)) |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
2218 (insert (or initial-string "Parent groups:")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2219 (mapatoms (lambda (symbol) |
66904
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2220 (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
|
2221 (insert " ") |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2222 (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
|
2223 widget 'custom-group-link |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2224 :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
|
2225 symbol) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2226 buttons) |
b39a51cbc6b6
(custom-add-parent-links): Fix bug whereby, for instance,
Luc Teirlinck <teirllm@auburn.edu>
parents:
66859
diff
changeset
|
2227 (setq parents (cons symbol parents))))) |
54721
5b50970ffa95
2004-04-05 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
54312
diff
changeset
|
2228 (and (null (get name 'custom-links)) ;No links of its own. |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2229 (= (length parents) 1) ;A single parent. |
67378
3fe860e6e6eb
(custom-add-parent-links): Filter out custom-group-link,
Juri Linkov <juri@jurta.org>
parents:
67298
diff
changeset
|
2230 (let* ((links (delq nil (mapcar (lambda (w) |
3fe860e6e6eb
(custom-add-parent-links): Filter out custom-group-link,
Juri Linkov <juri@jurta.org>
parents:
67298
diff
changeset
|
2231 (unless (eq (widget-type w) |
3fe860e6e6eb
(custom-add-parent-links): Filter out custom-group-link,
Juri Linkov <juri@jurta.org>
parents:
67298
diff
changeset
|
2232 'custom-group-link) |
3fe860e6e6eb
(custom-add-parent-links): Filter out custom-group-link,
Juri Linkov <juri@jurta.org>
parents:
67298
diff
changeset
|
2233 w)) |
3fe860e6e6eb
(custom-add-parent-links): Filter out custom-group-link,
Juri Linkov <juri@jurta.org>
parents:
67298
diff
changeset
|
2234 (get (car parents) 'custom-links)))) |
53319
36b31fc002f2
2003-12-12 Jesper Harder <harder@ifa.au.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
53223
diff
changeset
|
2235 (many (> (length links) 2))) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2236 (when links |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2237 (insert "\nParent documentation: ") |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2238 (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
|
2239 (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
|
2240 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
|
2241 :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
|
2242 :mouse-face 'highlight |
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
2243 :pressed-face 'highlight) |
53223
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2244 buttons) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2245 (setq links (cdr links)) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2246 (cond ((null links) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2247 (insert ".\n")) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2248 ((null (cdr links)) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2249 (if many |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2250 (insert ", and ") |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2251 (insert " and "))) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2252 (t |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2253 (insert ", "))))))) |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2254 (if parents |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2255 (insert "\n") |
1fa5a4fc03e5
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
52401
diff
changeset
|
2256 (delete-region start (point))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2257 (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
|
2258 parents)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2259 |
25685 | 2260 ;;; The `custom-comment' Widget. |
2261 | |
2262 ;; like the editable field | |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2263 (defface custom-comment '((((type tty)) |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2264 :background "yellow3" |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2265 :foreground "black") |
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2266 (((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
|
2267 (background light)) |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2268 :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
|
2269 (((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
|
2270 (background dark)) |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2271 :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
|
2272 (t |
68109
d42505f2ff8c
(custom-comment) <defface>: Add TTY definitions.
John Paul Wallington <jpw@pobox.com>
parents:
68086
diff
changeset
|
2273 :slant italic)) |
25685 | 2274 "Face used for comments on variables or faces" |
2275 :version "21.1" | |
2276 :group 'custom-faces) | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2277 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2278 (put 'custom-comment-face 'face-alias 'custom-comment) |
25685 | 2279 |
2280 ;; 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
|
2281 (defface custom-comment-tag |
25685 | 2282 '((((class color) (background dark)) (:foreground "gray80")) |
2283 (((class color) (background light)) (:foreground "blue4")) | |
2284 (((class grayscale) (background light)) | |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2285 (:foreground "DimGray" :weight bold :slant italic)) |
25685 | 2286 (((class grayscale) (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2287 (: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
|
2288 (t (:weight bold))) |
25685 | 2289 "Face used for variables or faces comment tags" |
2290 :group 'custom-faces) | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2291 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2292 (put 'custom-comment-tag-face 'face-alias 'custom-comment-tag) |
25685 | 2293 |
2294 (define-widget 'custom-comment 'string | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2295 "User comment." |
25685 | 2296 :tag "Comment" |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2297 :help-echo "Edit a comment here." |
25685 | 2298 :sample-face 'custom-comment-tag-face |
2299 :value-face 'custom-comment-face | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2300 :shown nil |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2301 :create 'custom-comment-create) |
25685 | 2302 |
2303 (defun custom-comment-create (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2304 (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
|
2305 (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
|
2306 (not null-comment)) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2307 (widget-default-create widget) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2308 ;; `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
|
2309 ;; maybe it shouldn't. |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2310 (widget-put widget :from (point-marker)) |
f54121af02c8
(custom-comment-create): Fill :from and :to slots
Dave Love <fx@gnu.org>
parents:
25840
diff
changeset
|
2311 (widget-put widget :to (point-marker))))) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2312 |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2313 (defun custom-comment-hide (widget) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2314 (widget-put (widget-get widget :parent) :comment-shown nil)) |
25685 | 2315 |
2316 ;; Those functions are for the menu. WIDGET is NOT the comment widget. It's | |
2317 ;; the global custom one | |
2318 (defun custom-comment-show (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2319 (widget-put widget :comment-shown t) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2320 (custom-redraw widget) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2321 (widget-setup)) |
25685 | 2322 |
2323 (defun custom-comment-invisible-p (widget) | |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2324 (let ((val (widget-value (widget-get widget :comment-widget)))) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2325 (and (equal "" val) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2326 (not (widget-get widget :comment-shown))))) |
25685 | 2327 |
17334 | 2328 ;;; The `custom-variable' Widget. |
2329 | |
28130 | 2330 ;; When this was underlined blue, users confused it with a |
2331 ;; Mosaic-style hyperlink... | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2332 (defface custom-variable-tag |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2333 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2334 (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
2335 (: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
|
2336 (((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
|
2337 (background light)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
2338 (: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
|
2339 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
2340 (background light)) |
63249
32b12a7e7c4f
(minibuffer): Fix spellings in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
63194
diff
changeset
|
2341 (: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
|
2342 (t (:weight bold))) |
17334 | 2343 "Face used for unpushable variable tags." |
17415 | 2344 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2345 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2346 (put 'custom-variable-tag-face 'face-alias 'custom-variable-tag) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2347 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2348 (defface custom-variable-button '((t (:underline t :weight bold))) |
17334 | 2349 "Face used for pushable variable tags." |
17415 | 2350 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2351 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
2352 (put 'custom-variable-button-face 'face-alias 'custom-variable-button) |
17334 | 2353 |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2354 (defcustom custom-variable-default-form 'edit |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2355 "Default form of displaying variable values." |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2356 :type '(choice (const edit) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2357 (const lisp)) |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
2358 :group 'custom-buffer |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
2359 :version "20.3") |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2360 |
56161
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2361 (defun custom-variable-documentation (variable) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2362 "Return documentation of VARIABLE for use in Custom buffer. |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2363 Normally just return the docstring. But if VARIABLE automatically |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2364 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
|
2365 (if (and (local-variable-if-set-p variable) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2366 (or (not (local-variable-p variable)) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2367 (with-temp-buffer |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2368 (local-variable-if-set-p variable)))) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2369 (concat (documentation-property variable 'variable-documentation) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2370 "\n |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2371 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
|
2372 However, setting it through Custom sets the default value.") |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2373 (documentation-property variable 'variable-documentation))) |
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2374 |
17334 | 2375 (define-widget 'custom-variable 'custom |
2376 "Customize variable." | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2377 :format "%v" |
17334 | 2378 :help-echo "Set or reset this variable." |
56161
a8ce8bdfcee6
(custom-variable-documentation): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55944
diff
changeset
|
2379 :documentation-property #'custom-variable-documentation |
18089 | 2380 :custom-category 'option |
17334 | 2381 :custom-state nil |
2382 :custom-menu 'custom-variable-menu-create | |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2383 :custom-form nil ; defaults to value of `custom-variable-default-form' |
17334 | 2384 :value-create 'custom-variable-value-create |
2385 :action 'custom-variable-action | |
2386 :custom-set 'custom-variable-set | |
2387 :custom-save 'custom-variable-save | |
2388 :custom-reset-current 'custom-redraw | |
2389 :custom-reset-saved 'custom-variable-reset-saved | |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2390 :custom-reset-standard 'custom-variable-reset-standard |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2391 :custom-standard-value 'custom-variable-standard-value) |
17334 | 2392 |
17415 | 2393 (defun custom-variable-type (symbol) |
2394 "Return a widget suitable for editing the value of SYMBOL. | |
25685 | 2395 If SYMBOL has a `custom-type' property, use that. |
17415 | 2396 Otherwise, look up symbol in `custom-guess-type-alist'." |
2397 (let* ((type (or (get symbol 'custom-type) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2398 (and (not (get symbol 'standard-value)) |
17415 | 2399 (custom-guess-type symbol)) |
2400 'sexp)) | |
2401 (options (get symbol 'custom-options)) | |
2402 (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
|
2403 (copy-sequence type) |
17415 | 2404 (list type)))) |
2405 (when options | |
2406 (widget-put tmp :options options)) | |
2407 tmp)) | |
2408 | |
17334 | 2409 (defun custom-variable-value-create (widget) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2410 "Here is where you edit the variable's value." |
17334 | 2411 (custom-load-widget widget) |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2412 (unless (widget-get widget :custom-form) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
2413 (widget-put widget :custom-form custom-variable-default-form)) |
17334 | 2414 (let* ((buttons (widget-get widget :buttons)) |
2415 (children (widget-get widget :children)) | |
2416 (form (widget-get widget :custom-form)) | |
2417 (state (widget-get widget :custom-state)) | |
2418 (symbol (widget-get widget :value)) | |
2419 (tag (widget-get widget :tag)) | |
17415 | 2420 (type (custom-variable-type symbol)) |
17334 | 2421 (conv (widget-convert type)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2422 (get (or (get symbol 'custom-get) 'default-value)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2423 (prefix (widget-get widget :custom-prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2424 (last (widget-get widget :custom-last)) |
17334 | 2425 (value (if (default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2426 (funcall get symbol) |
17334 | 2427 (widget-get conv :value)))) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2428 ;; If the widget is new, the child determines whether it is hidden. |
17334 | 2429 (cond (state) |
2430 ((custom-show type value) | |
2431 (setq state 'unknown)) | |
2432 (t | |
2433 (setq state 'hidden))) | |
2434 ;; If we don't know the state, see if we need to edit it in lisp form. | |
2435 (when (eq state 'unknown) | |
2436 (unless (widget-apply conv :match value) | |
2437 ;; (widget-apply (widget-convert type) :match value) | |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2438 (setq form 'mismatch))) |
17334 | 2439 ;; Now we can create the child widget. |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2440 (cond ((eq custom-buffer-style 'tree) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
2441 (insert prefix (if last " `--- " " |--- ")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2442 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
2443 widget 'custom-browse-variable-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2444 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2445 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2446 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2447 ((eq state 'hidden) |
17334 | 2448 ;; Indicate hidden value. |
25685 | 2449 (push (widget-create-child-and-convert |
17334 | 2450 widget 'item |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2451 :format "%{%t%}: " |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2452 :sample-face 'custom-variable-tag-face |
17334 | 2453 :tag tag |
2454 :parent widget) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2455 buttons) |
25685 | 2456 (push (widget-create-child-and-convert |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2457 widget 'visibility |
18258
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2458 :help-echo "Show the value of this option." |
46580
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2459 :off "Show Value" |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2460 :action 'custom-toggle-parent |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2461 nil) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2462 buttons)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2463 ((memq form '(lisp mismatch)) |
17334 | 2464 ;; In lisp mode edit the saved value when possible. |
2465 (let* ((value (cond ((get symbol 'saved-value) | |
2466 (car (get symbol 'saved-value))) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2467 ((get symbol 'standard-value) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2468 (car (get symbol 'standard-value))) |
17334 | 2469 ((default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2470 (custom-quote (funcall get symbol))) |
17334 | 2471 (t |
2472 (custom-quote (widget-get conv :value)))))) | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2473 (insert (symbol-name symbol) ": ") |
25685 | 2474 (push (widget-create-child-and-convert |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2475 widget 'visibility |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2476 :help-echo "Hide the value of this option." |
46580
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2477 :on "Hide Value" |
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2478 :off "Show Value" |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2479 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2480 t) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2481 buttons) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2482 (insert " ") |
25685 | 2483 (push (widget-create-child-and-convert |
2484 widget 'sexp | |
17334 | 2485 :button-face 'custom-variable-button-face |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2486 :format "%v" |
17334 | 2487 :tag (symbol-name symbol) |
2488 :parent widget | |
2489 :value value) | |
2490 children))) | |
2491 (t | |
2492 ;; Edit mode. | |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2493 (let* ((format (widget-get type :format)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2494 tag-format value-format) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2495 (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
|
2496 (error "Bad format")) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2497 (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
|
2498 (setq value-format (substring format (match-end 0))) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2499 (push (widget-create-child-and-convert |
25685 | 2500 widget 'item |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2501 :format tag-format |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2502 :action 'custom-tag-action |
18258
e83bc8150072
Synched with 1.9920.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18244
diff
changeset
|
2503 :help-echo "Change value of this option." |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2504 :mouse-down-action 'custom-tag-mouse-down-action |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2505 :button-face 'custom-variable-button-face |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
2506 :sample-face 'custom-variable-tag-face |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2507 tag) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2508 buttons) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2509 (insert " ") |
25685 | 2510 (push (widget-create-child-and-convert |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2511 widget 'visibility |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2512 :help-echo "Hide the value of this option." |
46580
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2513 :on "Hide Value" |
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2514 :off "Show Value" |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2515 :action 'custom-toggle-parent |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2516 t) |
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2517 buttons) |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2518 (push (widget-create-child-and-convert |
25685 | 2519 widget type |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2520 :format value-format |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2521 :value value) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2522 children)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2523 (unless (eq custom-buffer-style 'tree) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2524 (unless (eq (preceding-char) ?\n) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2525 (widget-insert "\n")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2526 ;; Create the magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2527 (let ((magic (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2528 widget 'custom-magic nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2529 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2530 (push magic buttons)) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2531 ;; ### NOTE: this is ugly!!!! I need to update the :buttons property |
25685 | 2532 ;; before the call to `widget-default-format-handler'. Otherwise, I |
2533 ;; loose my current `buttons'. This function shouldn't be called like | |
2534 ;; this anyway. The doc string widget should be added like the others. | |
2535 ;; --dv | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2536 (widget-put widget :buttons buttons) |
46580
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
2537 (insert "\n") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2538 ;; Insert documentation. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2539 (widget-default-format-handler widget ?h) |
25685 | 2540 |
2541 ;; The comment field | |
2542 (unless (eq state 'hidden) | |
2543 (let* ((comment (get symbol 'variable-comment)) | |
2544 (comment-widget | |
2545 (widget-create-child-and-convert | |
2546 widget 'custom-comment | |
2547 :parent widget | |
2548 :value (or comment "")))) | |
2549 (widget-put widget :comment-widget comment-widget) | |
2550 ;; Don't push it !!! Custom assumes that the first child is the | |
2551 ;; value one. | |
2552 (setq children (append children (list comment-widget))))) | |
2553 ;; Update the rest of the properties properties. | |
2554 (widget-put widget :custom-form form) | |
2555 (widget-put widget :children children) | |
2556 ;; Now update the state. | |
2557 (if (eq state 'hidden) | |
2558 (widget-put widget :custom-state state) | |
2559 (custom-variable-state-set widget)) | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2560 ;; See also. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2561 (unless (eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2562 (when (eq (widget-get widget :custom-level) 1) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2563 (custom-add-parent-links widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
2564 (custom-add-see-also widget))))) |
17334 | 2565 |
18067
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2566 (defun custom-tag-action (widget &rest args) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2567 "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
|
2568 (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
|
2569 :action args)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2570 |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2571 (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
|
2572 "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
|
2573 (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
|
2574 :mouse-down-action args)) |
0e2aa3b58e16
Synched with version 1.9901.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18059
diff
changeset
|
2575 |
17334 | 2576 (defun custom-variable-state-set (widget) |
2577 "Set the state of WIDGET." | |
2578 (let* ((symbol (widget-value widget)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2579 (get (or (get symbol 'custom-get) 'default-value)) |
17334 | 2580 (value (if (default-boundp symbol) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2581 (funcall get symbol) |
17334 | 2582 (widget-get widget :value))) |
25685 | 2583 (comment (get symbol 'variable-comment)) |
17334 | 2584 tmp |
25685 | 2585 temp |
2586 (state (cond ((progn (setq tmp (get symbol 'customized-value)) | |
2587 (setq temp | |
2588 (get symbol 'customized-variable-comment)) | |
2589 (or tmp temp)) | |
17334 | 2590 (if (condition-case nil |
25685 | 2591 (and (equal value (eval (car tmp))) |
2592 (equal comment temp)) | |
17334 | 2593 (error nil)) |
2594 'set | |
2595 'changed)) | |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2596 ((progn (setq tmp (get symbol 'theme-value)) |
25685 | 2597 (setq temp (get symbol 'saved-variable-comment)) |
2598 (or tmp temp)) | |
17334 | 2599 (if (condition-case nil |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2600 (and (equal comment temp) |
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
2601 (equal value |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2602 (eval |
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2603 (car (custom-variable-theme-value |
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2604 symbol))))) |
17334 | 2605 (error nil)) |
67783
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
2606 (cond |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2607 ((eq (caar tmp) 'user) 'saved) |
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2608 ((eq (caar tmp) 'changed) 'changed) |
67783
118df638c3ff
2005-12-23 Chong Yidong <cyd@stupidchicken.com>
Chong Yidong <cyd@stupidchicken.com>
parents:
67749
diff
changeset
|
2609 (t 'themed)) |
17334 | 2610 'changed)) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2611 ((setq tmp (get symbol 'standard-value)) |
17334 | 2612 (if (condition-case nil |
25685 | 2613 (and (equal value (eval (car tmp))) |
2614 (equal comment nil)) | |
17334 | 2615 (error nil)) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2616 'standard |
17334 | 2617 'changed)) |
2618 (t 'rogue)))) | |
2619 (widget-put widget :custom-state state))) | |
2620 | |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2621 (defun custom-variable-standard-value (widget) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2622 (get (widget-value widget) 'standard-value)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2623 |
25685 | 2624 (defvar custom-variable-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2625 `(("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
|
2626 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2627 (eq (widget-get widget :custom-state) 'modified))) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2628 ,@(when (or custom-file user-init-file) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2629 '(("Save for Future Sessions" custom-variable-save |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2630 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2631 (memq (widget-get widget :custom-state) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2632 '(modified set changed rogue)))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2633 ("Undo Edits" custom-redraw |
68021
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2634 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2635 (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
|
2636 (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
|
2637 ("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
|
2638 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
2639 (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
|
2640 (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
|
2641 (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
|
2642 '(modified set changed rogue))))) |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2643 ,@(when (or custom-file user-init-file) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2644 '(("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
|
2645 (lambda (widget) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2646 (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
|
2647 (memq (widget-get widget :custom-state) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
2648 '(modified set changed saved rogue))))))) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2649 ("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
|
2650 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2651 (get (widget-value widget) 'backup-value))) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2652 ("---" ignore ignore) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2653 ("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
|
2654 ("---" ignore ignore) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
2655 ("Show Current Value" custom-variable-edit |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2656 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2657 (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
|
2658 ("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
|
2659 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
2660 (eq (widget-get widget :custom-form) 'edit)))) |
17334 | 2661 "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
|
2662 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
|
2663 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
|
2664 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
|
2665 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
|
2666 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 2667 |
2668 (defun custom-variable-action (widget &optional event) | |
2669 "Show the menu for `custom-variable' WIDGET. | |
2670 Optional EVENT is the location for the menu." | |
2671 (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
|
2672 (custom-toggle-hide widget) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2673 (unless (eq (widget-get widget :custom-state) 'modified) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2674 (custom-variable-state-set widget)) |
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
2675 (custom-redraw-magic widget) |
17334 | 2676 (let* ((completion-ignore-case t) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2677 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2678 (custom-unlispify-tag-name |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2679 (widget-get widget :value))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2680 (custom-menu-filter custom-variable-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2681 widget) |
17334 | 2682 event))) |
2683 (if answer | |
2684 (funcall answer widget))))) | |
2685 | |
2686 (defun custom-variable-edit (widget) | |
2687 "Edit value of WIDGET." | |
2688 (widget-put widget :custom-state 'unknown) | |
2689 (widget-put widget :custom-form 'edit) | |
2690 (custom-redraw widget)) | |
2691 | |
2692 (defun custom-variable-edit-lisp (widget) | |
28130 | 2693 "Edit the Lisp representation of the value of WIDGET." |
17334 | 2694 (widget-put widget :custom-state 'unknown) |
2695 (widget-put widget :custom-form 'lisp) | |
2696 (custom-redraw widget)) | |
2697 | |
2698 (defun custom-variable-set (widget) | |
2699 "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
|
2700 (let* ((form (widget-get widget :custom-form)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2701 (state (widget-get widget :custom-state)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2702 (child (car (widget-get widget :children))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2703 (symbol (widget-value widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2704 (set (or (get symbol 'custom-set) 'set-default)) |
25685 | 2705 (comment-widget (widget-get widget :comment-widget)) |
2706 (comment (widget-value comment-widget)) | |
2707 val) | |
17334 | 2708 (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
|
2709 (error "Cannot set hidden variable")) |
17334 | 2710 ((setq val (widget-apply child :validate)) |
2711 (goto-char (widget-get val :from)) | |
2712 (error "%s" (widget-get val :error))) | |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
2713 ((memq form '(lisp mismatch)) |
25685 | 2714 (when (equal comment "") |
2715 (setq comment nil) | |
2716 ;; 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
|
2717 (custom-comment-hide comment-widget)) |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2718 (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
|
2719 (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
|
2720 'set (custom-quote (widget-value child))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2721 (funcall set symbol (eval (setq val (widget-value child)))) |
25685 | 2722 (put symbol 'customized-value (list val)) |
2723 (put symbol 'variable-comment comment) | |
2724 (put symbol 'customized-variable-comment comment)) | |
17334 | 2725 (t |
25685 | 2726 (when (equal comment "") |
2727 (setq comment nil) | |
2728 ;; 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
|
2729 (custom-comment-hide comment-widget)) |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2730 (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
|
2731 (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
|
2732 'set (custom-quote (widget-value child))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2733 (funcall set symbol (setq val (widget-value child))) |
25685 | 2734 (put symbol 'customized-value (list (custom-quote val))) |
2735 (put symbol 'variable-comment comment) | |
2736 (put symbol 'customized-variable-comment comment))) | |
17334 | 2737 (custom-variable-state-set widget) |
2738 (custom-redraw-magic widget))) | |
2739 | |
2740 (defun custom-variable-save (widget) | |
19823
0c1b4a44db76
(custom-variable-save): Fixed doc string.
Richard M. Stallman <rms@gnu.org>
parents:
19822
diff
changeset
|
2741 "Set and save the 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
|
2742 (let* ((form (widget-get widget :custom-form)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2743 (state (widget-get widget :custom-state)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2744 (child (car (widget-get widget :children))) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2745 (symbol (widget-value widget)) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2746 (set (or (get symbol 'custom-set) 'set-default)) |
25685 | 2747 (comment-widget (widget-get widget :comment-widget)) |
2748 (comment (widget-value comment-widget)) | |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
2749 val) |
17334 | 2750 (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
|
2751 (error "Cannot set hidden variable")) |
17334 | 2752 ((setq val (widget-apply child :validate)) |
2753 (goto-char (widget-get val :from)) | |
33774
77d48dfb2b29
(custom-buffer-create-internal): Save some consing.
Dave Love <fx@gnu.org>
parents:
33110
diff
changeset
|
2754 (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
|
2755 ((memq form '(lisp mismatch)) |
25685 | 2756 (when (equal comment "") |
2757 (setq comment nil) | |
2758 ;; 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
|
2759 (custom-comment-hide comment-widget)) |
17334 | 2760 (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
|
2761 (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
|
2762 'set (custom-quote (widget-value child))) |
25685 | 2763 (funcall set symbol (eval (widget-value child))) |
2764 (put symbol 'variable-comment comment) | |
2765 (put symbol 'saved-variable-comment comment)) | |
17334 | 2766 (t |
25685 | 2767 (when (equal comment "") |
2768 (setq comment nil) | |
2769 ;; 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
|
2770 (custom-comment-hide comment-widget)) |
25685 | 2771 (put symbol 'saved-value |
2772 (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
|
2773 (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
|
2774 'set (custom-quote (widget-value child))) |
25685 | 2775 (funcall set symbol (widget-value child)) |
2776 (put symbol 'variable-comment comment) | |
2777 (put symbol 'saved-variable-comment comment))) | |
17334 | 2778 (put symbol 'customized-value nil) |
25685 | 2779 (put symbol 'customized-variable-comment nil) |
17334 | 2780 (custom-save-all) |
2781 (custom-variable-state-set widget) | |
2782 (custom-redraw-magic widget))) | |
2783 | |
2784 (defun custom-variable-reset-saved (widget) | |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2785 "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
|
2786 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
|
2787 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
|
2788 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
|
2789 (let* ((symbol (widget-value widget)) |
25685 | 2790 (set (or (get symbol 'custom-set) 'set-default)) |
2791 (value (get symbol 'saved-value)) | |
2792 (comment (get symbol 'saved-variable-comment))) | |
2793 (cond ((or value comment) | |
2794 (put symbol 'variable-comment comment) | |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2795 (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
|
2796 (custom-push-theme 'theme-value symbol 'user 'set (car-safe value)) |
25685 | 2797 (condition-case nil |
2798 (funcall set symbol (eval (car value))) | |
2799 (error nil))) | |
2800 (t | |
2801 (error "No saved value for %s" symbol))) | |
17334 | 2802 (put symbol 'customized-value nil) |
25685 | 2803 (put symbol 'customized-variable-comment nil) |
17334 | 2804 (widget-put widget :custom-state 'unknown) |
25685 | 2805 ;; This call will possibly make the comment invisible |
17334 | 2806 (custom-redraw widget))) |
2807 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2808 (defun custom-variable-reset-standard (widget) |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
2809 "Restore the standard setting for the variable being edited by WIDGET. |
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
2810 This operation eliminates any saved setting for the variable, |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2811 restoring it to the state of a variable that has never been customized. |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2812 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
|
2813 becomes the backup value, so you can get it again." |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
2814 (let* ((symbol (widget-value widget))) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
2815 (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
|
2816 (custom-variable-backup-value widget) |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
2817 (error "No standard setting known for %S" symbol)) |
25824
0d1ba90ad774
(custom-comment): Change widget definition.
Dave Love <fx@gnu.org>
parents:
25685
diff
changeset
|
2818 (put symbol 'variable-comment nil) |
17334 | 2819 (put symbol 'customized-value nil) |
25685 | 2820 (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
|
2821 (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
|
2822 (custom-theme-recalc-variable symbol) |
25685 | 2823 (when (or (get symbol 'saved-value) (get symbol 'saved-variable-comment)) |
17334 | 2824 (put symbol 'saved-value nil) |
25685 | 2825 (put symbol 'saved-variable-comment nil) |
17334 | 2826 (custom-save-all)) |
2827 (widget-put widget :custom-state 'unknown) | |
25685 | 2828 ;; This call will possibly make the comment invisible |
17334 | 2829 (custom-redraw widget))) |
2830 | |
47503
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2831 (defun custom-variable-backup-value (widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2832 "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
|
2833 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
|
2834 (let* ((symbol (widget-value widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2835 (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
|
2836 (type (custom-variable-type symbol)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2837 (conv (widget-convert type)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2838 (value (if (default-boundp symbol) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2839 (funcall get symbol) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2840 (widget-get conv :value)))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2841 (put symbol 'backup-value (list value)))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2842 |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2843 (defun custom-variable-reset-backup (widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2844 "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
|
2845 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
|
2846 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
|
2847 to switch between two values." |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2848 (let* ((symbol (widget-value widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2849 (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
|
2850 (value (get symbol 'backup-value)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2851 (comment-widget (widget-get widget :comment-widget)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2852 (comment (widget-value comment-widget))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2853 (if value |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2854 (progn |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2855 (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
|
2856 (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
|
2857 (condition-case nil |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2858 (funcall set symbol (car value)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2859 (error nil))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2860 (error "No backup value for %s" symbol)) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2861 (put symbol 'customized-value (list (car value))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2862 (put symbol 'variable-comment comment) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2863 (put symbol 'customized-variable-comment comment) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2864 (custom-variable-state-set widget) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2865 ;; 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
|
2866 (custom-redraw widget))) |
8b3fa993e0ad
(custom-variable-backup-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
47315
diff
changeset
|
2867 |
17334 | 2868 ;;; The `custom-face-edit' Widget. |
2869 | |
2870 (define-widget 'custom-face-edit 'checklist | |
2871 "Edit face attributes." | |
2872 :format "%t: %v" | |
2873 :tag "Attributes" | |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
2874 :extra-offset 13 |
25685 | 2875 :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
|
2876 :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
|
2877 :match (lambda (widget value) |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
2878 (widget-checklist-match widget |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
2879 (custom-face-edit-fix-value widget value))) |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2880 :convert-widget 'custom-face-edit-convert-widget |
17334 | 2881 :args (mapcar (lambda (att) |
25685 | 2882 (list 'group |
17334 | 2883 :inline t |
2884 :sibling-args (widget-get (nth 1 att) :sibling-args) | |
25685 | 2885 (list 'const :format "" :value (nth 0 att)) |
17334 | 2886 (nth 1 att))) |
2887 custom-face-attributes)) | |
2888 | |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
2889 (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
|
2890 "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
|
2891 Also change :reverse-video to :inverse-video." |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2892 (if (listp value) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2893 (let (result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2894 (while value |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2895 (let ((key (car value)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2896 (val (car (cdr value)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2897 (cond ((eq key :italic) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2898 (push :slant result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2899 (push (if val 'italic 'normal) result)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2900 ((eq key :bold) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2901 (push :weight result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2902 (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
|
2903 ((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
|
2904 (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
|
2905 (push val result)) |
49521
c259d8177692
2003-01-29 Didier Verna <didier@xemacs.org>
John Paul Wallington <jpw@pobox.com>
parents:
49300
diff
changeset
|
2906 (t |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2907 (push key result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2908 (push val result)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2909 (setq value (cdr (cdr value)))) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2910 (setq result (nreverse result)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2911 result) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
2912 value)) |
42448
5269e6fd0fbc
(custom-face-edit-fix-value): New function.
Richard M. Stallman <rms@gnu.org>
parents:
41606
diff
changeset
|
2913 |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2914 (defun custom-face-edit-convert-widget (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2915 "Convert :args as widget types in WIDGET." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2916 (widget-put |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2917 widget |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2918 :args (mapcar (lambda (arg) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2919 (widget-convert arg |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2920 :deactivate 'custom-face-edit-deactivate |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2921 :activate 'custom-face-edit-activate |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2922 :delete 'custom-face-edit-delete)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2923 (widget-get widget :args))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2924 widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2925 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2926 (defun custom-face-edit-deactivate (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2927 "Make face widget WIDGET inactive for user modifications." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2928 (unless (widget-get widget :inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2929 (let ((tag (custom-face-edit-attribute-tag widget)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2930 (from (copy-marker (widget-get widget :from))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2931 (value (widget-value widget)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2932 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2933 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2934 (save-excursion |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2935 (goto-char from) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2936 (widget-default-delete widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2937 (insert tag ": *\n") |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2938 (widget-put widget :inactive |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2939 (cons value (cons from (- (point) from)))))))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2940 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2941 (defun custom-face-edit-activate (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2942 "Make face widget WIDGET inactive for user modifications." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2943 (let ((inactive (widget-get widget :inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2944 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2945 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2946 (when (consp inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2947 (save-excursion |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2948 (goto-char (car (cdr inactive))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2949 (delete-region (point) (+ (point) (cdr (cdr inactive)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2950 (widget-put widget :inactive nil) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2951 (widget-apply widget :create) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2952 (widget-value-set widget (car inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2953 (widget-setup))))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2954 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2955 (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
|
2956 "Remove WIDGET from the buffer." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2957 (let ((inactive (widget-get widget :inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2958 (inhibit-read-only t) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2959 (inhibit-modification-hooks t)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2960 (if (not inactive) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2961 ;; 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
|
2962 (widget-default-delete widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2963 ;; 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
|
2964 ;; 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
|
2965 (delete-region (car (cdr inactive)) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2966 (+ (car (cdr inactive)) (cdr (cdr inactive)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2967 (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
|
2968 |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2969 |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2970 (defun custom-face-edit-attribute-tag (widget) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2971 "Returns the first :tag property in WIDGET or one of its children." |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2972 (let ((tag (widget-get widget :tag))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2973 (or (and (not (equal tag "")) tag) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2974 (let ((children (widget-get widget :children))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2975 (while (and (null tag) children) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2976 (setq tag (custom-face-edit-attribute-tag (pop children)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2977 tag)))) |
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
2978 |
17334 | 2979 ;;; The `custom-display' Widget. |
2980 | |
2981 (define-widget 'custom-display 'menu-choice | |
2982 "Select a display type." | |
2983 :tag "Display" | |
2984 :value t | |
2985 :help-echo "Specify frames where the face attributes should be used." | |
2986 :args '((const :tag "all" t) | |
58941
a7271df99c36
(custom-display): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58940
diff
changeset
|
2987 (const :tag "defaults" default) |
17334 | 2988 (checklist |
2989 :offset 0 | |
2990 :extra-offset 9 | |
2991 :args ((group :sibling-args (:help-echo "\ | |
2992 Only match the specified window systems.") | |
2993 (const :format "Type: " | |
2994 type) | |
2995 (checklist :inline t | |
2996 :offset 0 | |
2997 (const :format "X " | |
2998 :sibling-args (:help-echo "\ | |
2999 The X11 Window System.") | |
3000 x) | |
3001 (const :format "PM " | |
3002 :sibling-args (:help-echo "\ | |
3003 OS/2 Presentation Manager.") | |
3004 pm) | |
19684
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3005 (const :format "W32 " |
17334 | 3006 :sibling-args (:help-echo "\ |
19684
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3007 Windows NT/9X.") |
d5378da3dd73
(custom-display): Use w32 instead of win32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
19316
diff
changeset
|
3008 w32) |
48633
8ef126b2490a
(custom-display): Add checkbox for type mac.
Andreas Schwab <schwab@suse.de>
parents:
48243
diff
changeset
|
3009 (const :format "MAC " |
8ef126b2490a
(custom-display): Add checkbox for type mac.
Andreas Schwab <schwab@suse.de>
parents:
48243
diff
changeset
|
3010 :sibling-args (:help-echo "\ |
8ef126b2490a
(custom-display): Add checkbox for type mac.
Andreas Schwab <schwab@suse.de>
parents:
48243
diff
changeset
|
3011 Macintosh OS.") |
8ef126b2490a
(custom-display): Add checkbox for type mac.
Andreas Schwab <schwab@suse.de>
parents:
48243
diff
changeset
|
3012 mac) |
17334 | 3013 (const :format "DOS " |
3014 :sibling-args (:help-echo "\ | |
3015 Plain MS-DOS.") | |
3016 pc) | |
3017 (const :format "TTY%n" | |
3018 :sibling-args (:help-echo "\ | |
3019 Plain text terminals.") | |
3020 tty))) | |
3021 (group :sibling-args (:help-echo "\ | |
3022 Only match the frames with the specified color support.") | |
3023 (const :format "Class: " | |
3024 class) | |
3025 (checklist :inline t | |
3026 :offset 0 | |
3027 (const :format "Color " | |
3028 :sibling-args (:help-echo "\ | |
3029 Match color frames.") | |
3030 color) | |
3031 (const :format "Grayscale " | |
3032 :sibling-args (:help-echo "\ | |
3033 Match grayscale frames.") | |
3034 grayscale) | |
3035 (const :format "Monochrome%n" | |
3036 :sibling-args (:help-echo "\ | |
3037 Match frames with no color support.") | |
3038 mono))) | |
3039 (group :sibling-args (:help-echo "\ | |
55944
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3040 The minimum number of colors the frame should support.") |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3041 (const :format "" min-colors) |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3042 (integer :tag "Minimum number of colors" )) |
173cdf06168d
(custom-display): Add `min-colors'.
Juri Linkov <juri@jurta.org>
parents:
55789
diff
changeset
|
3043 (group :sibling-args (:help-echo "\ |
17334 | 3044 Only match frames with the specified intensity.") |
3045 (const :format "\ | |
3046 Background brightness: " | |
3047 background) | |
3048 (checklist :inline t | |
3049 :offset 0 | |
3050 (const :format "Light " | |
3051 :sibling-args (:help-echo "\ | |
3052 Match frames with light backgrounds.") | |
3053 light) | |
3054 (const :format "Dark\n" | |
3055 :sibling-args (:help-echo "\ | |
3056 Match frames with dark backgrounds.") | |
45724
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3057 dark))) |
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3058 (group :sibling-args (:help-echo "\ |
ee1a7b81cb0e
(custom-display): Add support for `supports' predicate.
Miles Bader <miles@gnu.org>
parents:
45244
diff
changeset
|
3059 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
|
3060 (const :format "Supports attributes:" supports) |
45725
abb237aa3c61
(custom-display): Use correct syntax for `supports' attributes.
Miles Bader <miles@gnu.org>
parents:
45724
diff
changeset
|
3061 (custom-face-edit :inline t :format "%n%v")))))) |
17334 | 3062 |
3063 ;;; The `custom-face' Widget. | |
3064 | |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3065 (defface custom-face-tag |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3066 `((t (:weight bold :height 1.2 :inherit variable-pitch))) |
17334 | 3067 "Face used for face tags." |
17415 | 3068 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3069 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3070 (put 'custom-face-tag-face 'face-alias 'custom-face-tag) |
17334 | 3071 |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3072 (defcustom custom-face-default-form 'selected |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3073 "Default form of displaying face definition." |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3074 :type '(choice (const all) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3075 (const selected) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3076 (const lisp)) |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
3077 :group 'custom-buffer |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21649
diff
changeset
|
3078 :version "20.3") |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3079 |
17334 | 3080 (define-widget 'custom-face 'custom |
3081 "Customize face." | |
3082 :sample-face 'custom-face-tag-face | |
3083 :help-echo "Set or reset this face." | |
28716
e9fb71a3e51d
(custom-face): Fix parenthesis.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28700
diff
changeset
|
3084 :documentation-property #'face-doc-string |
17334 | 3085 :value-create 'custom-face-value-create |
3086 :action 'custom-face-action | |
18089 | 3087 :custom-category 'face |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3088 :custom-form nil ; defaults to value of `custom-face-default-form' |
17334 | 3089 :custom-set 'custom-face-set |
3090 :custom-save 'custom-face-save | |
3091 :custom-reset-current 'custom-redraw | |
3092 :custom-reset-saved 'custom-face-reset-saved | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3093 :custom-reset-standard 'custom-face-reset-standard |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3094 :custom-standard-value 'custom-face-standard-value |
17334 | 3095 :custom-menu 'custom-face-menu-create) |
3096 | |
25685 | 3097 (define-widget 'custom-face-all 'editable-list |
17334 | 3098 "An editable list of display specifications and attributes." |
3099 :entry-format "%i %d %v" | |
3100 :insert-button-args '(:help-echo "Insert new display specification here.") | |
3101 :append-button-args '(:help-echo "Append new display specification here.") | |
3102 :delete-button-args '(:help-echo "Delete this display specification.") | |
3103 :args '((group :format "%v" custom-display custom-face-edit))) | |
3104 | |
3105 (defconst custom-face-all (widget-convert 'custom-face-all) | |
3106 "Converted version of the `custom-face-all' widget.") | |
3107 | |
3108 (define-widget 'custom-display-unselected 'item | |
3109 "A display specification that doesn't match the selected display." | |
3110 :match 'custom-display-unselected-match) | |
3111 | |
3112 (defun custom-display-unselected-match (widget value) | |
3113 "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
|
3114 (not (face-spec-set-match-display value (selected-frame)))) |
17334 | 3115 |
25685 | 3116 (define-widget 'custom-face-selected 'group |
17334 | 3117 "Edit the attributes of the selected display in a face specification." |
58940
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3118 :args '((choice :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3119 (group :tag "With Defaults" :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3120 (group (const :tag "" default) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3121 (custom-face-edit :tag " Default\n Attributes")) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3122 (repeat :format "" |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3123 :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3124 (group custom-display-unselected sexp)) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3125 (group (sexp :format "") |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3126 (custom-face-edit :tag " Overriding\n Attributes")) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3127 (repeat :format "" |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3128 :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3129 sexp)) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3130 (group :tag "No Defaults" :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3131 (repeat :format "" |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3132 :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3133 (group custom-display-unselected sexp)) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3134 (group (sexp :format "") |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3135 (custom-face-edit :tag "\n Attributes")) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3136 (repeat :format "" |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3137 :inline t |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3138 sexp))))) |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3139 |
841754cd73c6
(custom-face-selected): Handle `default' specs.
Richard M. Stallman <rms@gnu.org>
parents:
58797
diff
changeset
|
3140 |
17334 | 3141 |
3142 (defconst custom-face-selected (widget-convert 'custom-face-selected) | |
3143 "Converted version of the `custom-face-selected' widget.") | |
3144 | |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3145 (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
|
3146 "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
|
3147 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
|
3148 `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
|
3149 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
|
3150 don't specify one." |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3151 (mapcar (lambda (entry) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3152 ;; 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
|
3153 (let ((tests (car entry)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3154 (unfiltered-attrs |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3155 ;; 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
|
3156 (if (listp (car (cdr entry))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3157 (car (cdr entry)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3158 (cdr entry))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3159 (filtered-attrs nil)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3160 ;; Filter each face attribute |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3161 (while unfiltered-attrs |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3162 (let* ((attr (pop unfiltered-attrs)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3163 (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
|
3164 (filter |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3165 (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
|
3166 default-filter)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3167 (filtered-value |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3168 (if filter |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3169 (funcall filter pre-filtered-value) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3170 pre-filtered-value))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3171 (push filtered-value filtered-attrs) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3172 (push attr filtered-attrs))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3173 ;; |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3174 (list tests filtered-attrs))) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3175 spec)) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3176 |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3177 (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
|
3178 "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
|
3179 SPEC must be a full face spec." |
39606
1b4259bc2f74
(custom-face-edit-convert-widget)
Miles Bader <miles@gnu.org>
parents:
39153
diff
changeset
|
3180 (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
|
3181 |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3182 (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
|
3183 "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
|
3184 (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
|
3185 |
17334 | 3186 (defun custom-face-value-create (widget) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3187 "Create a list of the display specifications for WIDGET." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3188 (let ((buttons (widget-get widget :buttons)) |
25685 | 3189 children |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3190 (symbol (widget-get widget :value)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3191 (tag (widget-get widget :tag)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3192 (state (widget-get widget :custom-state)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3193 (begin (point)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3194 (is-last (widget-get widget :custom-last)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3195 (prefix (widget-get widget :custom-prefix))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3196 (unless tag |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3197 (setq tag (prin1-to-string symbol))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3198 (cond ((eq custom-buffer-style 'tree) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3199 (insert prefix (if is-last " `--- " " |--- ")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3200 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3201 widget 'custom-browse-face-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3202 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3203 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3204 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3205 (t |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3206 ;; Create tag. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3207 (insert tag) |
34041
40708840c132
(custom-face-value-create): Always emphasize tag.
Gerd Moellmann <gerd@gnu.org>
parents:
33986
diff
changeset
|
3208 (widget-specify-sample widget begin (point)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3209 (if (eq custom-buffer-style 'face) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3210 (insert " ") |
33024
42e118959715
(custom-face-value-create): If face name doesn't end with "face", add
Miles Bader <miles@gnu.org>
parents:
32936
diff
changeset
|
3211 (if (string-match "face\\'" tag) |
42e118959715
(custom-face-value-create): If face name doesn't end with "face", add
Miles Bader <miles@gnu.org>
parents:
32936
diff
changeset
|
3212 (insert ":") |
42e118959715
(custom-face-value-create): If face name doesn't end with "face", add
Miles Bader <miles@gnu.org>
parents:
32936
diff
changeset
|
3213 (insert " face: "))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3214 ;; Sample. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3215 (push (widget-create-child-and-convert widget 'item |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3216 :format "(%{%t%})" |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3217 :sample-face symbol |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3218 :tag "sample") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3219 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3220 ;; Visibility. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3221 (insert " ") |
25685 | 3222 (push (widget-create-child-and-convert |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3223 widget 'visibility |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3224 :help-echo "Hide or show this face." |
46580
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
3225 :on "Hide Face" |
2c25b46baf82
(custom-variable-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
46408
diff
changeset
|
3226 :off "Show Face" |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3227 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3228 (not (eq state 'hidden))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3229 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3230 ;; Magic. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3231 (insert "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3232 (let ((magic (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3233 widget 'custom-magic nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3234 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3235 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3236 ;; Update buttons. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3237 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3238 ;; Insert documentation. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3239 (widget-default-format-handler widget ?h) |
25685 | 3240 ;; The comment field |
3241 (unless (eq state 'hidden) | |
3242 (let* ((comment (get symbol 'face-comment)) | |
3243 (comment-widget | |
3244 (widget-create-child-and-convert | |
3245 widget 'custom-comment | |
3246 :parent widget | |
3247 :value (or comment "")))) | |
3248 (widget-put widget :comment-widget comment-widget) | |
3249 (push comment-widget children))) | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3250 ;; See also. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3251 (unless (eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3252 (when (eq (widget-get widget :custom-level) 1) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3253 (custom-add-parent-links widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3254 (custom-add-see-also widget)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3255 ;; Editor. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3256 (unless (eq (preceding-char) ?\n) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3257 (insert "\n")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3258 (unless (eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3259 (message "Creating face editor...") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3260 (custom-load-widget widget) |
20411
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3261 (unless (widget-get widget :custom-form) |
089ca3e66e6d
(custom-unlispify-remove-prefixes): Reference to
Karl Heuer <kwzh@gnu.org>
parents:
20398
diff
changeset
|
3262 (widget-put widget :custom-form custom-face-default-form)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3263 (let* ((symbol (widget-value widget)) |
40825
22caa22b7399
2001-11-07 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
40801
diff
changeset
|
3264 (spec (or (get symbol 'customized-face) |
22caa22b7399
2001-11-07 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
40801
diff
changeset
|
3265 (get symbol 'saved-face) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3266 (get symbol 'face-defface-spec) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3267 ;; Attempt to construct it. |
25685 | 3268 (list (list t (custom-face-attributes-get |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3269 symbol (selected-frame)))))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3270 (form (widget-get widget :custom-form)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3271 (indent (widget-get widget :indent)) |
19097
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3272 edit) |
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3273 ;; If the user has changed this face in some other way, |
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3274 ;; edit it as the user has specified it. |
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3275 (if (not (face-spec-match-p symbol spec (selected-frame))) |
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3276 (setq spec (list (list t (face-attr-construct symbol (selected-frame)))))) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3277 (setq spec (custom-pre-filter-face-spec spec)) |
19097
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3278 (setq edit (widget-create-child-and-convert |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3279 widget |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3280 (cond ((and (eq form 'selected) |
25685 | 3281 (widget-apply custom-face-selected |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3282 :match spec)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3283 (when indent (insert-char ?\ indent)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3284 'custom-face-selected) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3285 ((and (not (eq form 'lisp)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3286 (widget-apply custom-face-all |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3287 :match spec)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3288 'custom-face-all) |
25685 | 3289 (t |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3290 (when indent (insert-char ?\ indent)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3291 'sexp)) |
19097
200ff7e7d620
(custom-face-value-create): Take account
Richard M. Stallman <rms@gnu.org>
parents:
19040
diff
changeset
|
3292 :value spec)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3293 (custom-face-state-set widget) |
25685 | 3294 (push edit children) |
3295 (widget-put widget :children children)) | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3296 (message "Creating face editor...done")))))) |
17334 | 3297 |
25685 | 3298 (defvar custom-face-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3299 `(("Set for Current Session" custom-face-set) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3300 ,@(when (or custom-file user-init-file) |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3301 '(("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
|
3302 ("Undo Edits" custom-redraw |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3303 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3304 (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
|
3305 ("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
|
3306 (lambda (widget) |
271ab3aed790
* cus-edit.el (custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68020
diff
changeset
|
3307 (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
|
3308 (get (widget-value widget) 'saved-face-comment)))) |
67744
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
3309 ,@(when (or custom-file user-init-file) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3310 '(("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
|
3311 (lambda (widget) |
1c62bde28518
(custom-variable-prompt): Say "variable" in prompt.
Richard M. Stallman <rms@gnu.org>
parents:
67677
diff
changeset
|
3312 (get (widget-value widget) 'face-defface-spec))))) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3313 ("---" ignore ignore) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3314 ("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
|
3315 ("---" ignore ignore) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3316 ("For Current Display" custom-face-edit-selected |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3317 (lambda (widget) |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3318 (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
|
3319 ("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
|
3320 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3321 (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
|
3322 ("Show Lisp Expression" custom-face-edit-lisp |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3323 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3324 (not (eq (widget-get widget :custom-form) 'lisp))))) |
17334 | 3325 "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
|
3326 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
|
3327 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
|
3328 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
|
3329 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
|
3330 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 3331 |
3332 (defun custom-face-edit-selected (widget) | |
3333 "Edit selected attributes of the value of WIDGET." | |
3334 (widget-put widget :custom-state 'unknown) | |
3335 (widget-put widget :custom-form 'selected) | |
3336 (custom-redraw widget)) | |
3337 | |
3338 (defun custom-face-edit-all (widget) | |
3339 "Edit all attributes of the value of WIDGET." | |
3340 (widget-put widget :custom-state 'unknown) | |
3341 (widget-put widget :custom-form 'all) | |
3342 (custom-redraw widget)) | |
3343 | |
3344 (defun custom-face-edit-lisp (widget) | |
28130 | 3345 "Edit the Lisp representation of the value of WIDGET." |
17334 | 3346 (widget-put widget :custom-state 'unknown) |
3347 (widget-put widget :custom-form 'lisp) | |
3348 (custom-redraw widget)) | |
3349 | |
3350 (defun custom-face-state-set (widget) | |
3351 "Set the state of WIDGET." | |
25685 | 3352 (let* ((symbol (widget-value widget)) |
3353 (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
|
3354 tmp temp |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3355 (state |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3356 (cond ((progn |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3357 (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
|
3358 (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
|
3359 (or tmp temp)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3360 (if (equal temp comment) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3361 'set |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3362 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3363 ((progn |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3364 (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
|
3365 (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
|
3366 (or tmp temp)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3367 (if (equal temp comment) |
67784
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3368 (cond |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3369 ((eq 'user (caar (get symbol 'theme-face))) |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3370 'saved) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
3371 ((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
|
3372 'changed) |
7c9d6a4a35c7
(custom-face-state-set): Check theme-value.
Chong Yidong <cyd@stupidchicken.com>
parents:
67783
diff
changeset
|
3373 (t 'themed)) |
51277
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3374 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3375 ((get symbol 'face-defface-spec) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3376 (if (equal comment nil) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3377 'standard |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3378 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3379 (t |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3380 'rogue)))) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3381 ;; 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
|
3382 ;; 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
|
3383 (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
|
3384 (get symbol 'face-modified)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3385 (setq state 'changed)) |
caaa4fda6808
(custom-face-state-set): non-nil `face-modified'
Richard M. Stallman <rms@gnu.org>
parents:
50283
diff
changeset
|
3386 (widget-put widget :custom-state state))) |
17334 | 3387 |
3388 (defun custom-face-action (widget &optional event) | |
3389 "Show the menu for `custom-face' WIDGET. | |
3390 Optional EVENT is the location for the menu." | |
3391 (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
|
3392 (custom-toggle-hide widget) |
17334 | 3393 (let* ((completion-ignore-case t) |
3394 (symbol (widget-get widget :value)) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3395 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3396 (custom-unlispify-tag-name symbol)) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3397 (custom-menu-filter custom-face-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3398 widget) |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3399 event))) |
17334 | 3400 (if answer |
3401 (funcall answer widget))))) | |
3402 | |
3403 (defun custom-face-set (widget) | |
3404 "Make the face attributes in WIDGET take effect." | |
3405 (let* ((symbol (widget-value widget)) | |
3406 (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
|
3407 (value (custom-post-filter-face-spec (widget-value child))) |
25685 | 3408 (comment-widget (widget-get widget :comment-widget)) |
3409 (comment (widget-value comment-widget))) | |
3410 (when (equal comment "") | |
3411 (setq comment nil) | |
3412 ;; 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
|
3413 (custom-comment-hide comment-widget)) |
17334 | 3414 (put symbol 'customized-face value) |
33843
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3415 (if (face-spec-choose value) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3416 (face-spec-set symbol value) |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3417 ;; 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
|
3418 ;; something harmless instead. |
388a61e78c53
(custom-filter-face-spec, custom-pre-filter-face-spec)
Miles Bader <miles@gnu.org>
parents:
33774
diff
changeset
|
3419 (face-spec-set symbol '((t :foreground unspecified)))) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
3420 (custom-push-theme 'theme-face symbol 'user 'set value) |
25685 | 3421 (put symbol 'customized-face-comment comment) |
3422 (put symbol 'face-comment comment) | |
17334 | 3423 (custom-face-state-set widget) |
3424 (custom-redraw-magic widget))) | |
3425 | |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3426 (defun custom-face-save (widget) |
19883
519eab181c36
(custom-face-menu): Use custom-face-save-command. not custom-face-save.
Richard M. Stallman <rms@gnu.org>
parents:
19823
diff
changeset
|
3427 "Save in `.emacs' the face attributes in WIDGET." |
17334 | 3428 (let* ((symbol (widget-value widget)) |
3429 (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
|
3430 (value (custom-post-filter-face-spec (widget-value child))) |
25685 | 3431 (comment-widget (widget-get widget :comment-widget)) |
3432 (comment (widget-value comment-widget))) | |
3433 (when (equal comment "") | |
3434 (setq comment nil) | |
3435 ;; 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
|
3436 (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
|
3437 (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
|
3438 (if (face-spec-choose value) |
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3439 (face-spec-set symbol value) |
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3440 ;; 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
|
3441 ;; something harmless instead. |
d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
Miles Bader <miles@gnu.org>
parents:
35265
diff
changeset
|
3442 (face-spec-set symbol '((t :foreground unspecified)))) |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3443 (unless (eq (widget-get widget :custom-state) 'standard) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3444 (put symbol 'saved-face value)) |
17334 | 3445 (put symbol 'customized-face nil) |
25685 | 3446 (put symbol 'face-comment comment) |
3447 (put symbol 'customized-face-comment nil) | |
3448 (put symbol 'saved-face-comment comment) | |
20262
c6532008f2a9
(custom-face-save): Save the face.
Karl Heuer <kwzh@gnu.org>
parents:
20174
diff
changeset
|
3449 (custom-save-all) |
17334 | 3450 (custom-face-state-set widget) |
3451 (custom-redraw-magic widget))) | |
3452 | |
68278
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3453 ;; For backward compatibility. |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3454 (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
|
3455 "22.1") |
125d04254c22
(custom-buffer-create-internal): State in the text above
Luc Teirlinck <teirllm@auburn.edu>
parents:
68232
diff
changeset
|
3456 |
17334 | 3457 (defun custom-face-reset-saved (widget) |
3458 "Restore WIDGET to the face's default attributes." | |
3459 (let* ((symbol (widget-value widget)) | |
3460 (child (car (widget-get widget :children))) | |
25685 | 3461 (value (get symbol 'saved-face)) |
3462 (comment (get symbol 'saved-face-comment)) | |
3463 (comment-widget (widget-get widget :comment-widget))) | |
3464 (unless (or value comment) | |
17334 | 3465 (error "No saved value for this face")) |
3466 (put symbol 'customized-face nil) | |
25685 | 3467 (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
|
3468 (custom-push-theme 'theme-face symbol 'user 'set value) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3469 (face-spec-set symbol value) |
25685 | 3470 (put symbol 'face-comment comment) |
17334 | 3471 (widget-value-set child value) |
25685 | 3472 ;; This call manages the comment visibility |
3473 (widget-value-set comment-widget (or comment "")) | |
17334 | 3474 (custom-face-state-set widget) |
3475 (custom-redraw-magic widget))) | |
3476 | |
46408
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3477 (defun custom-face-standard-value (widget) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3478 (get (widget-value widget) 'face-defface-spec)) |
ccaa90ab16a3
New operation :custom-standard-value.
Richard M. Stallman <rms@gnu.org>
parents:
45725
diff
changeset
|
3479 |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3480 (defun custom-face-reset-standard (widget) |
67749
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
3481 "Restore WIDGET to the face's standard attribute values. |
1607dd4159f5
(custom-reset-menu, custom-magic-alist, Custom-mode-menu):
Richard M. Stallman <rms@gnu.org>
parents:
67747
diff
changeset
|
3482 This operation eliminates any saved attributes for the face, |
26625
faf989c7a28e
(Custom-reset-standard): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
26451
diff
changeset
|
3483 restoring it to the state of a face that has never been customized." |
17334 | 3484 (let* ((symbol (widget-value widget)) |
3485 (child (car (widget-get widget :children))) | |
25685 | 3486 (value (get symbol 'face-defface-spec)) |
3487 (comment-widget (widget-get widget :comment-widget))) | |
17334 | 3488 (unless value |
17641
4650d25e48f6
Say "standard settings" instead of "factory settings".
Richard M. Stallman <rms@gnu.org>
parents:
17550
diff
changeset
|
3489 (error "No standard setting for this face")) |
17334 | 3490 (put symbol 'customized-face nil) |
25685 | 3491 (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
|
3492 (custom-push-theme 'theme-face symbol 'user 'reset) |
67792
1c774eee2980
* cus-edit.el (custom-variable-set, custom-variable-set)
Chong Yidong <cyd@stupidchicken.com>
parents:
67791
diff
changeset
|
3493 (custom-theme-recalc-face symbol) |
25685 | 3494 (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) |
17334 | 3495 (put symbol 'saved-face nil) |
25685 | 3496 (put symbol 'saved-face-comment nil) |
17334 | 3497 (custom-save-all)) |
25685 | 3498 (put symbol 'face-comment nil) |
17334 | 3499 (widget-value-set child value) |
25685 | 3500 ;; This call manages the comment visibility |
3501 (widget-value-set comment-widget "") | |
17334 | 3502 (custom-face-state-set widget) |
3503 (custom-redraw-magic widget))) | |
3504 | |
3505 ;;; The `face' Widget. | |
3506 | |
60280
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3507 (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
|
3508 "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
|
3509 |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3510 (define-widget 'face 'symbol |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3511 "A Lisp face name (with sample)." |
66941
1710aca8150f
(Custom-reset-standard): Verify that
Richard M. Stallman <rms@gnu.org>
parents:
66904
diff
changeset
|
3512 :format "%{%t%}: (%{sample%}) %v" |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3513 :tag "Face" |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3514 :value 'default |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3515 :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
|
3516 :notify 'widget-face-notify |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3517 :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
|
3518 :complete-function (lambda () |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3519 (interactive) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3520 (lisp-complete-symbol 'facep)) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3521 :prompt-match 'facep |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3522 :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
|
3523 :validate (lambda (widget) |
f0850dec46a9
(custom-buffer-create-internal): Improve progress msgs.
Richard M. Stallman <rms@gnu.org>
parents:
60214
diff
changeset
|
3524 (unless (facep (widget-value widget)) |
61307
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3525 (widget-put widget |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3526 :error (format "Invalid face: %S" |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3527 (widget-value widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3528 widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3529 |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3530 (defun widget-face-sample-face-get (widget) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3531 (let ((value (widget-value widget))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3532 (if (facep value) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3533 value |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3534 'default))) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3535 |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3536 (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
|
3537 "Update the sample, and notify the parent." |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3538 (overlay-put (widget-get widget :sample-overlay) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3539 'face (widget-apply widget :sample-face-get)) |
0592ebb75598
(face): Derive from symbol widget. Display sample
David Ponce <david@dponce.com>
parents:
60296
diff
changeset
|
3540 (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
|
3541 |
17334 | 3542 |
3543 ;;; The `hook' Widget. | |
3544 | |
3545 (define-widget 'hook 'list | |
3546 "A emacs lisp hook" | |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3547 :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
|
3548 (if (and value (symbolp value)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3549 (list value) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3550 value)) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3551 :match (lambda (widget value) |
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3552 (or (symbolp value) |
20174
e1ca1fe89e6e
(hook): Use `widget-group-match' instead of
Karl Heuer <kwzh@gnu.org>
parents:
20100
diff
changeset
|
3553 (widget-group-match widget value))) |
28130 | 3554 ;; Avoid adding undefined functions to the hook, especially for |
3555 ;; things like `find-file-hook' or even more basic ones, to avoid | |
3556 ;; chaos. | |
3557 :set (lambda (symbol value) | |
28310
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3558 (dolist (elt value) |
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3559 (if (fboundp elt) |
9ba6478b7a27
(hook): Use `dolist' instead of CL's `mapc'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28245
diff
changeset
|
3560 (add-hook symbol elt)))) |
17334 | 3561 :convert-widget 'custom-hook-convert-widget |
3562 :tag "Hook") | |
3563 | |
3564 (defun custom-hook-convert-widget (widget) | |
27250
807fc106b24c
(custom-hook-convert-widget): Fix comment.
Gerd Moellmann <gerd@gnu.org>
parents:
26803
diff
changeset
|
3565 ;; Handle `:options'. |
17334 | 3566 (let* ((options (widget-get widget :options)) |
25685 | 3567 (other `(editable-list :inline t |
17334 | 3568 :entry-format "%i %d%v" |
3569 (function :format " %v"))) | |
3570 (args (if options | |
3571 (list `(checklist :inline t | |
3572 ,@(mapcar (lambda (entry) | |
3573 `(function-item ,entry)) | |
3574 options)) | |
3575 other) | |
3576 (list other)))) | |
3577 (widget-put widget :args args) | |
3578 widget)) | |
3579 | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3580 ;;; The `custom-group-link' Widget. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3581 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3582 (define-widget 'custom-group-link 'link |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3583 "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
|
3584 :button-face 'custom-link |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
3585 :mouse-face 'highlight |
68892
93b583aac002
* wid-edit.el (widget-button-click): Use :pressed-face property
Chong Yidong <cyd@stupidchicken.com>
parents:
68406
diff
changeset
|
3586 :pressed-face 'highlight |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
3587 :help-echo "Create customization buffer for this group." |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3588 :action 'custom-group-link-action) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3589 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3590 (defun custom-group-link-action (widget &rest ignore) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3591 (customize-group (widget-value widget))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3592 |
17334 | 3593 ;;; The `custom-group' Widget. |
3594 | |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
3595 (defcustom custom-group-tag-faces nil |
17334 | 3596 ;; In XEmacs, this ought to play games with font size. |
25685 | 3597 ;; Fixme: make it do so in Emacs. |
17334 | 3598 "Face used for group tags. |
3599 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
|
3600 and so forth. The remaining group tags are shown with `custom-group-tag'." |
17334 | 3601 :type '(repeat face) |
17415 | 3602 :group 'custom-faces) |
17334 | 3603 |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3604 (defface custom-group-tag-1 |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3605 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3606 (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3607 (: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
|
3608 (((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
|
3609 (background light)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3610 (: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
|
3611 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3612 (background light)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3613 (: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
|
3614 (t (:weight bold))) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3615 "Face used for group tags." |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3616 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3617 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3618 (put 'custom-group-tag-face-1 'face-alias 'custom-group-tag-1) |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3619 |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3620 (defface custom-group-tag |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3621 `((((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3622 (background dark)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3623 (:foreground "light blue" :weight bold :height 1.2)) |
61394
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3624 (((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
|
3625 (background light)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
61307
diff
changeset
|
3626 (:foreground "blue1" :weight bold :height 1.2)) |
28172
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3627 (((class color) |
b243caac6505
(custom-variable-tag-face): Handle case that
Gerd Moellmann <gerd@gnu.org>
parents:
28130
diff
changeset
|
3628 (background light)) |
42451
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3629 (:foreground "blue" :weight bold :height 1.2)) |
cade20d9a300
(custom-face-edit-fix-value): Delete `assert' call.
Richard M. Stallman <rms@gnu.org>
parents:
42448
diff
changeset
|
3630 (t (:weight bold))) |
17334 | 3631 "Face used for low level group tags." |
17415 | 3632 :group 'custom-faces) |
63194
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3633 ;; backward-compatibility alias |
acd4cec2decf
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Miles Bader <miles@gnu.org>
parents:
62722
diff
changeset
|
3634 (put 'custom-group-tag-face 'face-alias 'custom-group-tag) |
17334 | 3635 |
3636 (define-widget 'custom-group 'custom | |
3637 "Customize group." | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3638 :format "%v" |
17334 | 3639 :sample-face-get 'custom-group-sample-face-get |
3640 :documentation-property 'group-documentation | |
3641 :help-echo "Set or reset all members of this group." | |
3642 :value-create 'custom-group-value-create | |
3643 :action 'custom-group-action | |
18089 | 3644 :custom-category 'group |
17334 | 3645 :custom-set 'custom-group-set |
3646 :custom-save 'custom-group-save | |
3647 :custom-reset-current 'custom-group-reset-current | |
3648 :custom-reset-saved 'custom-group-reset-saved | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3649 :custom-reset-standard 'custom-group-reset-standard |
17334 | 3650 :custom-menu 'custom-group-menu-create) |
3651 | |
3652 (defun custom-group-sample-face-get (widget) | |
3653 ;; Use :sample-face. | |
3654 (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
|
3655 'custom-group-tag)) |
17334 | 3656 |
18430
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3657 (define-widget 'custom-group-visibility 'visibility |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3658 "An indicator and manipulator for hidden group contents." |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3659 :create 'custom-group-visibility-create) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3660 |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3661 (defun custom-group-visibility-create (widget) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3662 (let ((visible (widget-value widget))) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3663 (if visible |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3664 (insert "--------"))) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3665 (widget-default-create widget)) |
a8ae9c653696
(custom-group-visibility): Widget type
Richard M. Stallman <rms@gnu.org>
parents:
18373
diff
changeset
|
3666 |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3667 (defun custom-group-members (symbol groups-only) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3668 "Return SYMBOL's custom group members. |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3669 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
|
3670 (if (not groups-only) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3671 (get symbol 'custom-group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3672 (let (members) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3673 (dolist (entry (get symbol 'custom-group)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3674 (when (eq (nth 1 entry) 'custom-group) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3675 (push entry members))) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3676 (nreverse members)))) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3677 |
17334 | 3678 (defun custom-group-value-create (widget) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3679 "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
|
3680 (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
|
3681 (custom-load-widget widget)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3682 (let* ((state (widget-get widget :custom-state)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3683 (level (widget-get widget :custom-level)) |
19040
c0dc58ad2d47
Synched with 1.9954.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19022
diff
changeset
|
3684 ;; (indent (widget-get widget :indent)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3685 (prefix (widget-get widget :custom-prefix)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3686 (buttons (widget-get widget :buttons)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3687 (tag (widget-get widget :tag)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3688 (symbol (widget-value widget)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3689 (members (custom-group-members symbol |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3690 (and (eq custom-buffer-style 'tree) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3691 custom-browse-only-groups)))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3692 (cond ((and (eq custom-buffer-style 'tree) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3693 (eq state 'hidden) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3694 (or members (custom-unloaded-widget-p widget))) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3695 (custom-browse-insert-prefix prefix) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3696 (push (widget-create-child-and-convert |
25685 | 3697 widget 'custom-browse-visibility |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3698 ;; :tag-glyph "plus" |
18856
03eeb83520d8
(custom-group-value-create) <tree>: Don't distinguish
Richard M. Stallman <rms@gnu.org>
parents:
18812
diff
changeset
|
3699 :tag "+") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3700 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3701 (insert "-- ") |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3702 ;; (widget-glyph-insert nil "-- " "horizontal") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3703 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3704 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3705 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3706 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3707 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3708 ((and (eq custom-buffer-style 'tree) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3709 (zerop (length members))) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3710 (custom-browse-insert-prefix prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3711 (insert "[ ]-- ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3712 ;; (widget-glyph-insert nil "[ ]" "empty") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3713 ;; (widget-glyph-insert nil "-- " "horizontal") |
25685 | 3714 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3715 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3716 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3717 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3718 (widget-put widget :buttons buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3719 ((eq custom-buffer-style 'tree) |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3720 (custom-browse-insert-prefix prefix) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3721 (if (zerop (length members)) |
25685 | 3722 (progn |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3723 (custom-browse-insert-prefix prefix) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3724 (insert "[ ]-- ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3725 ;; (widget-glyph-insert nil "[ ]" "empty") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3726 ;; (widget-glyph-insert nil "-- " "horizontal") |
25685 | 3727 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3728 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3729 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3730 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3731 (widget-put widget :buttons buttons)) |
25685 | 3732 (push (widget-create-child-and-convert |
3733 widget 'custom-browse-visibility | |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3734 ;; :tag-glyph "minus" |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3735 :tag "-") |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3736 buttons) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3737 (insert "-\\ ") |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3738 ;; (widget-glyph-insert nil "-\\ " "top") |
25685 | 3739 (push (widget-create-child-and-convert |
18562
e22e2a4e683a
Synched with 1.9942.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18462
diff
changeset
|
3740 widget 'custom-browse-group-tag) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3741 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3742 (insert " " tag "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3743 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3744 (message "Creating group...") |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3745 (let* ((members (custom-sort-items members |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3746 custom-browse-sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3747 custom-browse-order-groups)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3748 (prefixes (widget-get widget :custom-prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3749 (custom-prefix-list (custom-prefix-add symbol prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3750 (extra-prefix (if (widget-get widget :custom-last) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3751 " " |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3752 " | ")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3753 (prefix (concat prefix extra-prefix)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3754 children entry) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3755 (while members |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3756 (setq entry (car members) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3757 members (cdr members)) |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3758 (push (widget-create-child-and-convert |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3759 widget (nth 1 entry) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3760 :group widget |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3761 :tag (custom-unlispify-tag-name (nth 0 entry)) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3762 :custom-prefixes custom-prefix-list |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3763 :custom-level (1+ level) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3764 :custom-last (null members) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3765 :value (nth 0 entry) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3766 :custom-prefix prefix) |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3767 children)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3768 (widget-put widget :children (reverse children))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3769 (message "Creating group...done"))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3770 ;; Nested style. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3771 ((eq state 'hidden) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3772 ;; Create level indicator. |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
3773 (unless (eq custom-buffer-style 'links) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
3774 (insert-char ?\ (* custom-buffer-indent (1- level))) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
3775 (insert "-- ")) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3776 ;; Create tag. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3777 (let ((begin (point))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3778 (insert tag) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3779 (widget-specify-sample widget begin (point))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3780 (insert " group: ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3781 ;; Create link/visibility indicator. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3782 (if (eq custom-buffer-style 'links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3783 (push (widget-create-child-and-convert |
25685 | 3784 widget 'custom-group-link |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
3785 :tag "Go to Group" |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3786 symbol) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3787 buttons) |
25685 | 3788 (push (widget-create-child-and-convert |
20100
0db4553d47cc
(custom-group-value-create): Use
Karl Heuer <kwzh@gnu.org>
parents:
19886
diff
changeset
|
3789 widget 'custom-group-visibility |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3790 :help-echo "Show members of this group." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3791 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3792 (not (eq state 'hidden))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3793 buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3794 (insert " \n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3795 ;; Create magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3796 (let ((magic (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3797 widget 'custom-magic nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3798 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3799 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3800 ;; Update buttons. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3801 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3802 ;; Insert documentation. |
18367
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
3803 (if (and (eq custom-buffer-style 'links) (> level 1)) |
f4682a047be1
(custom-magic-value-create):
Richard M. Stallman <rms@gnu.org>
parents:
18364
diff
changeset
|
3804 (widget-put widget :documentation-indent 0)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3805 (widget-default-format-handler widget ?h)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3806 ;; Nested style. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3807 (t ;Visible. |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3808 ;; Add parent groups references above the group. |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3809 (if t ;;; 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
|
3810 ;;; was made to display a group. |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3811 (when (eq level 1) |
18371
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
3812 (if (custom-add-parent-links widget |
a32f9b2c2e0c
(custom-add-parent-links): New arg INITIAL-STRING.
Richard M. Stallman <rms@gnu.org>
parents:
18370
diff
changeset
|
3813 "Go to parent group:") |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3814 (insert "\n")))) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3815 ;; Create level indicator. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3816 (insert-char ?\ (* custom-buffer-indent (1- level))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3817 (insert "/- ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3818 ;; Create tag. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3819 (let ((start (point))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3820 (insert tag) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3821 (widget-specify-sample widget start (point))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3822 (insert " group: ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3823 ;; Create visibility indicator. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3824 (unless (eq custom-buffer-style 'links) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3825 (insert "--------") |
25685 | 3826 (push (widget-create-child-and-convert |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3827 widget 'visibility |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3828 :help-echo "Hide members of this group." |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3829 :action 'custom-toggle-parent |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3830 (not (eq state 'hidden))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3831 buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3832 (insert " ")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3833 ;; Create more dashes. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3834 ;; Use 76 instead of 75 to compensate for the temporary "<" |
25685 | 3835 ;; added by `widget-insert'. |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3836 (insert-char ?- (- 76 (current-column) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3837 (* custom-buffer-indent level))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3838 (insert "\\\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3839 ;; Create magic button. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3840 (let ((magic (widget-create-child-and-convert |
25685 | 3841 widget 'custom-magic |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3842 :indent 0 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3843 nil))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3844 (widget-put widget :custom-magic magic) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3845 (push magic buttons)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3846 ;; Update buttons. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3847 (widget-put widget :buttons buttons) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3848 ;; Insert documentation. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3849 (widget-default-format-handler widget ?h) |
18370
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3850 ;; Parent groups. |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3851 (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
|
3852 ;;; 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
|
3853 (when (eq level 1) |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3854 (insert-char ?\ custom-buffer-indent) |
74558272517b
(custom-group-value-create): Use group-visibility widget.
Richard M. Stallman <rms@gnu.org>
parents:
18368
diff
changeset
|
3855 (custom-add-parent-links widget))) |
25685 | 3856 (custom-add-see-also widget |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3857 (make-string (* custom-buffer-indent level) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3858 ?\ )) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3859 ;; Members. |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3860 (message "Creating group...") |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
3861 (let* ((members (custom-sort-items members |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3862 custom-buffer-sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
3863 custom-buffer-order-groups)) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3864 (prefixes (widget-get widget :custom-prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3865 (custom-prefix-list (custom-prefix-add symbol prefixes)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3866 (length (length members)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3867 (count 0) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3868 (children (mapcar (lambda (entry) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3869 (widget-insert "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3870 (message "\ |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3871 Creating group members... %2d%%" |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3872 (/ (* 100.0 count) length)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3873 (setq count (1+ count)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3874 (prog1 |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3875 (widget-create-child-and-convert |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3876 widget (nth 1 entry) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3877 :group widget |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3878 :tag (custom-unlispify-tag-name |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3879 (nth 0 entry)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3880 :custom-prefixes custom-prefix-list |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3881 :custom-level (1+ level) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3882 :value (nth 0 entry)) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3883 (unless (eq (preceding-char) ?\n) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3884 (widget-insert "\n")))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3885 members))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3886 (message "Creating group magic...") |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3887 (mapc 'custom-magic-reset children) |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3888 (message "Creating group state...") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3889 (widget-put widget :children children) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3890 (custom-group-state-update widget) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3891 (message "Creating group... done")) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3892 ;; End line |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3893 (insert "\n") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3894 (insert-char ?\ (* custom-buffer-indent (1- level))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3895 (insert "\\- " (widget-get widget :tag) " group end ") |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3896 (insert-char ?- (- 75 (current-column) (* custom-buffer-indent level))) |
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
3897 (insert "/\n"))))) |
17334 | 3898 |
25685 | 3899 (defvar custom-group-menu |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3900 `(("Set for Current Session" custom-group-set |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3901 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3902 (eq (widget-get widget :custom-state) 'modified))) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3903 ,@(when (or custom-file user-init-file) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3904 '(("Save for Future Sessions" custom-group-save |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3905 (lambda (widget) |
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3906 (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
|
3907 ("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
|
3908 (lambda (widget) |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
3909 (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
|
3910 ("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
|
3911 (lambda (widget) |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
3912 (memq (widget-get widget :custom-state) '(modified set)))) |
d8acae190ef7
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68017
diff
changeset
|
3913 ,@(when (or custom-file user-init-file) |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
3914 '(("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
|
3915 (lambda (widget) |
68028
b0c2a07f73f6
(custom-reset-menu, Custom-mode-menu)
Chong Yidong <cyd@stupidchicken.com>
parents:
68026
diff
changeset
|
3916 (memq (widget-get widget :custom-state) '(modified set saved))))))) |
17334 | 3917 "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
|
3918 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
|
3919 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
|
3920 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
|
3921 widget as an argument, and returns non-nil if ACTION is valid on that |
25685 | 3922 widget. If FILTER is nil, ACTION is always valid.") |
17334 | 3923 |
3924 (defun custom-group-action (widget &optional event) | |
3925 "Show the menu for `custom-group' WIDGET. | |
3926 Optional EVENT is the location for the menu." | |
3927 (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
|
3928 (custom-toggle-hide widget) |
17334 | 3929 (let* ((completion-ignore-case t) |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3930 (answer (widget-choose (concat "Operation on " |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3931 (custom-unlispify-tag-name |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3932 (widget-get widget :value))) |
17550
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3933 (custom-menu-filter custom-group-menu |
d6545cfb6c5a
Synched with custom 1.90.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17534
diff
changeset
|
3934 widget) |
17334 | 3935 event))) |
3936 (if answer | |
3937 (funcall answer widget))))) | |
3938 | |
3939 (defun custom-group-set (widget) | |
3940 "Set changes in all modified group members." | |
3941 (let ((children (widget-get widget :children))) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3942 (mapc (lambda (child) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3943 (when (eq (widget-get child :custom-state) 'modified) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3944 (widget-apply child :custom-set))) |
17334 | 3945 children ))) |
3946 | |
3947 (defun custom-group-save (widget) | |
3948 "Save all modified group members." | |
3949 (let ((children (widget-get widget :children))) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3950 (mapc (lambda (child) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3951 (when (memq (widget-get child :custom-state) '(modified set)) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3952 (widget-apply child :custom-save))) |
17334 | 3953 children ))) |
3954 | |
3955 (defun custom-group-reset-current (widget) | |
3956 "Reset all modified group members." | |
3957 (let ((children (widget-get widget :children))) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3958 (mapc (lambda (child) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3959 (when (eq (widget-get child :custom-state) 'modified) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3960 (widget-apply child :custom-reset-current))) |
17334 | 3961 children ))) |
3962 | |
3963 (defun custom-group-reset-saved (widget) | |
3964 "Reset all modified or set group members." | |
3965 (let ((children (widget-get widget :children))) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3966 (mapc (lambda (child) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3967 (when (memq (widget-get child :custom-state) '(modified set)) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3968 (widget-apply child :custom-reset-saved))) |
17334 | 3969 children ))) |
3970 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3971 (defun custom-group-reset-standard (widget) |
17334 | 3972 "Reset all modified, set, or saved group members." |
3973 (let ((children (widget-get widget :children))) | |
28700
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3974 (mapc (lambda (child) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3975 (when (memq (widget-get child :custom-state) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3976 '(modified set saved)) |
a57bafeec17c
(Custom-set, Custom-save, Custom-reset-current)
Dave Love <fx@gnu.org>
parents:
28612
diff
changeset
|
3977 (widget-apply child :custom-reset-standard))) |
17334 | 3978 children ))) |
3979 | |
3980 (defun custom-group-state-update (widget) | |
3981 "Update magic." | |
3982 (unless (eq (widget-get widget :custom-state) 'hidden) | |
3983 (let* ((children (widget-get widget :children)) | |
3984 (states (mapcar (lambda (child) | |
3985 (widget-get child :custom-state)) | |
3986 children)) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3987 (magics custom-magic-alist) |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
3988 (found 'standard)) |
17334 | 3989 (while magics |
3990 (let ((magic (car (car magics)))) | |
3991 (if (and (not (eq magic 'hidden)) | |
3992 (memq magic states)) | |
3993 (setq found magic | |
3994 magics nil) | |
3995 (setq magics (cdr magics))))) | |
3996 (widget-put widget :custom-state found))) | |
3997 (custom-magic-reset widget)) | |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
3998 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
3999 ;;; Reading and writing the custom file. |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4000 |
18336
325190603227
Synched with 1.9924.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18320
diff
changeset
|
4001 ;;;###autoload |
19822
b5c12a2d1c26
*** empty log message ***
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19684
diff
changeset
|
4002 (defcustom custom-file nil |
17334 | 4003 "File used for storing customization information. |
19822
b5c12a2d1c26
*** empty log message ***
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
19684
diff
changeset
|
4004 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
|
4005 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
|
4006 it should be an absolute file name. |
0b90a17a09e1
(custom-file): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
58779
diff
changeset
|
4007 |
59335
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4008 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
|
4009 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
|
4010 something like the following in your init file: |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4011 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4012 \(setq custom-file \"~/.emacs-custom.el\") |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4013 \(load custom-file) |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4014 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4015 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
|
4016 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
|
4017 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4018 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
|
4019 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
|
4020 forms `(custom-set-variables ...)' and `(custom-set-faces ...)', |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4021 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
|
4022 This will preserve your existing customizations. |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4023 |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4024 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
|
4025 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
|
4026 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
|
4027 `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
|
4028 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
|
4029 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
|
4030 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
|
4031 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
|
4032 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
|
4033 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
|
4034 :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
|
4035 (file :format "%t:%v%d" |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4036 :doc |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4037 "Please read entire docstring below before setting \ |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4038 this through Custom. |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4039 Click om \"More\" \(or position point there and press RETURN) |
45239c528a49
(custom-file): Doc fix for defcustom.
Luc Teirlinck <teirllm@auburn.edu>
parents:
58941
diff
changeset
|
4040 if only the first line of the docstring is shown.")) |
17334 | 4041 :group 'customize) |
4042 | |
20974 | 4043 (defun custom-file () |
4044 "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
|
4045 (file-chase-links |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4046 (or custom-file |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4047 (let ((user-init-file user-init-file) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4048 (default-init-file |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4049 (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
|
4050 (when (null user-init-file) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4051 (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
|
4052 (and (eq system-type 'windows-nt) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4053 (file-exists-p "~/_emacs"))) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4054 ;; 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
|
4055 ;; Custom settings hasn't been read. Saving |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4056 ;; settings there would overwrite other settings. |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4057 (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
|
4058 (setq user-init-file default-init-file)) |
6e4e2882c013
(custom-file): Call file-chase-links.
Richard M. Stallman <rms@gnu.org>
parents:
61475
diff
changeset
|
4059 user-init-file)))) |
20974 | 4060 |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4061 ;;;###autoload |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4062 (defun custom-save-all () |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4063 "Save all customizations in `custom-file'." |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4064 (let* ((filename (custom-file)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4065 (recentf-exclude (if recentf-mode |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4066 (cons (concat "\\`" |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4067 (regexp-quote (custom-file)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4068 "\\'") |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4069 recentf-exclude))) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4070 (old-buffer (find-buffer-visiting filename))) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4071 (with-current-buffer (or old-buffer (find-file-noselect filename)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4072 (let ((inhibit-read-only t)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4073 (custom-save-variables) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4074 (custom-save-faces)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4075 (let ((file-precious-flag t)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4076 (save-buffer)) |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4077 (unless old-buffer |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4078 (kill-buffer (current-buffer)))))) |
67939
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4079 |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4080 ;;;###autoload |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4081 (defun customize-save-customized () |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4082 "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
|
4083 (interactive) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4084 (mapatoms (lambda (symbol) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4085 (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
|
4086 (value (get symbol 'customized-value)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4087 (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
|
4088 (variable-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4089 (get symbol 'customized-variable-comment))) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4090 (when face |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4091 (put symbol 'saved-face face) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4092 (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
|
4093 (put symbol 'customized-face nil)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4094 (when value |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4095 (put symbol 'saved-value value) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4096 (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
|
4097 (put symbol 'customized-value nil)) |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4098 (when variable-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4099 (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
|
4100 (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
|
4101 (when face-comment |
66965e79dd66
(custom-save-loaded-themes): Call custom-save-delete.
Richard M. Stallman <rms@gnu.org>
parents:
67797
diff
changeset
|
4102 (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
|
4103 (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
|
4104 ;; 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
|
4105 (custom-save-all)) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4106 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4107 ;; 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
|
4108 |
17334 | 4109 (defun custom-save-delete (symbol) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4110 "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
|
4111 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
|
4112 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
|
4113 |
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4114 This function does not save the buffer." |
17334 | 4115 (goto-char (point-min)) |
25058
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4116 ;; Skip all whitespace and comments. |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4117 (while (forward-comment 1)) |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4118 (or (eobp) |
af119d40c92d
(custom-save-delete): Avoid error for empty .emacs.
Karl Heuer <kwzh@gnu.org>
parents:
24509
diff
changeset
|
4119 (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
|
4120 (let (first) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4121 (catch 'found |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4122 (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
|
4123 ;; Skip all whitespace and comments. |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4124 (while (forward-comment 1)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4125 (let ((start (point)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4126 (sexp (condition-case nil |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4127 (read (current-buffer)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4128 (end-of-file (throw 'found nil))))) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4129 (when (and (listp sexp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4130 (eq (car sexp) symbol)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4131 (delete-region start (point)) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4132 (unless first |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4133 (setq first (point))))))) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4134 (if first |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4135 (goto-char first) |
36628
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4136 ;; 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
|
4137 ;; entries would make them ineffective. |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4138 (let ((pos (point-max)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4139 (case-fold-search t)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4140 (save-excursion |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4141 (goto-char (point-max)) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4142 (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
|
4143 'move) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4144 (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
|
4145 (setq pos (line-beginning-position)))) |
d1106e82508b
(custom-save-delete): Move in front of local
Gerd Moellmann <gerd@gnu.org>
parents:
35441
diff
changeset
|
4146 (goto-char pos))))) |
17334 | 4147 |
4148 (defun custom-save-variables () | |
4149 "Save all customized variables in `custom-file'." | |
4150 (save-excursion | |
4151 (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
|
4152 (let ((standard-output (current-buffer)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4153 (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
|
4154 sort-fold-case) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4155 ;; 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
|
4156 (mapatoms |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4157 (lambda (symbol) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4158 (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
|
4159 ;; ignore theme values |
f4a06252f47c
* cus-edit.el (custom-save-variables): Allow unthemed values.
Chong Yidong <cyd@stupidchicken.com>
parents:
68913
diff
changeset
|
4160 (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
|
4161 (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
|
4162 (nconc saved-list (list symbol))))) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4163 (setq saved-list (sort (cdr saved-list) 'string<)) |
17334 | 4164 (unless (bolp) |
4165 (princ "\n")) | |
26653
ea8ae3c8fad5
(custom-save-variables, custom-save-faces): Write a
Dave Love <fx@gnu.org>
parents:
26625
diff
changeset
|
4166 (princ "(custom-set-variables |
47315
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4167 ;; custom-set-variables was added by Custom. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4168 ;; If you edit it by hand, you could mess it up, so be careful. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4169 ;; Your init file should contain only one such instance. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4170 ;; 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
|
4171 (dolist (symbol saved-list) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4172 (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
|
4173 (value (get symbol 'saved-value)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4174 (requests (get symbol 'custom-requests)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4175 (now (not (or (custom-variable-p symbol) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4176 (and (not (boundp symbol)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4177 (not (eq (get symbol 'force-value) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4178 'rogue)))))) |
51362
0b5cb555fd17
(custom-get-fresh-buffer): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51277
diff
changeset
|
4179 (comment (get symbol 'saved-variable-comment))) |
49556
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4180 ;; Check `requests'. |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4181 (dolist (request requests) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4182 (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
|
4183 (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
|
4184 (setq requests (delq request requests)))) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4185 (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
|
4186 comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4187 (and (null spec) (get symbol 'saved-value))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4188 (unless (bolp) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4189 (princ "\n")) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4190 (princ " '(") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4191 (prin1 symbol) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4192 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4193 (prin1 (car value)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4194 (when (or now requests comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4195 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4196 (prin1 now) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4197 (when (or requests comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4198 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4199 (prin1 requests) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4200 (when comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4201 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4202 (prin1 comment)))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4203 (princ ")")))) |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4204 (if (bolp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4205 (princ " ")) |
17334 | 4206 (princ ")") |
4207 (unless (looking-at "\n") | |
4208 (princ "\n"))))) | |
4209 | |
4210 (defun custom-save-faces () | |
4211 "Save all customized faces in `custom-file'." | |
4212 (save-excursion | |
48949
f216c93c4189
(customize-save-variable): Take themes into account.
Richard M. Stallman <rms@gnu.org>
parents:
48709
diff
changeset
|
4213 (custom-save-delete 'custom-reset-faces) |
17334 | 4214 (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
|
4215 (let ((standard-output (current-buffer)) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4216 (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
|
4217 sort-fold-case) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4218 ;; 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
|
4219 (mapatoms |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4220 (lambda (symbol) |
67977
03ee9bccbfeb
* custom.el: Move Custom Themes commentary to start of theme code.
Chong Yidong <cyd@stupidchicken.com>
parents:
67972
diff
changeset
|
4221 (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
|
4222 (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
|
4223 (nconc saved-list (list symbol))))) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4224 (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
|
4225 ;; 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
|
4226 (if (memq 'default saved-list) |
d6081fb56cda
(custom-save-variables, custom-save-faces): Sort
Markus Rost <rost@math.uni-bielefeld.de>
parents:
25058
diff
changeset
|
4227 (setq saved-list (cons 'default (delq 'default saved-list)))) |
17334 | 4228 (unless (bolp) |
4229 (princ "\n")) | |
26653
ea8ae3c8fad5
(custom-save-variables, custom-save-faces): Write a
Dave Love <fx@gnu.org>
parents:
26625
diff
changeset
|
4230 (princ "(custom-set-faces |
47315
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4231 ;; custom-set-faces was added by Custom. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4232 ;; If you edit it by hand, you could mess it up, so be careful. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4233 ;; Your init file should contain only one such instance. |
655350cd09e5
(custom-save-variables, custom-save-faces):
Richard M. Stallman <rms@gnu.org>
parents:
47168
diff
changeset
|
4234 ;; 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
|
4235 (dolist (symbol saved-list) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4236 (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
|
4237 (value (get symbol 'saved-face)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4238 (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
|
4239 (and (not (custom-facep symbol)) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4240 (not (get symbol 'force-face)))))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4241 (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
|
4242 (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
|
4243 comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4244 (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
|
4245 ;; 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
|
4246 (unless (bolp) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4247 (princ "\n")) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4248 (princ " '(") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4249 (prin1 symbol) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4250 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4251 (prin1 value) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4252 (when (or now comment) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4253 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4254 (prin1 now) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4255 (when comment |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4256 (princ " ") |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4257 (prin1 comment))) |
e8de2a4807e5
(custom-unlispify-menu-entry): Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49521
diff
changeset
|
4258 (princ ")")))) |
26803
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4259 (if (bolp) |
f7c68655bd5d
(custom-save-delete): Delete all occurrences,
Richard M. Stallman <rms@gnu.org>
parents:
26653
diff
changeset
|
4260 (princ " ")) |
17334 | 4261 (princ ")") |
4262 (unless (looking-at "\n") | |
48958
6b4f6412de76
(custom-save-faces): Fix typo.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
48949
diff
changeset
|
4263 (princ "\n"))))) |
65225
131c93f081eb
(custom-buffer-sort-alphabetically): Default to t.
Richard M. Stallman <rms@gnu.org>
parents:
64931
diff
changeset
|
4264 |
17334 | 4265 ;;; The Customize Menu. |
4266 | |
17415 | 4267 ;;; Menu support |
4268 | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4269 (defcustom custom-menu-nesting 2 |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4270 "Maximum nesting in custom menus." |
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4271 :type 'integer |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
4272 :group 'custom-menu) |
17334 | 4273 |
4274 (defun custom-face-menu-create (widget symbol) | |
4275 "Ignoring WIDGET, create a menu entry for customization face SYMBOL." | |
4276 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4277 `(customize-face ',symbol) |
17334 | 4278 t)) |
4279 | |
4280 (defun custom-variable-menu-create (widget symbol) | |
4281 "Ignoring WIDGET, create a menu entry for customization variable SYMBOL." | |
4282 (let ((type (get symbol 'custom-type))) | |
4283 (unless (listp type) | |
4284 (setq type (list type))) | |
4285 (if (and type (widget-get type :custom-menu)) | |
4286 (widget-apply type :custom-menu symbol) | |
4287 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4288 `(customize-variable ',symbol) |
17334 | 4289 t)))) |
4290 | |
17415 | 4291 ;; Add checkboxes to boolean variable entries. |
17334 | 4292 (widget-put (get 'boolean 'widget-type) |
4293 :custom-menu (lambda (widget symbol) | |
4294 (vector (custom-unlispify-menu-entry symbol) | |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4295 `(customize-variable ',symbol) |
17334 | 4296 ':style 'toggle |
4297 ':selected symbol))) | |
4298 | |
30184
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4299 (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
|
4300 "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
|
4301 `( ,(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
|
4302 :filter (lambda (&rest junk) |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4303 (let ((menu (custom-menu-create ',symbol))) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4304 (if (consp menu) (cdr menu) menu))))) |
17334 | 4305 |
17415 | 4306 ;;;###autoload |
4307 (defun custom-menu-create (symbol) | |
17334 | 4308 "Create menu for customization group SYMBOL. |
4309 The menu is in a format applicable to `easy-menu-define'." | |
17415 | 4310 (let* ((item (vector (custom-unlispify-menu-entry symbol) |
17798
f59c9a63514b
Synched with version 1.97.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
17703
diff
changeset
|
4311 `(customize-group ',symbol) |
17415 | 4312 t))) |
4313 (if (and (or (not (boundp 'custom-menu-nesting)) | |
4314 (>= custom-menu-nesting 0)) | |
49126
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4315 (progn |
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4316 (custom-load-symbol symbol) |
697ca5db73b8
(customize-group, customize-group-other-window):
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49104
diff
changeset
|
4317 (< (length (get symbol 'custom-group)) widget-menu-max-size))) |
17334 | 4318 (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
|
4319 custom-prefix-list)) |
18451
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4320 (members (custom-sort-items (get symbol 'custom-group) |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4321 custom-menu-sort-alphabetically |
8eb08560287b
Synched with 1.9936.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18437
diff
changeset
|
4322 custom-menu-order-groups))) |
17334 | 4323 `(,(custom-unlispify-menu-entry symbol t) |
4324 ,item | |
4325 "--" | |
4326 ,@(mapcar (lambda (entry) | |
4327 (widget-apply (if (listp (nth 1 entry)) | |
4328 (nth 1 entry) | |
4329 (list (nth 1 entry))) | |
4330 :custom-menu (nth 0 entry))) | |
18033
bccd356a3b7c
Synched with version 1.9900.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18032
diff
changeset
|
4331 members))) |
17334 | 4332 item))) |
4333 | |
4334 ;;;###autoload | |
17415 | 4335 (defun customize-menu-create (symbol &optional name) |
4336 "Return a customize menu for customization group SYMBOL. | |
25685 | 4337 If optional NAME is given, use that as the name of the menu. |
17415 | 4338 Otherwise the menu will be named `Customize'. |
4339 The format is suitable for use with `easy-menu-define'." | |
4340 (unless name | |
4341 (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
|
4342 `(,name |
aa305b5e66ed
(custom-group-menu-create, customize-menu-create): Use :filter, per old
Dave Love <fx@gnu.org>
parents:
29879
diff
changeset
|
4343 :filter (lambda (&rest junk) |
47168
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4344 (let ((menu (custom-menu-create ',symbol))) |
59fc9e6fd3e8
(custom-unlispify-menu-entry): Don't remove
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46580
diff
changeset
|
4345 (if (consp menu) (cdr menu) menu))))) |
17334 | 4346 |
17415 | 4347 ;;; The Custom Mode. |
4348 | |
59760
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4349 (defvar custom-mode-map |
33110
10379d59910e
(custom-mode-map): Switch back to a sparse keymap.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33024
diff
changeset
|
4350 ;; This keymap should be dense, but a dense keymap would prevent inheriting |
10379d59910e
(custom-mode-map): Switch back to a sparse keymap.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33024
diff
changeset
|
4351 ;; "\r" bindings from the parent map. |
59760
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4352 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4353 (let ((map (make-keymap))) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4354 (set-keymap-parent map widget-keymap) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4355 (suppress-keymap map) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4356 (define-key map " " 'scroll-up) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4357 (define-key map "\177" 'scroll-down) |
64494
ca001bc998df
(custom-mode-map): Bind `C-c C-c' to `Custom-set'.
Juri Linkov <juri@jurta.org>
parents:
64151
diff
changeset
|
4358 (define-key map "\C-c\C-c" 'Custom-set) |
59760
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4359 (define-key map "\C-x\C-s" 'Custom-save) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4360 (define-key map "q" 'Custom-buffer-done) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4361 (define-key map "u" 'Custom-goto-parent) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4362 (define-key map "n" 'widget-forward) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4363 (define-key map "p" 'widget-backward) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4364 map) |
a7a34c3cb55e
(custom-mode-map): Make it dense.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59759
diff
changeset
|
4365 "Keymap for `custom-mode'.") |
18460
a2be4f4ac8ed
(Custom-move-and-invoke): New command.
Richard M. Stallman <rms@gnu.org>
parents:
18451
diff
changeset
|
4366 |
25685 | 4367 (easy-menu-define Custom-mode-menu |
17415 | 4368 custom-mode-map |
4369 "Menu used in customization buffers." | |
4370 `("Custom" | |
18364
01666331d10f
Synched with 1.9930.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18362
diff
changeset
|
4371 ,(customize-menu-create 'customize) |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
4372 ["Set" Custom-set t] |
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
4373 ["Save" Custom-save t] |
68139
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4374 ["Undo Edits" Custom-reset-current t] |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4375 ["Reset to Saved" Custom-reset-saved t] |
058a6e577709
(custom-reset-menu, custom-buffer-create-internal)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68109
diff
changeset
|
4376 ["Erase Customization" Custom-reset-standard t] |
64494
ca001bc998df
(custom-mode-map): Bind `C-c C-c' to `Custom-set'.
Juri Linkov <juri@jurta.org>
parents:
64151
diff
changeset
|
4377 ["Info" (info "(emacs)Easy Customization") t])) |
17415 | 4378 |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4379 (defvar custom-field-keymap |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4380 (let ((map (copy-keymap widget-field-keymap))) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4381 (define-key map "\C-c\C-c" 'Custom-set) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4382 (define-key map "\C-x\C-s" 'Custom-save) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4383 map) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4384 "Keymap used inside editable fields in customization buffers.") |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4385 |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4386 (widget-put (get 'editable-field 'widget-type) :keymap custom-field-keymap) |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4387 |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4388 (defun Custom-goto-parent () |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4389 "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
|
4390 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
|
4391 (interactive) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4392 (save-excursion |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4393 (goto-char (point-min)) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4394 (if (search-forward "\nGo to parent group: " nil t) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4395 (let* ((button (get-char-property (point) 'button)) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4396 (parent (downcase (widget-get button :tag)))) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4397 (customize-group parent))))) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4398 |
17415 | 4399 (defcustom custom-mode-hook nil |
25685 | 4400 "Hook called when entering Custom mode." |
17415 | 4401 :type 'hook |
18244
909a0f9169b8
Synched with 1.9914.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18139
diff
changeset
|
4402 :group 'custom-buffer ) |
17415 | 4403 |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4404 (defun custom-state-buffer-message (widget) |
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4405 (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
|
4406 (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
|
4407 |
17415 | 4408 (defun custom-mode () |
4409 "Major mode for editing customization buffers. | |
4410 | |
4411 The following commands are available: | |
4412 | |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4413 \\<widget-keymap>\ |
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4414 Move to next button, link or editable field. \\[widget-forward] |
68406
5020a0c4a1aa
(custom-mode): Doc: Use advertised-widget-backward.
Richard M. Stallman <rms@gnu.org>
parents:
68343
diff
changeset
|
4415 Move to previous button, link or editable field. \\[advertised-widget-backward] |
68343
05dbd20a248e
(custom-buffer-create-internal): Use widget type
Juri Linkov <juri@jurta.org>
parents:
68278
diff
changeset
|
4416 \\<custom-field-keymap>\ |
19022
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4417 Complete content of editable text field. \\[widget-complete] |
904dcdbb8576
Synched with 1.9951.
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
18856
diff
changeset
|
4418 \\<custom-mode-map>\ |
68913
08407ff48591
* cus-edit.el (custom-mode): Update docstring.
Chong Yidong <cyd@stupidchicken.com>
parents:
68911
diff
changeset
|
4419 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
|
4420 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
|
4421 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
|
4422 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
|
4423 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
|
4424 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
|
4425 Erase customizations; set options |
ece93c7b34d4
(Custom-set, Custom-save): Ask for confirmation.
Richard M. Stallman <rms@gnu.org>
parents:
67961
diff
changeset
|
4426 and buffer text to the standard values. \\[Custom-reset-standard] |
17415 | 4427 |
4428 Entry to this mode calls the value of `custom-mode-hook' | |
4429 if that value is non-nil." | |
4430 (kill-all-local-variables) | |
4431 (setq major-mode 'custom-mode | |
4432 mode-name "Custom") | |
4433 (use-local-map custom-mode-map) | |
18435
2f906938425b
(Custom-set): Renamed from custom-set.
Richard M. Stallman <rms@gnu.org>
parents:
18430
diff
changeset
|
4434 (easy-menu-add Custom-mode-menu) |
17415 | 4435 (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
|
4436 (make-local-variable 'custom-local-buffer) |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4437 (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
|
4438 (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
|
4439 (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
|
4440 (setq widget-button-face custom-button) |
d9a2701e02cd
* cus-edit.el (custom-button, custom-button-pressed): New vars.
Chong Yidong <cyd@stupidchicken.com>
parents:
66171
diff
changeset
|
4441 (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
|
4442 (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
|
4443 |
25685 | 4444 ;; When possible, use relief for buttons, not bracketing. This test |
4445 ;; may not be optimal. | |
4446 (when custom-raised-buttons | |
4447 (set (make-local-variable 'widget-push-button-prefix) "") | |
4448 (set (make-local-variable 'widget-push-button-suffix) "") | |
4449 (set (make-local-variable 'widget-link-prefix) "") | |
4450 (set (make-local-variable 'widget-link-suffix) "")) | |
18437
cbaf72286a2e
(custom-documentation-face): New face.
Richard M. Stallman <rms@gnu.org>
parents:
18436
diff
changeset
|
4451 (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t) |
62722
44ff539fa276
(custom-mode): Use run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents:
62211
diff
changeset
|
4452 (run-mode-hooks 'custom-mode-hook)) |
17334 | 4453 |
32904
2109c5fb0c3f
(custom-mode): Add `special' mode-class property.
Dave Love <fx@gnu.org>
parents:
32883
diff
changeset
|
4454 (put 'custom-mode 'mode-class 'special) |
2109c5fb0c3f
(custom-mode): Add `special' mode-class property.
Dave Love <fx@gnu.org>
parents:
32883
diff
changeset
|
4455 |
28130 | 4456 (add-to-list |
4457 'debug-ignored-errors | |
4458 "^No user options have changed defaults in recent Emacs versions$") | |
4459 | |
17334 | 4460 ;;; The End. |
4461 | |
4462 (provide 'cus-edit) | |
4463 | |
59759
c8a0d09474af
(customize-group-other-window, custom-buffer-create-other-window):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59434
diff
changeset
|
4464 ;; arch-tag: 64533aa4-1b1a-48c3-8812-f9dc718e8a6f |
25685 | 4465 ;;; cus-edit.el ends here |