Commit | Line | Data |
---|---|---|
1cd7adc6 | 1 | ;;; cus-start.el --- define customization properties of builtins |
1444b0c0 | 2 | ;; |
0d30b337 TTN |
3 | ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, |
4 | ;; 2005 Free Software Foundation, Inc. | |
1444b0c0 PA |
5 | ;; |
6 | ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | |
7 | ;; Keywords: internal | |
8 | ||
c2383d2d RS |
9 | ;; This file is part of GNU Emacs. |
10 | ||
11 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 | ;; it under the terms of the GNU General Public License as published by | |
13 | ;; the Free Software Foundation; either version 2, or (at your option) | |
14 | ;; any later version. | |
15 | ||
16 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;; GNU General Public License for more details. | |
20 | ||
21 | ;; You should have received a copy of the GNU General Public License | |
22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
086add15 LK |
23 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 | ;; Boston, MA 02110-1301, USA. | |
c2383d2d | 25 | |
1444b0c0 PA |
26 | ;;; Commentary: |
27 | ;; | |
4883633e | 28 | ;; This file adds customize support for built-in variables. |
1444b0c0 | 29 | |
4883633e RS |
30 | ;; While dumping Emacs, this file is loaded, but it only records |
31 | ;; the standard values; it does not do the rest of the job. | |
32 | ;; Later on, if the user makes a customization buffer, | |
33 | ;; this file is loaded again with (require 'cus-start); | |
34 | ;; then it does the whole job. | |
1444b0c0 | 35 | |
4883633e | 36 | ;;; Code: |
1444b0c0 | 37 | |
71296446 | 38 | (let ((all '(;; abbrev.c |
1444b0c0 PA |
39 | (abbrev-all-caps abbrev-mode boolean) |
40 | (pre-abbrev-expand-hook abbrev-mode hook) | |
41 | ;; alloc.c | |
42 | (gc-cons-threshold alloc integer) | |
0f014aa1 | 43 | (garbage-collection-messages alloc boolean) |
1444b0c0 PA |
44 | ;; buffer.c |
45 | (mode-line-format modeline sexp) ;Hard to do right. | |
46 | (default-major-mode internal function) | |
924ef223 | 47 | (enable-multibyte-characters mule boolean) |
1444b0c0 PA |
48 | (case-fold-search matching boolean) |
49 | (fill-column fill integer) | |
50 | (left-margin fill integer) | |
51 | (tab-width editing-basics integer) | |
52 | (ctl-arrow display boolean) | |
53 | (truncate-lines display boolean) | |
1444b0c0 | 54 | (selective-display-ellipses display boolean) |
eb94dac6 LT |
55 | (indicate-empty-lines fringe boolean "21.1") |
56 | (indicate-buffer-boundaries | |
57 | fringe | |
58 | (choice | |
59 | (const :tag "No indicators" nil) | |
60 | (const :tag "On left, with arrows" left) | |
61 | (const :tag "On right, with arrows" right) | |
a4fbb790 LT |
62 | (set :tag "Pick your own design" |
63 | :value ((t . nil)) | |
64 | :format "%{%t%}:\n%v\n%d" | |
65 | :doc "You can specify a default and then override it \ | |
66 | for individual indicators. | |
67 | Leaving \"Default\" unchecked is equivalent with specifying a default of | |
68 | \"Do not show\"." | |
69 | (choice :tag "Default" | |
70 | :value (t . nil) | |
71 | (const :tag "Do not show" (t . nil)) | |
72 | (const :tag "On the left" (t . left)) | |
73 | (const :tag "On the right" (t . right))) | |
74 | (choice :tag "Top" | |
75 | :value (top . left) | |
76 | (const :tag "Do not show" (top . nil)) | |
77 | (const :tag "On the left" (top . left)) | |
78 | (const :tag "On the right" (top . right))) | |
79 | (choice :tag "Bottom" | |
80 | :value (bottom . left) | |
81 | (const :tag "Do not show" (bottom . nil)) | |
82 | (const :tag "On the left" (bottom . left)) | |
83 | (const :tag "On the right" (bottom . right))) | |
84 | (choice :tag "Up arrow" | |
85 | :value (up . left) | |
86 | (const :tag "Do not show" (up . nil)) | |
87 | (const :tag "On the left" (up . left)) | |
88 | (const :tag "On the right" (up . right))) | |
89 | (choice :tag "Down arrow" | |
90 | :value (down . left) | |
91 | (const :tag "Do not show" (down . nil)) | |
92 | (const :tag "On the left" (down . left)) | |
93 | (const :tag "On the right" (down . right)))) | |
3233c063 | 94 | (other :tag "On left, no arrows" t)) |
eb94dac6 | 95 | "22.1") |
c6d57325 RS |
96 | (scroll-up-aggressively windows |
97 | (choice (const :tag "off" nil) number) | |
98 | "21.1") | |
99 | (scroll-down-aggressively windows | |
100 | (choice (const :tag "off" nil) number) | |
101 | "21.1") | |
1444b0c0 PA |
102 | ;; callint.c |
103 | (mark-even-if-inactive editing-basics boolean) | |
104 | ;; callproc.c | |
105 | (shell-file-name execute file) | |
106 | (exec-path execute | |
f747a488 | 107 | (repeat (choice (const :tag "default directory" nil) |
72e869ba | 108 | (directory :format "%v")))) |
5fc9eb7c DL |
109 | ;; coding.c |
110 | (inhibit-eol-conversion mule boolean) | |
de0d1fc5 EZ |
111 | (eol-mnemonic-undecided mule string) |
112 | (eol-mnemonic-unix mule string) | |
113 | (eol-mnemonic-dos mule string) | |
114 | (eol-mnemonic-mac mule string) | |
13eb63ff DL |
115 | (file-coding-system-alist |
116 | mule | |
117 | (alist | |
118 | :key-type (regexp :tag "File regexp") | |
119 | :value-type (choice | |
120 | :value (undecided . undecided) | |
121 | (cons :tag "Encoding/decoding pair" | |
122 | :value (undecided . undecided) | |
123 | (coding-system :tag "Decoding") | |
124 | (coding-system :tag "Encoding")) | |
125 | (coding-system :tag "Single coding system" | |
126 | :value undecided) | |
127 | (function :value ignore)))) | |
e5f51929 | 128 | (selection-coding-system mule coding-system) |
1444b0c0 | 129 | ;; dired.c |
71296446 | 130 | (completion-ignored-extensions dired |
1444b0c0 | 131 | (repeat (string :format "%v"))) |
0849a37e | 132 | ;; dispnew.c |
1444b0c0 PA |
133 | (baud-rate display integer) |
134 | (inverse-video display boolean) | |
135 | (visible-bell display boolean) | |
136 | (no-redraw-on-reenter display boolean) | |
137 | ;; editfns.c | |
138 | (user-full-name mail string) | |
139 | ;; eval.c | |
140 | (max-specpdl-size limits integer) | |
141 | (max-lisp-eval-depth limits integer) | |
142 | (stack-trace-on-error debug | |
143 | (choice (const :tag "off") | |
144 | (repeat :menu-tag "When" | |
145 | :value (nil) | |
146 | (symbol :format "%v")) | |
147 | (const :tag "always" t))) | |
71296446 | 148 | (debug-on-error debug |
1444b0c0 PA |
149 | (choice (const :tag "off") |
150 | (repeat :menu-tag "When" | |
151 | :value (nil) | |
152 | (symbol :format "%v")) | |
153 | (const :tag "always" t))) | |
154 | (debug-ignored-errors debug (repeat (choice symbol regexp))) | |
507c9247 RS |
155 | (debug-on-quit debug |
156 | (choice (const :tag "off") | |
157 | (repeat :menu-tag "When" | |
158 | :value (nil) | |
159 | (symbol :format "%v")) | |
160 | (const :tag "always" t))) | |
1444b0c0 PA |
161 | ;; fileio.c |
162 | (insert-default-directory minibuffer boolean) | |
bf247b6e | 163 | (read-file-name-completion-ignore-case minibuffer boolean "22.1") |
78976e0a | 164 | ;; fns.c |
37328bcd | 165 | (use-dialog-box menu boolean "21.1") |
bf247b6e | 166 | (use-file-dialog menu boolean "22.1") |
1444b0c0 PA |
167 | ;; frame.c |
168 | (default-frame-alist frames | |
169 | (repeat (cons :format "%v" | |
170 | (symbol :tag "Parameter") | |
171 | (sexp :tag "Value")))) | |
140fb7ff KS |
172 | (mouse-highlight mouse (choice (const :tag "disabled" nil) |
173 | (const :tag "always shown" t) | |
174 | (other :tag "hidden by keypress" 1))) | |
48d707c5 LT |
175 | ;; fringe.c |
176 | (overflow-newline-into-fringe fringe boolean "22.1") | |
1444b0c0 PA |
177 | ;; indent.c |
178 | (indent-tabs-mode fill boolean) | |
179 | ;; keyboard.c | |
180 | (meta-prefix-char keyboard character) | |
181 | (auto-save-interval auto-save integer) | |
182 | (auto-save-timeout auto-save (choice (const :tag "off" nil) | |
183 | (integer :format "%v"))) | |
ac1b1728 | 184 | (echo-keystrokes minibuffer number) |
1444b0c0 | 185 | (polling-period keyboard integer) |
4db2b1c7 RS |
186 | (double-click-time mouse (restricted-sexp |
187 | :match-alternatives (integerp 'nil 't))) | |
3284b301 | 188 | (double-click-fuzz mouse integer) |
1444b0c0 PA |
189 | (inhibit-local-menu-bar-menus menu boolean) |
190 | (help-char keyboard character) | |
191 | (help-event-list keyboard (repeat (sexp :format "%v"))) | |
192 | (menu-prompting menu boolean) | |
1444b0c0 PA |
193 | (suggest-key-bindings keyboard (choice (const :tag "off" nil) |
194 | (integer :tag "time" 2) | |
79221864 | 195 | (other :tag "on"))) |
5f537e54 | 196 | |
37328bcd DL |
197 | ;; This is not good news because it will use the wrong |
198 | ;; version-specific directories when you upgrade. We need | |
199 | ;; customization of the front of the list, maintaining the standard | |
200 | ;; value intact at the back. | |
71296446 | 201 | ;;; (load-path environment |
37328bcd DL |
202 | ;;; (repeat (choice :tag "[Current dir?]" |
203 | ;;; :format "%[Current dir?%] %v" | |
204 | ;;; (const :tag " current dir" nil) | |
205 | ;;; (directory :format "%v")))) | |
1444b0c0 PA |
206 | ;; minibuf.c |
207 | (completion-auto-help minibuffer boolean) | |
208 | (enable-recursive-minibuffers minibuffer boolean) | |
408f56b2 RS |
209 | (history-length minibuffer |
210 | (choice (const :tag "Infinite" t) | |
211 | integer)) | |
1e64386e | 212 | (history-delete-duplicates minibuffer boolean) |
8f62f2b8 MB |
213 | (minibuffer-prompt-properties |
214 | minibuffer | |
215 | (list | |
216 | (checklist :inline t | |
217 | (const :tag "Read-Only" | |
218 | :doc "Prevent prompt from being modified" | |
219 | :format "%t%n%h" | |
220 | :inline t | |
221 | (read-only t)) | |
c9133fa6 | 222 | (const :tag "Don't Enter" |
8f62f2b8 MB |
223 | :doc "Prevent point from ever entering prompt" |
224 | :format "%t%n%h" | |
225 | :inline t | |
226 | (point-entered minibuffer-avoid-prompt))) | |
227 | (repeat :inline t | |
228 | :tag "Other Properties" | |
229 | (list :inline t | |
230 | :format "%v" | |
231 | (symbol :tag "Property") | |
ecf5279a DL |
232 | (sexp :tag "Value")))) |
233 | "21.1") | |
1444b0c0 | 234 | (minibuffer-auto-raise minibuffer boolean) |
ecf5279a | 235 | ;; options property set at end |
a8a1b05d DL |
236 | (read-buffer-function minibuffer |
237 | (choice (const nil) | |
238 | (function-item iswitchb-read-buffer) | |
239 | function)) | |
b78fba02 EZ |
240 | ;; msdos.c |
241 | (dos-unsupported-char-glyph display integer) | |
1444b0c0 | 242 | ;; process.c |
4883633e | 243 | (delete-exited-processes processes-basics boolean) |
1444b0c0 PA |
244 | ;; syntax.c |
245 | (parse-sexp-ignore-comments editing-basics boolean) | |
246 | (words-include-escapes editing-basics boolean) | |
779d0b80 DL |
247 | (open-paren-in-column-0-is-defun-start editing-basics boolean |
248 | "21.1") | |
0f08b956 LT |
249 | ;; undo.c |
250 | (undo-limit undo integer) | |
251 | (undo-strong-limit undo integer) | |
252 | (undo-outer-limit undo | |
253 | (choice integer | |
254 | (const :tag "No limit" | |
255 | :format "%t\n%d" | |
256 | :doc | |
257 | "With this choice, \ | |
258 | the undo info for the current command never gets discarded. | |
259 | This should only be chosen under exceptional circumstances, | |
260 | since it could result in memory overflow and make Emacs crash." | |
261 | nil)) | |
262 | "22.1") | |
1444b0c0 | 263 | ;; window.c |
4cb464b7 DL |
264 | (temp-buffer-show-function windows (choice (const nil) function)) |
265 | (display-buffer-function windows (choice (const nil) function)) | |
1444b0c0 PA |
266 | (pop-up-frames frames boolean) |
267 | (pop-up-frame-function frames function) | |
71296446 JB |
268 | (special-display-buffer-names |
269 | frames | |
1444b0c0 PA |
270 | (repeat (choice :tag "Buffer" |
271 | :value "" | |
272 | (string :format "%v") | |
273 | (cons :tag "With attributes" | |
274 | :format "%v" | |
275 | :value ("" . nil) | |
276 | (string :format "%v") | |
277 | (repeat :tag "Attributes" | |
278 | (cons :format "%v" | |
279 | (symbol :tag "Parameter") | |
280 | (sexp :tag "Value"))))))) | |
281 | (special-display-regexps | |
71296446 | 282 | frames |
1444b0c0 PA |
283 | (repeat (choice :tag "Buffer" |
284 | :value "" | |
285 | (regexp :format "%v") | |
286 | (cons :tag "With attributes" | |
287 | :format "%v" | |
288 | :value ("" . nil) | |
289 | (regexp :format "%v") | |
290 | (repeat :tag "Attributes" | |
291 | (cons :format "%v" | |
292 | (symbol :tag "Parameter") | |
293 | (sexp :tag "Value"))))))) | |
294 | (special-display-function frames function) | |
295 | (same-window-buffer-names windows (repeat (string :format "%v"))) | |
296 | (same-window-regexps windows (repeat (regexp :format "%v"))) | |
297 | (pop-up-windows windows boolean) | |
d2946490 | 298 | (even-window-heights windows boolean) |
74f54b54 | 299 | (next-screen-context-lines windows integer) |
1444b0c0 PA |
300 | (split-height-threshold windows integer) |
301 | (window-min-height windows integer) | |
302 | (window-min-width windows integer) | |
bcc67965 | 303 | (scroll-preserve-screen-position windows boolean) |
13eb63ff | 304 | (display-buffer-reuse-frames windows boolean "21.1") |
1444b0c0 PA |
305 | ;; xdisp.c |
306 | (scroll-step windows integer) | |
ccbb360e RS |
307 | (scroll-conservatively windows integer) |
308 | (scroll-margin windows integer) | |
8b75db34 EZ |
309 | (hscroll-margin windows integer "21.3") |
310 | (hscroll-step windows number "21.3") | |
1444b0c0 | 311 | (truncate-partial-width-windows display boolean) |
67ee1125 | 312 | (mode-line-inverse-video modeline boolean) |
ec544bdd | 313 | (mode-line-in-non-selected-windows modeline boolean "21.3") |
37328bcd DL |
314 | (line-number-display-limit display |
315 | (choice integer | |
316 | (const :tag "No limit" nil))) | |
779d0b80 | 317 | (line-number-display-limit-width display integer) |
1444b0c0 PA |
318 | (highlight-nonselected-windows display boolean) |
319 | (message-log-max debug (choice (const :tag "Disable" nil) | |
320 | (integer :menu-tag "lines" | |
321 | :format "%v") | |
79221864 | 322 | (other :tag "Unlimited" t))) |
daba3e25 | 323 | (unibyte-display-via-language-environment mule boolean) |
bf247b6e | 324 | (blink-cursor-alist cursor alist "22.1") |
e5f51929 DL |
325 | ;; xfaces.c |
326 | (scalable-fonts-allowed display boolean) | |
1444b0c0 PA |
327 | ;; xfns.c |
328 | (x-bitmap-file-path installation | |
0849a37e | 329 | (repeat (directory :format "%v"))) |
bf247b6e | 330 | (x-use-old-gtk-file-dialog menu boolean "22.1") |
0849a37e | 331 | ;; xterm.c |
e8d9157b | 332 | (mouse-autoselect-window display boolean "21.3") |
e369c773 | 333 | (x-use-underline-position-properties display boolean "21.3") |
37328bcd | 334 | (x-stretch-cursor display boolean "21.1"))) |
a200d998 | 335 | this symbol group type standard version native-p |
4883633e RS |
336 | ;; This function turns a value |
337 | ;; into an expression which produces that value. | |
338 | (quoter (lambda (sexp) | |
339 | (if (or (memq sexp '(t nil)) | |
017266f8 | 340 | (keywordp sexp) |
4883633e RS |
341 | (and (listp sexp) |
342 | (memq (car sexp) '(lambda))) | |
343 | (stringp sexp) | |
37328bcd | 344 | (numberp sexp)) |
4883633e RS |
345 | sexp |
346 | (list 'quote sexp))))) | |
71296446 | 347 | (while all |
1444b0c0 PA |
348 | (setq this (car all) |
349 | all (cdr all) | |
350 | symbol (nth 0 this) | |
351 | group (nth 1 this) | |
00377857 | 352 | type (nth 2 this) |
37328bcd | 353 | version (nth 3 this) |
a200d998 RS |
354 | ;; If we did not specify any standard value expression above, |
355 | ;; use the current value as the standard value. | |
356 | standard (if (nthcdr 4 this) | |
357 | (nth 4 this) | |
720f4c79 | 358 | (when (default-boundp symbol) |
92233e7e | 359 | (funcall quoter (default-value symbol)))) |
00377857 EZ |
360 | ;; Don't complain about missing variables which are |
361 | ;; irrelevant to this platform. | |
362 | native-p (save-match-data | |
363 | (cond | |
364 | ((string-match "\\`dos-" (symbol-name symbol)) | |
365 | (eq system-type 'ms-dos)) | |
366 | ((string-match "\\`w32-" (symbol-name symbol)) | |
367 | (eq system-type 'windows-nt)) | |
2702394e EZ |
368 | ((string-match "\\`x-.*gtk" (symbol-name symbol)) |
369 | (or (boundp 'gtk) (not (eq system-type 'windows-nt)))) | |
197a09bf EZ |
370 | ((string-match "\\`x-" (symbol-name symbol)) |
371 | (fboundp 'x-create-frame)) | |
00377857 | 372 | (t t)))) |
1444b0c0 PA |
373 | (if (not (boundp symbol)) |
374 | ;; If variables are removed from C code, give an error here! | |
00377857 EZ |
375 | (and native-p |
376 | (message "Note, built-in variable `%S' not bound" symbol)) | |
4883633e RS |
377 | ;; Save the standard value, unless we already did. |
378 | (or (get symbol 'standard-value) | |
a200d998 | 379 | (put symbol 'standard-value (list standard))) |
4883633e RS |
380 | ;; If this is NOT while dumping Emacs, |
381 | ;; set up the rest of the customization info. | |
382 | (unless purify-flag | |
383 | ;; Add it to the right group. | |
384 | (custom-add-to-group group symbol 'custom-variable) | |
385 | ;; Set the type. | |
37328bcd DL |
386 | (put symbol 'custom-type type) |
387 | (put symbol 'custom-version version))))) | |
4883633e | 388 | |
ecf5279a | 389 | (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable) |
779d0b80 DL |
390 | (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start |
391 | 'custom-variable) | |
e5f51929 DL |
392 | (put 'selection-coding-system 'custom-set |
393 | (lambda (symbol value) | |
394 | (set-selection-coding-system value) | |
395 | (set symbol value))) | |
ecf5279a | 396 | |
4883633e RS |
397 | ;; Record cus-start as loaded |
398 | ;; if we have set up all the info that we can set up. | |
399 | ;; Don't record cus-start as loaded | |
400 | ;; if we have set up only the standard values. | |
401 | (unless purify-flag | |
402 | (provide 'cus-start)) | |
1444b0c0 | 403 | |
ab5796a9 | 404 | ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60 |
1cd7adc6 | 405 | ;;; cus-start.el ends here |