(mail-reply-buffer): Add defvar.
[emacs.git] / lisp / cus-start.el
blob2f3cd5d0e07c88c12009fca3fd6d7dd52b65398f
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: internal
9 ;; This file is part of GNU Emacs.
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.
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.
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.
26 ;;; Commentary:
28 ;; This file adds customize support for built-in variables.
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.
36 ;;; Code:
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 ;; callint.c
103 (mark-even-if-inactive editing-basics boolean)
104 ;; callproc.c
105 (shell-file-name execute file)
106 (exec-path execute
107 (repeat (choice (const :tag "default directory" nil)
108 (directory :format "%v"))))
109 ;; coding.c
110 (inhibit-eol-conversion mule boolean)
111 (eol-mnemonic-undecided mule string)
112 (eol-mnemonic-unix mule string)
113 (eol-mnemonic-dos mule string)
114 (eol-mnemonic-mac mule string)
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))))
128 (selection-coding-system mule coding-system)
129 ;; dired.c
130 (completion-ignored-extensions dired
131 (repeat (string :format "%v")))
132 ;; dispnew.c
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)))
148 (debug-on-error debug
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)))
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)))
161 ;; fileio.c
162 (insert-default-directory minibuffer boolean)
163 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
164 ;; fns.c
165 (use-dialog-box menu boolean "21.1")
166 (use-file-dialog menu boolean "22.1")
167 ;; frame.c
168 (default-frame-alist frames
169 (repeat (cons :format "%v"
170 (symbol :tag "Parameter")
171 (sexp :tag "Value"))))
172 (mouse-highlight mouse (choice (const :tag "disabled" nil)
173 (const :tag "always shown" t)
174 (other :tag "hidden by keypress" 1)))
175 ;; fringe.c
176 (overflow-newline-into-fringe fringe boolean "22.1")
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")))
184 (echo-keystrokes minibuffer number)
185 (polling-period keyboard integer)
186 (double-click-time mouse (restricted-sexp
187 :match-alternatives (integerp 'nil 't)))
188 (double-click-fuzz mouse integer)
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)
193 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
194 (integer :tag "time" 2)
195 (other :tag "on")))
197 ;; This is not good news because it will use the wrong
198 ;; version-specific directories when you upgrade. We need
199 ;; customization of the front of the list, maintaining the standard
200 ;; value intact at the back.
201 ;;; (load-path environment
202 ;;; (repeat (choice :tag "[Current dir?]"
203 ;;; :format "%[Current dir?%] %v"
204 ;;; (const :tag " current dir" nil)
205 ;;; (directory :format "%v"))))
206 ;; minibuf.c
207 (completion-auto-help minibuffer boolean)
208 (enable-recursive-minibuffers minibuffer boolean)
209 (history-length minibuffer
210 (choice (const :tag "Infinite" t)
211 integer))
212 (history-delete-duplicates minibuffer boolean)
213 (minibuffer-prompt-properties
214 minibuffer
215 (list
216 (checklist :inline t
217 (const :tag "Read-Only"
218 :doc "Prevent prompt from being modified"
219 :format "%t%n%h"
220 :inline t
221 (read-only t))
222 (const :tag "Don't Enter"
223 :doc "Prevent point from ever entering prompt"
224 :format "%t%n%h"
225 :inline t
226 (point-entered minibuffer-avoid-prompt)))
227 (repeat :inline t
228 :tag "Other Properties"
229 (list :inline t
230 :format "%v"
231 (symbol :tag "Property")
232 (sexp :tag "Value"))))
233 "21.1")
234 (minibuffer-auto-raise minibuffer boolean)
235 ;; options property set at end
236 (read-buffer-function minibuffer
237 (choice (const nil)
238 (function-item iswitchb-read-buffer)
239 function))
240 ;; msdos.c
241 (dos-unsupported-char-glyph display integer)
242 ;; process.c
243 (delete-exited-processes processes-basics boolean)
244 ;; syntax.c
245 (parse-sexp-ignore-comments editing-basics boolean)
246 (words-include-escapes editing-basics boolean)
247 (open-paren-in-column-0-is-defun-start editing-basics boolean
248 "21.1")
249 ;; undo.c
250 (undo-limit undo integer)
251 (undo-strong-limit undo integer)
252 (undo-outer-limit undo
253 (choice integer
254 (const :tag "No limit"
255 :format "%t\n%d"
256 :doc
257 "With this choice, \
258 the undo info for the current command never gets discarded.
259 This should only be chosen under exceptional circumstances,
260 since it could result in memory overflow and make Emacs crash."
261 nil))
262 "22.1")
263 ;; window.c
264 (temp-buffer-show-function windows (choice (const nil) function))
265 (display-buffer-function windows (choice (const nil) function))
266 (pop-up-frames frames boolean)
267 (pop-up-frame-function frames function)
268 (special-display-buffer-names
269 frames
270 (repeat (choice :tag "Buffer"
271 :value ""
272 (string :format "%v")
273 (cons :tag "With attributes"
274 :format "%v"
275 :value ("" . nil)
276 (string :format "%v")
277 (repeat :tag "Attributes"
278 (cons :format "%v"
279 (symbol :tag "Parameter")
280 (sexp :tag "Value")))))))
281 (special-display-regexps
282 frames
283 (repeat (choice :tag "Buffer"
284 :value ""
285 (regexp :format "%v")
286 (cons :tag "With attributes"
287 :format "%v"
288 :value ("" . nil)
289 (regexp :format "%v")
290 (repeat :tag "Attributes"
291 (cons :format "%v"
292 (symbol :tag "Parameter")
293 (sexp :tag "Value")))))))
294 (special-display-function frames function)
295 (same-window-buffer-names windows (repeat (string :format "%v")))
296 (same-window-regexps windows (repeat (regexp :format "%v")))
297 (pop-up-windows windows boolean)
298 (even-window-heights windows boolean)
299 (next-screen-context-lines windows integer)
300 (split-height-threshold windows integer)
301 (window-min-height windows integer)
302 (window-min-width windows integer)
303 (scroll-preserve-screen-position windows boolean)
304 (display-buffer-reuse-frames windows boolean "21.1")
305 ;; xdisp.c
306 (scroll-step windows integer)
307 (scroll-conservatively windows integer)
308 (scroll-margin windows integer)
309 (hscroll-margin windows integer "21.3")
310 (hscroll-step windows number "21.3")
311 (truncate-partial-width-windows display boolean)
312 (mode-line-inverse-video modeline boolean)
313 (mode-line-in-non-selected-windows modeline boolean "21.3")
314 (line-number-display-limit display
315 (choice integer
316 (const :tag "No limit" nil)))
317 (line-number-display-limit-width display integer)
318 (highlight-nonselected-windows display boolean)
319 (message-log-max debug (choice (const :tag "Disable" nil)
320 (integer :menu-tag "lines"
321 :format "%v")
322 (other :tag "Unlimited" t)))
323 (unibyte-display-via-language-environment mule boolean)
324 (blink-cursor-alist cursor alist "22.1")
325 ;; xfaces.c
326 (scalable-fonts-allowed display boolean)
327 ;; xfns.c
328 (x-bitmap-file-path installation
329 (repeat (directory :format "%v")))
330 (x-use-old-gtk-file-dialog menu boolean "22.1")
331 ;; xterm.c
332 (mouse-autoselect-window display boolean "21.3")
333 (x-use-underline-position-properties display boolean "21.3")
334 (x-stretch-cursor display boolean "21.1")))
335 this symbol group type standard version native-p
336 ;; This function turns a value
337 ;; into an expression which produces that value.
338 (quoter (lambda (sexp)
339 (if (or (memq sexp '(t nil))
340 (keywordp sexp)
341 (and (listp sexp)
342 (memq (car sexp) '(lambda)))
343 (stringp sexp)
344 (numberp sexp))
345 sexp
346 (list 'quote sexp)))))
347 (while all
348 (setq this (car all)
349 all (cdr all)
350 symbol (nth 0 this)
351 group (nth 1 this)
352 type (nth 2 this)
353 version (nth 3 this)
354 ;; If we did not specify any standard value expression above,
355 ;; use the current value as the standard value.
356 standard (if (nthcdr 4 this)
357 (nth 4 this)
358 (when (default-boundp symbol)
359 (funcall quoter (default-value symbol))))
360 ;; Don't complain about missing variables which are
361 ;; irrelevant to this platform.
362 native-p (save-match-data
363 (cond
364 ((string-match "\\`dos-" (symbol-name symbol))
365 (eq system-type 'ms-dos))
366 ((string-match "\\`w32-" (symbol-name symbol))
367 (eq system-type 'windows-nt))
368 ((string-match "\\`x-.*gtk" (symbol-name symbol))
369 (or (boundp 'gtk) (not (eq system-type 'windows-nt))))
370 ((string-match "\\`x-" (symbol-name symbol))
371 (fboundp 'x-create-frame))
372 (t t))))
373 (if (not (boundp symbol))
374 ;; If variables are removed from C code, give an error here!
375 (and native-p
376 (message "Note, built-in variable `%S' not bound" symbol))
377 ;; Save the standard value, unless we already did.
378 (or (get symbol 'standard-value)
379 (put symbol 'standard-value (list standard)))
380 ;; If this is NOT while dumping Emacs,
381 ;; set up the rest of the customization info.
382 (unless purify-flag
383 ;; Add it to the right group.
384 (custom-add-to-group group symbol 'custom-variable)
385 ;; Set the type.
386 (put symbol 'custom-type type)
387 (put symbol 'custom-version version)))))
389 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
390 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
391 'custom-variable)
392 (put 'selection-coding-system 'custom-set
393 (lambda (symbol value)
394 (set-selection-coding-system value)
395 (set symbol value)))
397 ;; Record cus-start as loaded
398 ;; if we have set up all the info that we can set up.
399 ;; Don't record cus-start as loaded
400 ;; if we have set up only the standard values.
401 (unless purify-flag
402 (provide 'cus-start))
404 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
405 ;;; cus-start.el ends here