(all): Add `undo-outer-limit'.
[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 Free Software Foundation, Inc.
4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: internal
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26 ;;
27 ;; This file adds customize support for built-in variables.
28
29 ;; While dumping Emacs, this file is loaded, but it only records
30 ;; the standard values; it does not do the rest of the job.
31 ;; Later on, if the user makes a customization buffer,
32 ;; this file is loaded again with (require 'cus-start);
33 ;; then it does the whole job.
34
35 ;;; Code:
36
37 (let ((all '(;; abbrev.c
38 (abbrev-all-caps abbrev-mode boolean)
39 (pre-abbrev-expand-hook abbrev-mode hook)
40 ;; alloc.c
41 (gc-cons-threshold alloc integer)
42 (undo-limit undo integer)
43 (undo-strong-limit undo integer)
44 (undo-outer-limit undo
45 (choice integer
46 (const :tag "No limit"
47 :format "%t\n%d"
48 :doc
49 "With this choice, \
50 the undo info for the current command never gets discarded.
51 This should only be chosen under exceptional circumstances,
52 since it could result in memory overflow and make Emacs crash."
53 nil))
54 "21.4")
55 (garbage-collection-messages alloc boolean)
56 ;; buffer.c
57 (mode-line-format modeline sexp) ;Hard to do right.
58 (default-major-mode internal function)
59 (enable-multibyte-characters mule boolean)
60 (case-fold-search matching boolean)
61 (fill-column fill integer)
62 (left-margin fill integer)
63 (tab-width editing-basics integer)
64 (ctl-arrow display boolean)
65 (truncate-lines display boolean)
66 (selective-display-ellipses display boolean)
67 (indicate-empty-lines display boolean "21.1")
68 (scroll-up-aggressively windows
69 (choice (const :tag "off" nil) number)
70 "21.1")
71 (scroll-down-aggressively windows
72 (choice (const :tag "off" nil) number)
73 "21.1")
74 ;; callint.c
75 (mark-even-if-inactive editing-basics boolean)
76 ;; callproc.c
77 (shell-file-name execute file)
78 (exec-path execute
79 (repeat (choice (const :tag "default" nil)
80 (file :format "%v"))))
81 ;; coding.c
82 (inhibit-eol-conversion mule boolean)
83 (eol-mnemonic-undecided mule string)
84 (eol-mnemonic-unix mule string)
85 (eol-mnemonic-dos mule string)
86 (eol-mnemonic-mac mule string)
87 (file-coding-system-alist
88 mule
89 (alist
90 :key-type (regexp :tag "File regexp")
91 :value-type (choice
92 :value (undecided . undecided)
93 (cons :tag "Encoding/decoding pair"
94 :value (undecided . undecided)
95 (coding-system :tag "Decoding")
96 (coding-system :tag "Encoding"))
97 (coding-system :tag "Single coding system"
98 :value undecided)
99 (function :value ignore))))
100 (selection-coding-system mule coding-system)
101 ;; dired.c
102 (completion-ignored-extensions dired
103 (repeat (string :format "%v")))
104 ;; dispnew.c
105 (baud-rate display integer)
106 (inverse-video display boolean)
107 (visible-bell display boolean)
108 (no-redraw-on-reenter display boolean)
109 ;; editfns.c
110 (user-full-name mail string)
111 ;; eval.c
112 (max-specpdl-size limits integer)
113 (max-lisp-eval-depth limits integer)
114 (stack-trace-on-error debug
115 (choice (const :tag "off")
116 (repeat :menu-tag "When"
117 :value (nil)
118 (symbol :format "%v"))
119 (const :tag "always" t)))
120 (debug-on-error debug
121 (choice (const :tag "off")
122 (repeat :menu-tag "When"
123 :value (nil)
124 (symbol :format "%v"))
125 (const :tag "always" t)))
126 (debug-ignored-errors debug (repeat (choice symbol regexp)))
127 (debug-on-quit debug
128 (choice (const :tag "off")
129 (repeat :menu-tag "When"
130 :value (nil)
131 (symbol :format "%v"))
132 (const :tag "always" t)))
133 ;; fileio.c
134 (insert-default-directory minibuffer boolean)
135 (read-file-name-completion-ignore-case minibuffer boolean "21.4")
136 ;; fns.c
137 (use-dialog-box menu boolean "21.1")
138 (use-file-dialog menu boolean "21.4")
139 ;; frame.c
140 (default-frame-alist frames
141 (repeat (cons :format "%v"
142 (symbol :tag "Parameter")
143 (sexp :tag "Value"))))
144 (mouse-highlight mouse (choice (const :tag "disabled" nil)
145 (const :tag "always shown" t)
146 (other :tag "hidden by keypress" 1)))
147 ;; indent.c
148 (indent-tabs-mode fill boolean)
149 ;; keyboard.c
150 (meta-prefix-char keyboard character)
151 (auto-save-interval auto-save integer)
152 (auto-save-timeout auto-save (choice (const :tag "off" nil)
153 (integer :format "%v")))
154 (echo-keystrokes minibuffer number)
155 (polling-period keyboard integer)
156 (double-click-time mouse (restricted-sexp
157 :match-alternatives (integerp 'nil 't)))
158 (double-click-fuzz mouse integer)
159 (inhibit-local-menu-bar-menus menu boolean)
160 (help-char keyboard character)
161 (help-event-list keyboard (repeat (sexp :format "%v")))
162 (menu-prompting menu boolean)
163 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
164 (integer :tag "time" 2)
165 (other :tag "on")))
166
167 ;; This is not good news because it will use the wrong
168 ;; version-specific directories when you upgrade. We need
169 ;; customization of the front of the list, maintaining the standard
170 ;; value intact at the back.
171 ;;; (load-path environment
172 ;;; (repeat (choice :tag "[Current dir?]"
173 ;;; :format "%[Current dir?%] %v"
174 ;;; (const :tag " current dir" nil)
175 ;;; (directory :format "%v"))))
176 ;; minibuf.c
177 (completion-auto-help minibuffer boolean)
178 (enable-recursive-minibuffers minibuffer boolean)
179 (history-length minibuffer
180 (choice (const :tag "Infinite" t)
181 integer))
182 (history-delete-duplicates minibuffer boolean)
183 (minibuffer-prompt-properties
184 minibuffer
185 (list
186 (checklist :inline t
187 (const :tag "Read-Only"
188 :doc "Prevent prompt from being modified"
189 :format "%t%n%h"
190 :inline t
191 (read-only t))
192 (const :tag "Inviolable"
193 :doc "Prevent point from ever entering prompt"
194 :format "%t%n%h"
195 :inline t
196 (point-entered minibuffer-avoid-prompt)))
197 (repeat :inline t
198 :tag "Other Properties"
199 (list :inline t
200 :format "%v"
201 (symbol :tag "Property")
202 (sexp :tag "Value"))))
203 "21.1")
204 (minibuffer-auto-raise minibuffer boolean)
205 ;; options property set at end
206 (read-buffer-function minibuffer
207 (choice (const nil)
208 (function-item iswitchb-read-buffer)
209 function))
210 ;; msdos.c
211 (dos-unsupported-char-glyph display integer)
212 ;; process.c
213 (delete-exited-processes processes-basics boolean)
214 ;; syntax.c
215 (parse-sexp-ignore-comments editing-basics boolean)
216 (words-include-escapes editing-basics boolean)
217 (open-paren-in-column-0-is-defun-start editing-basics boolean
218 "21.1")
219 ;; window.c
220 (temp-buffer-show-function windows (choice (const nil) function))
221 (display-buffer-function windows (choice (const nil) function))
222 (pop-up-frames frames boolean)
223 (pop-up-frame-function frames function)
224 (special-display-buffer-names
225 frames
226 (repeat (choice :tag "Buffer"
227 :value ""
228 (string :format "%v")
229 (cons :tag "With attributes"
230 :format "%v"
231 :value ("" . nil)
232 (string :format "%v")
233 (repeat :tag "Attributes"
234 (cons :format "%v"
235 (symbol :tag "Parameter")
236 (sexp :tag "Value")))))))
237 (special-display-regexps
238 frames
239 (repeat (choice :tag "Buffer"
240 :value ""
241 (regexp :format "%v")
242 (cons :tag "With attributes"
243 :format "%v"
244 :value ("" . nil)
245 (regexp :format "%v")
246 (repeat :tag "Attributes"
247 (cons :format "%v"
248 (symbol :tag "Parameter")
249 (sexp :tag "Value")))))))
250 (special-display-function frames function)
251 (same-window-buffer-names windows (repeat (string :format "%v")))
252 (same-window-regexps windows (repeat (regexp :format "%v")))
253 (pop-up-windows windows boolean)
254 (even-window-heights windows boolean)
255 (next-screen-context-lines windows integer)
256 (split-height-threshold windows integer)
257 (window-min-height windows integer)
258 (window-min-width windows integer)
259 (scroll-preserve-screen-position windows boolean)
260 (display-buffer-reuse-frames windows boolean "21.1")
261 ;; xdisp.c
262 (scroll-step windows integer)
263 (scroll-conservatively windows integer)
264 (scroll-margin windows integer)
265 (hscroll-margin windows integer "21.3")
266 (hscroll-step windows number "21.3")
267 (truncate-partial-width-windows display boolean)
268 (mode-line-inverse-video modeline boolean)
269 (mode-line-in-non-selected-windows modeline boolean "21.3")
270 (line-number-display-limit display
271 (choice integer
272 (const :tag "No limit" nil)))
273 (line-number-display-limit-width display integer)
274 (highlight-nonselected-windows display boolean)
275 (message-log-max debug (choice (const :tag "Disable" nil)
276 (integer :menu-tag "lines"
277 :format "%v")
278 (other :tag "Unlimited" t)))
279 (unibyte-display-via-language-environment mule boolean)
280 (blink-cursor-alist cursor alist "21.4")
281 ;; xfaces.c
282 (scalable-fonts-allowed display boolean)
283 ;; xfns.c
284 (x-bitmap-file-path installation
285 (repeat (directory :format "%v")))
286 (x-use-old-gtk-file-dialog menu boolean "21.4")
287 ;; xterm.c
288 (mouse-autoselect-window display boolean "21.3")
289 (x-use-underline-position-properties display boolean "21.3")
290 (x-stretch-cursor display boolean "21.1")))
291 this symbol group type native-p version
292 ;; This function turns a value
293 ;; into an expression which produces that value.
294 (quoter (lambda (sexp)
295 (if (or (memq sexp '(t nil))
296 (keywordp sexp)
297 (and (listp sexp)
298 (memq (car sexp) '(lambda)))
299 (stringp sexp)
300 ;; (and (fboundp 'characterp)
301 ;; (characterp sexp))
302 (numberp sexp))
303 sexp
304 (list 'quote sexp)))))
305 (while all
306 (setq this (car all)
307 all (cdr all)
308 symbol (nth 0 this)
309 group (nth 1 this)
310 type (nth 2 this)
311 version (nth 3 this)
312 ;; Don't complain about missing variables which are
313 ;; irrelevant to this platform.
314 native-p (save-match-data
315 (cond
316 ((string-match "\\`dos-" (symbol-name symbol))
317 (eq system-type 'ms-dos))
318 ((string-match "\\`w32-" (symbol-name symbol))
319 (eq system-type 'windows-nt))
320 ((string-match "\\`x-" (symbol-name symbol))
321 (fboundp 'x-create-frame))
322 (t t))))
323 (if (not (boundp symbol))
324 ;; If variables are removed from C code, give an error here!
325 (and native-p
326 (message "Note, built-in variable `%S' not bound" symbol))
327 ;; Save the standard value, unless we already did.
328 (or (get symbol 'standard-value)
329 (put symbol 'standard-value
330 (list (funcall quoter (default-value symbol)))))
331 ;; If this is NOT while dumping Emacs,
332 ;; set up the rest of the customization info.
333 (unless purify-flag
334 ;; Add it to the right group.
335 (custom-add-to-group group symbol 'custom-variable)
336 ;; Set the type.
337 (put symbol 'custom-type type)
338 (put symbol 'custom-version version)))))
339
340 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
341 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
342 'custom-variable)
343 (put 'selection-coding-system 'custom-set
344 (lambda (symbol value)
345 (set-selection-coding-system value)
346 (set symbol value)))
347
348 ;; Record cus-start as loaded
349 ;; if we have set up all the info that we can set up.
350 ;; Don't record cus-start as loaded
351 ;; if we have set up only the standard values.
352 (unless purify-flag
353 (provide 'cus-start))
354
355 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
356 ;;; cus-start.el ends here