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