Fix typos.
[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,
ae940284 4;; 2005, 2006, 2007, 2008, 2009 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
eb3fa2cf 11;; GNU Emacs is free software: you can redistribute it and/or modify
c2383d2d 12;; it under the terms of the GNU General Public License as published by
eb3fa2cf
GM
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
c2383d2d
RS
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
eb3fa2cf 22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
c2383d2d 23
1444b0c0
PA
24;;; Commentary:
25;;
4883633e 26;; This file adds customize support for built-in variables.
1444b0c0 27
4883633e
RS
28;; While dumping Emacs, this file is loaded, but it only records
29;; the standard values; it does not do the rest of the job.
30;; Later on, if the user makes a customization buffer,
31;; this file is loaded again with (require 'cus-start);
32;; then it does the whole job.
1444b0c0 33
4883633e 34;;; Code:
1444b0c0 35
e047f448 36(let ((all '(;; alloc.c
1444b0c0 37 (gc-cons-threshold alloc integer)
0f014aa1 38 (garbage-collection-messages alloc boolean)
1444b0c0 39 ;; buffer.c
e45db0fb 40 (mode-line-format mode-line sexp) ;Hard to do right.
1444b0c0 41 (default-major-mode internal function)
924ef223 42 (enable-multibyte-characters mule boolean)
1444b0c0
PA
43 (case-fold-search matching boolean)
44 (fill-column fill integer)
45 (left-margin fill integer)
46 (tab-width editing-basics integer)
47 (ctl-arrow display boolean)
48 (truncate-lines display boolean)
84975bbe 49 (word-wrap display boolean)
1444b0c0 50 (selective-display-ellipses display boolean)
516b77a3 51 (indicate-empty-lines fringe boolean)
eb94dac6
LT
52 (indicate-buffer-boundaries
53 fringe
54 (choice
55 (const :tag "No indicators" nil)
56 (const :tag "On left, with arrows" left)
57 (const :tag "On right, with arrows" right)
a4fbb790
LT
58 (set :tag "Pick your own design"
59 :value ((t . nil))
60 :format "%{%t%}:\n%v\n%d"
61 :doc "You can specify a default and then override it \
62for individual indicators.
63Leaving \"Default\" unchecked is equivalent with specifying a default of
64\"Do not show\"."
65 (choice :tag "Default"
66 :value (t . nil)
67 (const :tag "Do not show" (t . nil))
68 (const :tag "On the left" (t . left))
69 (const :tag "On the right" (t . right)))
70 (choice :tag "Top"
71 :value (top . left)
72 (const :tag "Do not show" (top . nil))
73 (const :tag "On the left" (top . left))
74 (const :tag "On the right" (top . right)))
75 (choice :tag "Bottom"
76 :value (bottom . left)
77 (const :tag "Do not show" (bottom . nil))
78 (const :tag "On the left" (bottom . left))
79 (const :tag "On the right" (bottom . right)))
80 (choice :tag "Up arrow"
81 :value (up . left)
82 (const :tag "Do not show" (up . nil))
83 (const :tag "On the left" (up . left))
84 (const :tag "On the right" (up . right)))
85 (choice :tag "Down arrow"
86 :value (down . left)
87 (const :tag "Do not show" (down . nil))
88 (const :tag "On the left" (down . left))
89 (const :tag "On the right" (down . right))))
516b77a3 90 (other :tag "On left, no arrows" t)))
c6d57325
RS
91 (scroll-up-aggressively windows
92 (choice (const :tag "off" nil) number)
93 "21.1")
94 (scroll-down-aggressively windows
95 (choice (const :tag "off" nil) number)
96 "21.1")
6671cab3
MR
97 (line-spacing display (choice (const :tag "none" nil) integer)
98 "22.1")
1444b0c0
PA
99 ;; callint.c
100 (mark-even-if-inactive editing-basics boolean)
84975bbe 101 (shift-select-mode editing-basics boolean)
1444b0c0
PA
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)))
6cf29fe8
JR
167 ;; fileio.c
168 (delete-by-moving-to-trash auto-save boolean "23.1")
6ba7a6f0 169 (auto-save-visited-file-name auto-save boolean)
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")))
5f537e54 204
37328bcd
DL
205;; This is not good news because it will use the wrong
206;; version-specific directories when you upgrade. We need
207;; customization of the front of the list, maintaining the standard
208;; value intact at the back.
71296446 209;;; (load-path environment
37328bcd
DL
210;;; (repeat (choice :tag "[Current dir?]"
211;;; :format "%[Current dir?%] %v"
212;;; (const :tag " current dir" nil)
213;;; (directory :format "%v"))))
1444b0c0 214 ;; minibuf.c
1444b0c0 215 (enable-recursive-minibuffers minibuffer boolean)
408f56b2 216 (history-length minibuffer
6671cab3
MR
217 (choice (const :tag "Infinite" t) integer)
218 "22.1")
219 (history-delete-duplicates minibuffer boolean "22.1")
ed278e5d
CY
220 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
221
8f62f2b8
MB
222 (minibuffer-prompt-properties
223 minibuffer
224 (list
225 (checklist :inline t
226 (const :tag "Read-Only"
227 :doc "Prevent prompt from being modified"
228 :format "%t%n%h"
229 :inline t
230 (read-only t))
c9133fa6 231 (const :tag "Don't Enter"
8f62f2b8
MB
232 :doc "Prevent point from ever entering prompt"
233 :format "%t%n%h"
234 :inline t
235 (point-entered minibuffer-avoid-prompt)))
236 (repeat :inline t
237 :tag "Other Properties"
238 (list :inline t
239 :format "%v"
240 (symbol :tag "Property")
ecf5279a
DL
241 (sexp :tag "Value"))))
242 "21.1")
1444b0c0 243 (minibuffer-auto-raise minibuffer boolean)
ecf5279a 244 ;; options property set at end
a8a1b05d
DL
245 (read-buffer-function minibuffer
246 (choice (const nil)
247 (function-item iswitchb-read-buffer)
248 function))
b78fba02
EZ
249 ;; msdos.c
250 (dos-unsupported-char-glyph display integer)
bc9ebf41
DR
251 ;; nsterm.m
252 (ns-control-modifier
253 nextstep
254 (choice (const :tag "No modifier" nil)
255 (const control) (const meta)
256 (const alt) (const hyper)
257 (const super)) "23.1")
258 (ns-command-modifier
259 nextstep
260 (choice (const :tag "No modifier" nil)
261 (const control) (const meta)
262 (const alt) (const hyper)
263 (const super)) "23.1")
264 (ns-alternate-modifier
265 nextstep
266 (choice (const :tag "No modifier (work as alternate/option)" none)
267 (const control) (const meta)
268 (const alt) (const hyper)
269 (const super)) "23.1")
270 (ns-function-modifier
271 nextstep
272 (choice (const :tag "No modifier (work as function)" none)
273 (const control) (const meta)
274 (const alt) (const hyper)
275 (const super)) "23.1")
276 (ns-antialias-text ns boolean "23.1")
277 (ns-use-qd-smoothing ns boolean "23.1")
1444b0c0 278 ;; process.c
4883633e 279 (delete-exited-processes processes-basics boolean)
1444b0c0
PA
280 ;; syntax.c
281 (parse-sexp-ignore-comments editing-basics boolean)
282 (words-include-escapes editing-basics boolean)
6b61353c
KH
283 (open-paren-in-column-0-is-defun-start editing-basics boolean
284 "21.1")
98e071b5
SM
285 ;; term.c
286 (visible-cursor cursor boolean "22.1")
0f08b956
LT
287 ;; undo.c
288 (undo-limit undo integer)
289 (undo-strong-limit undo integer)
290 (undo-outer-limit undo
291 (choice integer
292 (const :tag "No limit"
293 :format "%t\n%d"
294 :doc
295 "With this choice, \
296the undo info for the current command never gets discarded.
297This should only be chosen under exceptional circumstances,
298since it could result in memory overflow and make Emacs crash."
299 nil))
300 "22.1")
1444b0c0 301 ;; window.c
4cb464b7 302 (temp-buffer-show-function windows (choice (const nil) function))
74f54b54 303 (next-screen-context-lines windows integer)
1444b0c0
PA
304 (window-min-height windows integer)
305 (window-min-width windows integer)
7704b6b1
KS
306 (scroll-preserve-screen-position
307 windows (choice
308 (const :tag "Off (nil)" :value nil)
309 (const :tag "Full screen (t)" :value t)
6671cab3 310 (other :tag "Always" 1)) "22.1")
1444b0c0
PA
311 ;; xdisp.c
312 (scroll-step windows integer)
ccbb360e
RS
313 (scroll-conservatively windows integer)
314 (scroll-margin windows integer)
4e371ce8
EZ
315 (hscroll-margin windows integer "22.1")
316 (hscroll-step windows number "22.1")
3a66cc91 317 (truncate-partial-width-windows display boolean "23.1")
e45db0fb
MR
318 (mode-line-inverse-video mode-line boolean)
319 (mode-line-in-non-selected-windows mode-line boolean "22.1")
37328bcd
DL
320 (line-number-display-limit display
321 (choice integer
322 (const :tag "No limit" nil)))
6671cab3 323 (line-number-display-limit-width display integer "22.1")
1444b0c0
PA
324 (highlight-nonselected-windows display boolean)
325 (message-log-max debug (choice (const :tag "Disable" nil)
326 (integer :menu-tag "lines"
327 :format "%v")
79221864 328 (other :tag "Unlimited" t)))
daba3e25 329 (unibyte-display-via-language-environment mule boolean)
bf247b6e 330 (blink-cursor-alist cursor alist "22.1")
03c25271 331 (overline-margin display integer "22.1")
2a3bd2e1 332 (underline-minimum-offset display integer "23.1")
612c16f1
CY
333 (mouse-autoselect-window
334 display (choice
335 (const :tag "Off (nil)" :value nil)
336 (const :tag "Immediate" :value t)
337 (number :tag "Delay by secs" :value 0.5)) "22.1")
e5f51929 338 ;; xfaces.c
6671cab3 339 (scalable-fonts-allowed display boolean "22.1")
1444b0c0
PA
340 ;; xfns.c
341 (x-bitmap-file-path installation
0849a37e 342 (repeat (directory :format "%v")))
c4823934 343 (x-gtk-use-old-file-dialog menu boolean "22.1")
91b5a204 344 (x-gtk-show-hidden-files menu boolean "22.1")
c4823934 345 (x-gtk-file-dialog-help-text menu boolean "22.1")
0dd95b49 346 (x-gtk-whole-detached-tool-bar x boolean "22.1")
0849a37e 347 ;; xterm.c
4e371ce8 348 (x-use-underline-position-properties display boolean "22.1")
03c25271 349 (x-underline-at-descent-line display boolean "22.1")
37328bcd 350 (x-stretch-cursor display boolean "21.1")))
a200d998 351 this symbol group type standard version native-p
4883633e
RS
352 ;; This function turns a value
353 ;; into an expression which produces that value.
354 (quoter (lambda (sexp)
355 (if (or (memq sexp '(t nil))
017266f8 356 (keywordp sexp)
4883633e
RS
357 (and (listp sexp)
358 (memq (car sexp) '(lambda)))
359 (stringp sexp)
37328bcd 360 (numberp sexp))
4883633e
RS
361 sexp
362 (list 'quote sexp)))))
71296446 363 (while all
1444b0c0
PA
364 (setq this (car all)
365 all (cdr all)
366 symbol (nth 0 this)
367 group (nth 1 this)
00377857 368 type (nth 2 this)
37328bcd 369 version (nth 3 this)
a200d998
RS
370 ;; If we did not specify any standard value expression above,
371 ;; use the current value as the standard value.
372 standard (if (nthcdr 4 this)
373 (nth 4 this)
720f4c79 374 (when (default-boundp symbol)
92233e7e 375 (funcall quoter (default-value symbol))))
00377857
EZ
376 ;; Don't complain about missing variables which are
377 ;; irrelevant to this platform.
378 native-p (save-match-data
379 (cond
380 ((string-match "\\`dos-" (symbol-name symbol))
381 (eq system-type 'ms-dos))
382 ((string-match "\\`w32-" (symbol-name symbol))
383 (eq system-type 'windows-nt))
2702394e 384 ((string-match "\\`x-.*gtk" (symbol-name symbol))
79cf2123 385 (featurep 'gtk))
197a09bf
EZ
386 ((string-match "\\`x-" (symbol-name symbol))
387 (fboundp 'x-create-frame))
6eb33acb
EZ
388 ((string-match "selection" (symbol-name symbol))
389 (fboundp 'x-selection-exists-p))
390 ((string-match "fringe" (symbol-name symbol))
391 (fboundp 'define-fringe-bitmap))
00377857 392 (t t))))
1444b0c0
PA
393 (if (not (boundp symbol))
394 ;; If variables are removed from C code, give an error here!
00377857
EZ
395 (and native-p
396 (message "Note, built-in variable `%S' not bound" symbol))
4883633e
RS
397 ;; Save the standard value, unless we already did.
398 (or (get symbol 'standard-value)
a200d998 399 (put symbol 'standard-value (list standard)))
4883633e
RS
400 ;; If this is NOT while dumping Emacs,
401 ;; set up the rest of the customization info.
402 (unless purify-flag
403 ;; Add it to the right group.
404 (custom-add-to-group group symbol 'custom-variable)
405 ;; Set the type.
37328bcd
DL
406 (put symbol 'custom-type type)
407 (put symbol 'custom-version version)))))
4883633e 408
ecf5279a 409(custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
6b61353c
KH
410(custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
411 'custom-variable)
ecf5279a 412
4883633e
RS
413;; Record cus-start as loaded
414;; if we have set up all the info that we can set up.
415;; Don't record cus-start as loaded
416;; if we have set up only the standard values.
417(unless purify-flag
418 (provide 'cus-start))
1444b0c0 419
c8f1ea76 420;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
1cd7adc6 421;;; cus-start.el ends here