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