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