*** empty log message ***
[bpt/emacs.git] / lisp / cus-start.el
CommitLineData
1cd7adc6 1;;; cus-start.el --- define customization properties of builtins
1444b0c0 2;;
0d30b337 3;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
409cc4a3 4;; 2005, 2006, 2007, 2008 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
b4aa6026 13;; the Free Software Foundation; either version 3, or (at your option)
c2383d2d
RS
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
e047f448 38(let ((all '(;; alloc.c
1444b0c0 39 (gc-cons-threshold alloc integer)
0f014aa1 40 (garbage-collection-messages alloc boolean)
1444b0c0 41 ;; buffer.c
e45db0fb 42 (mode-line-format mode-line sexp) ;Hard to do right.
1444b0c0 43 (default-major-mode internal function)
924ef223 44 (enable-multibyte-characters mule boolean)
1444b0c0
PA
45 (case-fold-search matching boolean)
46 (fill-column fill integer)
47 (left-margin fill integer)
48 (tab-width editing-basics integer)
49 (ctl-arrow display boolean)
50 (truncate-lines display boolean)
1444b0c0 51 (selective-display-ellipses display boolean)
516b77a3 52 (indicate-empty-lines fringe boolean)
eb94dac6
LT
53 (indicate-buffer-boundaries
54 fringe
55 (choice
56 (const :tag "No indicators" nil)
57 (const :tag "On left, with arrows" left)
58 (const :tag "On right, with arrows" right)
a4fbb790
LT
59 (set :tag "Pick your own design"
60 :value ((t . nil))
61 :format "%{%t%}:\n%v\n%d"
62 :doc "You can specify a default and then override it \
63for individual indicators.
64Leaving \"Default\" unchecked is equivalent with specifying a default of
65\"Do not show\"."
66 (choice :tag "Default"
67 :value (t . nil)
68 (const :tag "Do not show" (t . nil))
69 (const :tag "On the left" (t . left))
70 (const :tag "On the right" (t . right)))
71 (choice :tag "Top"
72 :value (top . left)
73 (const :tag "Do not show" (top . nil))
74 (const :tag "On the left" (top . left))
75 (const :tag "On the right" (top . right)))
76 (choice :tag "Bottom"
77 :value (bottom . left)
78 (const :tag "Do not show" (bottom . nil))
79 (const :tag "On the left" (bottom . left))
80 (const :tag "On the right" (bottom . right)))
81 (choice :tag "Up arrow"
82 :value (up . left)
83 (const :tag "Do not show" (up . nil))
84 (const :tag "On the left" (up . left))
85 (const :tag "On the right" (up . right)))
86 (choice :tag "Down arrow"
87 :value (down . left)
88 (const :tag "Do not show" (down . nil))
89 (const :tag "On the left" (down . left))
90 (const :tag "On the right" (down . right))))
516b77a3 91 (other :tag "On left, no arrows" t)))
c6d57325
RS
92 (scroll-up-aggressively windows
93 (choice (const :tag "off" nil) number)
94 "21.1")
95 (scroll-down-aggressively windows
96 (choice (const :tag "off" nil) number)
97 "21.1")
6671cab3
MR
98 (line-spacing display (choice (const :tag "none" nil) integer)
99 "22.1")
1444b0c0
PA
100 ;; callint.c
101 (mark-even-if-inactive editing-basics boolean)
102 ;; callproc.c
103 (shell-file-name execute file)
104 (exec-path execute
f747a488 105 (repeat (choice (const :tag "default directory" nil)
72e869ba 106 (directory :format "%v"))))
5e3097cd 107 ;; charset.c
c11f69e1
KH
108 (charset-map-path installation
109 (repeat (directory :format "%v")))
5fc9eb7c
DL
110 ;; coding.c
111 (inhibit-eol-conversion mule boolean)
de0d1fc5
EZ
112 (eol-mnemonic-undecided mule string)
113 (eol-mnemonic-unix mule string)
114 (eol-mnemonic-dos mule string)
115 (eol-mnemonic-mac mule string)
13eb63ff
DL
116 (file-coding-system-alist
117 mule
118 (alist
119 :key-type (regexp :tag "File regexp")
120 :value-type (choice
121 :value (undecided . undecided)
122 (cons :tag "Encoding/decoding pair"
123 :value (undecided . undecided)
124 (coding-system :tag "Decoding")
125 (coding-system :tag "Encoding"))
70c2811c
KY
126 (coding-system
127 :tag "Single coding system"
128 :value undecided
129 :match (lambda (widget value)
130 (and value (not (functionp value)))))
13eb63ff 131 (function :value ignore))))
1444b0c0 132 ;; dired.c
71296446 133 (completion-ignored-extensions dired
1444b0c0 134 (repeat (string :format "%v")))
0849a37e 135 ;; dispnew.c
1444b0c0
PA
136 (baud-rate display integer)
137 (inverse-video display boolean)
138 (visible-bell display boolean)
139 (no-redraw-on-reenter display boolean)
140 ;; editfns.c
141 (user-full-name mail string)
142 ;; eval.c
143 (max-specpdl-size limits integer)
144 (max-lisp-eval-depth limits integer)
f8add097
RS
145 (max-mini-window-height limits
146 (choice (const :tag "quarter screen" nil)
6671cab3 147 number) "23.1")
1444b0c0
PA
148 (stack-trace-on-error debug
149 (choice (const :tag "off")
150 (repeat :menu-tag "When"
151 :value (nil)
152 (symbol :format "%v"))
153 (const :tag "always" t)))
71296446 154 (debug-on-error debug
1444b0c0
PA
155 (choice (const :tag "off")
156 (repeat :menu-tag "When"
157 :value (nil)
158 (symbol :format "%v"))
159 (const :tag "always" t)))
160 (debug-ignored-errors debug (repeat (choice symbol regexp)))
507c9247
RS
161 (debug-on-quit debug
162 (choice (const :tag "off")
163 (repeat :menu-tag "When"
164 :value (nil)
165 (symbol :format "%v"))
166 (const :tag "always" t)))
1444b0c0
PA
167 ;; fileio.c
168 (insert-default-directory minibuffer boolean)
bf247b6e 169 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
78976e0a 170 ;; fns.c
37328bcd 171 (use-dialog-box menu boolean "21.1")
bf247b6e 172 (use-file-dialog menu boolean "22.1")
f4c307a5 173 (focus-follows-mouse frames boolean "20.3")
1444b0c0
PA
174 ;; frame.c
175 (default-frame-alist frames
176 (repeat (cons :format "%v"
177 (symbol :tag "Parameter")
178 (sexp :tag "Value"))))
140fb7ff
KS
179 (mouse-highlight mouse (choice (const :tag "disabled" nil)
180 (const :tag "always shown" t)
6671cab3
MR
181 (other :tag "hidden by keypress" 1))
182 "22.1")
48d707c5 183 ;; fringe.c
516b77a3 184 (overflow-newline-into-fringe fringe boolean)
1444b0c0 185 ;; indent.c
01892a52 186 (indent-tabs-mode indent boolean)
1444b0c0
PA
187 ;; keyboard.c
188 (meta-prefix-char keyboard character)
189 (auto-save-interval auto-save integer)
190 (auto-save-timeout auto-save (choice (const :tag "off" nil)
191 (integer :format "%v")))
ac1b1728 192 (echo-keystrokes minibuffer number)
1444b0c0 193 (polling-period keyboard integer)
4db2b1c7
RS
194 (double-click-time mouse (restricted-sexp
195 :match-alternatives (integerp 'nil 't)))
6671cab3 196 (double-click-fuzz mouse integer "22.1")
1444b0c0
PA
197 (inhibit-local-menu-bar-menus menu boolean)
198 (help-char keyboard character)
199 (help-event-list keyboard (repeat (sexp :format "%v")))
200 (menu-prompting menu boolean)
1444b0c0
PA
201 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
202 (integer :tag "time" 2)
79221864 203 (other :tag "on")))
2f566b18
YM
204 ;; macselect.c
205 (mac-dnd-known-types mac (repeat string) "22.1")
814b36fe
YM
206 ;; macterm.c
207 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
208 (const control) (const meta)
209 (const alt) (const hyper)
210 (const super)) "22.1")
211 (mac-command-modifier mac (choice (const :tag "No modifier" nil)
212 (const control) (const meta)
213 (const alt) (const hyper)
214 (const super)) "22.1")
215 (mac-option-modifier mac (choice (const :tag "No modifier (work as option)" nil)
216 (const control) (const meta)
217 (const alt) (const hyper)
218 (const super)) "22.1")
219 (mac-function-modifier mac
220 (choice (const :tag "No modifier (work as function)" nil)
221 (const control) (const meta)
222 (const alt) (const hyper)
223 (const super)) "22.1")
224 (mac-emulate-three-button-mouse mac
225 (choice (const :tag "No emulation" nil)
226 (const :tag "Option->2, Command->3" t)
227 (const :tag "Command->2, Option->3" reverse))
228 "22.1")
229 (mac-wheel-button-is-mouse-2 mac boolean "22.1")
230 (mac-pass-command-to-system mac boolean "22.1")
231 (mac-pass-control-to-system mac boolean "22.1")
232 (mac-allow-anti-aliasing mac boolean "22.1")
2d4a5c50
YM
233 (mac-ts-script-language-on-focus mac
234 (choice (const :tag "System default behavior" nil)
235 (const :tag "Restore to script/language used in the last focus frame" t)
236 (cons :tag "Specify script/language"
237 (integer :tag "Script code")
238 (integer :tag "Language code")))
239 "22.1")
5f537e54 240
37328bcd
DL
241;; This is not good news because it will use the wrong
242;; version-specific directories when you upgrade. We need
243;; customization of the front of the list, maintaining the standard
244;; value intact at the back.
71296446 245;;; (load-path environment
37328bcd
DL
246;;; (repeat (choice :tag "[Current dir?]"
247;;; :format "%[Current dir?%] %v"
248;;; (const :tag " current dir" nil)
249;;; (directory :format "%v"))))
1444b0c0
PA
250 ;; minibuf.c
251 (completion-auto-help minibuffer boolean)
252 (enable-recursive-minibuffers minibuffer boolean)
408f56b2 253 (history-length minibuffer
6671cab3
MR
254 (choice (const :tag "Infinite" t) integer)
255 "22.1")
256 (history-delete-duplicates minibuffer boolean "22.1")
8f62f2b8
MB
257 (minibuffer-prompt-properties
258 minibuffer
259 (list
260 (checklist :inline t
261 (const :tag "Read-Only"
262 :doc "Prevent prompt from being modified"
263 :format "%t%n%h"
264 :inline t
265 (read-only t))
c9133fa6 266 (const :tag "Don't Enter"
8f62f2b8
MB
267 :doc "Prevent point from ever entering prompt"
268 :format "%t%n%h"
269 :inline t
270 (point-entered minibuffer-avoid-prompt)))
271 (repeat :inline t
272 :tag "Other Properties"
273 (list :inline t
274 :format "%v"
275 (symbol :tag "Property")
ecf5279a
DL
276 (sexp :tag "Value"))))
277 "21.1")
1444b0c0 278 (minibuffer-auto-raise minibuffer boolean)
ecf5279a 279 ;; options property set at end
a8a1b05d
DL
280 (read-buffer-function minibuffer
281 (choice (const nil)
282 (function-item iswitchb-read-buffer)
283 function))
b78fba02
EZ
284 ;; msdos.c
285 (dos-unsupported-char-glyph display integer)
1444b0c0 286 ;; process.c
4883633e 287 (delete-exited-processes processes-basics boolean)
1444b0c0
PA
288 ;; syntax.c
289 (parse-sexp-ignore-comments editing-basics boolean)
290 (words-include-escapes editing-basics boolean)
6b61353c
KH
291 (open-paren-in-column-0-is-defun-start editing-basics boolean
292 "21.1")
98e071b5
SM
293 ;; term.c
294 (visible-cursor cursor boolean "22.1")
0f08b956
LT
295 ;; undo.c
296 (undo-limit undo integer)
297 (undo-strong-limit undo integer)
298 (undo-outer-limit undo
299 (choice integer
300 (const :tag "No limit"
301 :format "%t\n%d"
302 :doc
303 "With this choice, \
304the undo info for the current command never gets discarded.
305This should only be chosen under exceptional circumstances,
306since it could result in memory overflow and make Emacs crash."
307 nil))
308 "22.1")
1444b0c0 309 ;; window.c
4cb464b7
DL
310 (temp-buffer-show-function windows (choice (const nil) function))
311 (display-buffer-function windows (choice (const nil) function))
1444b0c0
PA
312 (pop-up-frames frames boolean)
313 (pop-up-frame-function frames function)
71296446
JB
314 (special-display-buffer-names
315 frames
1444b0c0
PA
316 (repeat (choice :tag "Buffer"
317 :value ""
318 (string :format "%v")
319 (cons :tag "With attributes"
320 :format "%v"
321 :value ("" . nil)
322 (string :format "%v")
323 (repeat :tag "Attributes"
324 (cons :format "%v"
325 (symbol :tag "Parameter")
326 (sexp :tag "Value")))))))
327 (special-display-regexps
71296446 328 frames
1444b0c0
PA
329 (repeat (choice :tag "Buffer"
330 :value ""
331 (regexp :format "%v")
332 (cons :tag "With attributes"
333 :format "%v"
334 :value ("" . nil)
335 (regexp :format "%v")
336 (repeat :tag "Attributes"
337 (cons :format "%v"
338 (symbol :tag "Parameter")
339 (sexp :tag "Value")))))))
340 (special-display-function frames function)
341 (same-window-buffer-names windows (repeat (string :format "%v")))
342 (same-window-regexps windows (repeat (regexp :format "%v")))
343 (pop-up-windows windows boolean)
d2946490 344 (even-window-heights windows boolean)
74f54b54 345 (next-screen-context-lines windows integer)
1444b0c0 346 (split-height-threshold windows integer)
c8f1ea76
SM
347 (split-window-preferred-function
348 windows
f1917c6f 349 (choice (const :tag "vertically" nil)
c8f1ea76
SM
350 ;; FIXME: Add `sensibly' which chooses between
351 ;; vertical or horizontal splits depending on the size
352 ;; and shape of the window.
353 (const :tag "horizontally"
f1917c6f 354 split-window-preferred-horizontally))
6671cab3 355 "23.1")
1444b0c0
PA
356 (window-min-height windows integer)
357 (window-min-width windows integer)
7704b6b1
KS
358 (scroll-preserve-screen-position
359 windows (choice
360 (const :tag "Off (nil)" :value nil)
361 (const :tag "Full screen (t)" :value t)
6671cab3 362 (other :tag "Always" 1)) "22.1")
13eb63ff 363 (display-buffer-reuse-frames windows boolean "21.1")
1444b0c0
PA
364 ;; xdisp.c
365 (scroll-step windows integer)
ccbb360e
RS
366 (scroll-conservatively windows integer)
367 (scroll-margin windows integer)
4e371ce8
EZ
368 (hscroll-margin windows integer "22.1")
369 (hscroll-step windows number "22.1")
1444b0c0 370 (truncate-partial-width-windows display boolean)
e45db0fb
MR
371 (mode-line-inverse-video mode-line boolean)
372 (mode-line-in-non-selected-windows mode-line boolean "22.1")
37328bcd
DL
373 (line-number-display-limit display
374 (choice integer
375 (const :tag "No limit" nil)))
6671cab3 376 (line-number-display-limit-width display integer "22.1")
1444b0c0
PA
377 (highlight-nonselected-windows display boolean)
378 (message-log-max debug (choice (const :tag "Disable" nil)
379 (integer :menu-tag "lines"
380 :format "%v")
79221864 381 (other :tag "Unlimited" t)))
daba3e25 382 (unibyte-display-via-language-environment mule boolean)
bf247b6e 383 (blink-cursor-alist cursor alist "22.1")
03c25271 384 (overline-margin display integer "22.1")
612c16f1
CY
385 (mouse-autoselect-window
386 display (choice
387 (const :tag "Off (nil)" :value nil)
388 (const :tag "Immediate" :value t)
389 (number :tag "Delay by secs" :value 0.5)) "22.1")
e5f51929 390 ;; xfaces.c
6671cab3 391 (scalable-fonts-allowed display boolean "22.1")
1444b0c0
PA
392 ;; xfns.c
393 (x-bitmap-file-path installation
0849a37e 394 (repeat (directory :format "%v")))
c4823934 395 (x-gtk-use-old-file-dialog menu boolean "22.1")
91b5a204 396 (x-gtk-show-hidden-files menu boolean "22.1")
c4823934 397 (x-gtk-file-dialog-help-text menu boolean "22.1")
0dd95b49 398 (x-gtk-whole-detached-tool-bar x boolean "22.1")
0849a37e 399 ;; xterm.c
4e371ce8 400 (x-use-underline-position-properties display boolean "22.1")
03c25271 401 (x-underline-at-descent-line display boolean "22.1")
37328bcd 402 (x-stretch-cursor display boolean "21.1")))
a200d998 403 this symbol group type standard version native-p
4883633e
RS
404 ;; This function turns a value
405 ;; into an expression which produces that value.
406 (quoter (lambda (sexp)
407 (if (or (memq sexp '(t nil))
017266f8 408 (keywordp sexp)
4883633e
RS
409 (and (listp sexp)
410 (memq (car sexp) '(lambda)))
411 (stringp sexp)
37328bcd 412 (numberp sexp))
4883633e
RS
413 sexp
414 (list 'quote sexp)))))
71296446 415 (while all
1444b0c0
PA
416 (setq this (car all)
417 all (cdr all)
418 symbol (nth 0 this)
419 group (nth 1 this)
00377857 420 type (nth 2 this)
37328bcd 421 version (nth 3 this)
a200d998
RS
422 ;; If we did not specify any standard value expression above,
423 ;; use the current value as the standard value.
424 standard (if (nthcdr 4 this)
425 (nth 4 this)
720f4c79 426 (when (default-boundp symbol)
92233e7e 427 (funcall quoter (default-value symbol))))
00377857
EZ
428 ;; Don't complain about missing variables which are
429 ;; irrelevant to this platform.
430 native-p (save-match-data
431 (cond
432 ((string-match "\\`dos-" (symbol-name symbol))
433 (eq system-type 'ms-dos))
434 ((string-match "\\`w32-" (symbol-name symbol))
435 (eq system-type 'windows-nt))
feba0cd6 436 ((string-match "\\`mac-" (symbol-name symbol))
ce00d093 437 (featurep 'mac-carbon))
2702394e 438 ((string-match "\\`x-.*gtk" (symbol-name symbol))
79cf2123 439 (featurep 'gtk))
197a09bf
EZ
440 ((string-match "\\`x-" (symbol-name symbol))
441 (fboundp 'x-create-frame))
6eb33acb
EZ
442 ((string-match "selection" (symbol-name symbol))
443 (fboundp 'x-selection-exists-p))
444 ((string-match "fringe" (symbol-name symbol))
445 (fboundp 'define-fringe-bitmap))
00377857 446 (t t))))
1444b0c0
PA
447 (if (not (boundp symbol))
448 ;; If variables are removed from C code, give an error here!
00377857
EZ
449 (and native-p
450 (message "Note, built-in variable `%S' not bound" symbol))
4883633e
RS
451 ;; Save the standard value, unless we already did.
452 (or (get symbol 'standard-value)
a200d998 453 (put symbol 'standard-value (list standard)))
4883633e
RS
454 ;; If this is NOT while dumping Emacs,
455 ;; set up the rest of the customization info.
456 (unless purify-flag
457 ;; Add it to the right group.
458 (custom-add-to-group group symbol 'custom-variable)
459 ;; Set the type.
37328bcd
DL
460 (put symbol 'custom-type type)
461 (put symbol 'custom-version version)))))
4883633e 462
ecf5279a 463(custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
6b61353c
KH
464(custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
465 'custom-variable)
ecf5279a 466
4883633e
RS
467;; Record cus-start as loaded
468;; if we have set up all the info that we can set up.
469;; Don't record cus-start as loaded
470;; if we have set up only the standard values.
471(unless purify-flag
472 (provide 'cus-start))
1444b0c0 473
c8f1ea76 474;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
1cd7adc6 475;;; cus-start.el ends here