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