Update years in copyright notice; nfc.
[bpt/emacs.git] / lisp / cus-start.el
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: internal
8
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
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
25
26 ;;; Commentary:
27 ;;
28 ;; This file adds customize support for built-in variables.
29
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.
35
36 ;;; Code:
37
38 (let ((all '(;; abbrev.c
39 (abbrev-all-caps abbrev-mode boolean)
40 (pre-abbrev-expand-hook abbrev-mode hook)
41 ;; alloc.c
42 (gc-cons-threshold alloc integer)
43 (garbage-collection-messages alloc boolean)
44 ;; buffer.c
45 (mode-line-format modeline sexp) ;Hard to do right.
46 (default-major-mode internal function)
47 (enable-multibyte-characters mule boolean)
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)
54 (selective-display-ellipses display boolean)
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)
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 \
66 for individual indicators.
67 Leaving \"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))))
94 (other :tag "On left, no arrows" t))
95 "22.1")
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")
102 (line-spacing display (choice (const :tag "none" nil) integer))
103 ;; callint.c
104 (mark-even-if-inactive editing-basics boolean)
105 ;; callproc.c
106 (shell-file-name execute file)
107 (exec-path execute
108 (repeat (choice (const :tag "default directory" nil)
109 (directory :format "%v"))))
110 ;; coding.c
111 (inhibit-eol-conversion mule boolean)
112 (eol-mnemonic-undecided mule string)
113 (eol-mnemonic-unix mule string)
114 (eol-mnemonic-dos mule string)
115 (eol-mnemonic-mac mule string)
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))))
129 (selection-coding-system mule coding-system)
130 ;; dired.c
131 (completion-ignored-extensions dired
132 (repeat (string :format "%v")))
133 ;; dispnew.c
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)))
149 (debug-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)))
155 (debug-ignored-errors debug (repeat (choice symbol regexp)))
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)))
162 ;; fileio.c
163 (insert-default-directory minibuffer boolean)
164 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
165 ;; fns.c
166 (use-dialog-box menu boolean "21.1")
167 (use-file-dialog menu boolean "22.1")
168 ;; frame.c
169 (default-frame-alist frames
170 (repeat (cons :format "%v"
171 (symbol :tag "Parameter")
172 (sexp :tag "Value"))))
173 (mouse-highlight mouse (choice (const :tag "disabled" nil)
174 (const :tag "always shown" t)
175 (other :tag "hidden by keypress" 1)))
176 ;; fringe.c
177 (overflow-newline-into-fringe fringe boolean "22.1")
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")))
185 (echo-keystrokes minibuffer number)
186 (polling-period keyboard integer)
187 (double-click-time mouse (restricted-sexp
188 :match-alternatives (integerp 'nil 't)))
189 (double-click-fuzz mouse integer)
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)
194 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
195 (integer :tag "time" 2)
196 (other :tag "on")))
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")
224
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.
229 ;;; (load-path environment
230 ;;; (repeat (choice :tag "[Current dir?]"
231 ;;; :format "%[Current dir?%] %v"
232 ;;; (const :tag " current dir" nil)
233 ;;; (directory :format "%v"))))
234 ;; minibuf.c
235 (completion-auto-help minibuffer boolean)
236 (enable-recursive-minibuffers minibuffer boolean)
237 (history-length minibuffer
238 (choice (const :tag "Infinite" t)
239 integer))
240 (history-delete-duplicates minibuffer boolean)
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))
250 (const :tag "Don't Enter"
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")
260 (sexp :tag "Value"))))
261 "21.1")
262 (minibuffer-auto-raise minibuffer boolean)
263 ;; options property set at end
264 (read-buffer-function minibuffer
265 (choice (const nil)
266 (function-item iswitchb-read-buffer)
267 function))
268 ;; msdos.c
269 (dos-unsupported-char-glyph display integer)
270 ;; process.c
271 (delete-exited-processes processes-basics boolean)
272 ;; syntax.c
273 (parse-sexp-ignore-comments editing-basics boolean)
274 (words-include-escapes editing-basics boolean)
275 (open-paren-in-column-0-is-defun-start editing-basics boolean
276 "21.1")
277 ;; term.c
278 (visible-cursor cursor boolean "22.1")
279 ;; undo.c
280 (undo-limit undo integer)
281 (undo-strong-limit undo integer)
282 (undo-outer-limit undo
283 (choice integer
284 (const :tag "No limit"
285 :format "%t\n%d"
286 :doc
287 "With this choice, \
288 the undo info for the current command never gets discarded.
289 This should only be chosen under exceptional circumstances,
290 since it could result in memory overflow and make Emacs crash."
291 nil))
292 "22.1")
293 ;; window.c
294 (temp-buffer-show-function windows (choice (const nil) function))
295 (display-buffer-function windows (choice (const nil) function))
296 (pop-up-frames frames boolean)
297 (pop-up-frame-function frames function)
298 (special-display-buffer-names
299 frames
300 (repeat (choice :tag "Buffer"
301 :value ""
302 (string :format "%v")
303 (cons :tag "With attributes"
304 :format "%v"
305 :value ("" . nil)
306 (string :format "%v")
307 (repeat :tag "Attributes"
308 (cons :format "%v"
309 (symbol :tag "Parameter")
310 (sexp :tag "Value")))))))
311 (special-display-regexps
312 frames
313 (repeat (choice :tag "Buffer"
314 :value ""
315 (regexp :format "%v")
316 (cons :tag "With attributes"
317 :format "%v"
318 :value ("" . nil)
319 (regexp :format "%v")
320 (repeat :tag "Attributes"
321 (cons :format "%v"
322 (symbol :tag "Parameter")
323 (sexp :tag "Value")))))))
324 (special-display-function frames function)
325 (same-window-buffer-names windows (repeat (string :format "%v")))
326 (same-window-regexps windows (repeat (regexp :format "%v")))
327 (pop-up-windows windows boolean)
328 (even-window-heights windows boolean)
329 (next-screen-context-lines windows integer)
330 (split-height-threshold windows integer)
331 (window-min-height windows integer)
332 (window-min-width windows integer)
333 (scroll-preserve-screen-position windows boolean)
334 (display-buffer-reuse-frames windows boolean "21.1")
335 ;; xdisp.c
336 (scroll-step windows integer)
337 (scroll-conservatively windows integer)
338 (scroll-margin windows integer)
339 (hscroll-margin windows integer "21.3")
340 (hscroll-step windows number "21.3")
341 (truncate-partial-width-windows display boolean)
342 (mode-line-inverse-video modeline boolean)
343 (mode-line-in-non-selected-windows modeline boolean "21.3")
344 (line-number-display-limit display
345 (choice integer
346 (const :tag "No limit" nil)))
347 (line-number-display-limit-width display integer)
348 (highlight-nonselected-windows display boolean)
349 (message-log-max debug (choice (const :tag "Disable" nil)
350 (integer :menu-tag "lines"
351 :format "%v")
352 (other :tag "Unlimited" t)))
353 (unibyte-display-via-language-environment mule boolean)
354 (blink-cursor-alist cursor alist "22.1")
355 ;; xfaces.c
356 (scalable-fonts-allowed display boolean)
357 ;; xfns.c
358 (x-bitmap-file-path installation
359 (repeat (directory :format "%v")))
360 (x-use-old-gtk-file-dialog menu boolean "22.1")
361 (x-gtk-show-hidden-files menu boolean "22.1")
362 ;; xterm.c
363 (mouse-autoselect-window display boolean "21.3")
364 (x-use-underline-position-properties display boolean "21.3")
365 (x-stretch-cursor display boolean "21.1")))
366 this symbol group type standard version native-p
367 ;; This function turns a value
368 ;; into an expression which produces that value.
369 (quoter (lambda (sexp)
370 (if (or (memq sexp '(t nil))
371 (keywordp sexp)
372 (and (listp sexp)
373 (memq (car sexp) '(lambda)))
374 (stringp sexp)
375 (numberp sexp))
376 sexp
377 (list 'quote sexp)))))
378 (while all
379 (setq this (car all)
380 all (cdr all)
381 symbol (nth 0 this)
382 group (nth 1 this)
383 type (nth 2 this)
384 version (nth 3 this)
385 ;; If we did not specify any standard value expression above,
386 ;; use the current value as the standard value.
387 standard (if (nthcdr 4 this)
388 (nth 4 this)
389 (when (default-boundp symbol)
390 (funcall quoter (default-value symbol))))
391 ;; Don't complain about missing variables which are
392 ;; irrelevant to this platform.
393 native-p (save-match-data
394 (cond
395 ((string-match "\\`dos-" (symbol-name symbol))
396 (eq system-type 'ms-dos))
397 ((string-match "\\`w32-" (symbol-name symbol))
398 (eq system-type 'windows-nt))
399 ((string-match "\\`mac-" (symbol-name symbol))
400 (eq window-system 'mac))
401 ((string-match "\\`x-.*gtk" (symbol-name symbol))
402 (or (boundp 'gtk)
403 (and window-system
404 (not (eq window-system 'pc))
405 (not (eq window-system 'mac))
406 (not (eq system-type 'windows-nt)))))
407 ((string-match "\\`x-" (symbol-name symbol))
408 (fboundp 'x-create-frame))
409 ((string-match "selection" (symbol-name symbol))
410 (fboundp 'x-selection-exists-p))
411 ((string-match "fringe" (symbol-name symbol))
412 (fboundp 'define-fringe-bitmap))
413 (t t))))
414 (if (not (boundp symbol))
415 ;; If variables are removed from C code, give an error here!
416 (and native-p
417 (message "Note, built-in variable `%S' not bound" symbol))
418 ;; Save the standard value, unless we already did.
419 (or (get symbol 'standard-value)
420 (put symbol 'standard-value (list standard)))
421 ;; If this is NOT while dumping Emacs,
422 ;; set up the rest of the customization info.
423 (unless purify-flag
424 ;; Add it to the right group.
425 (custom-add-to-group group symbol 'custom-variable)
426 ;; Set the type.
427 (put symbol 'custom-type type)
428 (put symbol 'custom-version version)))))
429
430 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
431 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
432 'custom-variable)
433 (put 'selection-coding-system 'custom-set
434 (lambda (symbol value)
435 (set-selection-coding-system value)
436 (set symbol value)))
437
438 ;; Record cus-start as loaded
439 ;; if we have set up all the info that we can set up.
440 ;; Don't record cus-start as loaded
441 ;; if we have set up only the standard values.
442 (unless purify-flag
443 (provide 'cus-start))
444
445 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
446 ;;; cus-start.el ends here