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