(Ffind_coding_systems_region_internal): Cache checked characters.
[emacs.git] / lisp / cus-start.el
blobd8d3cc5d3ac85b6d0e1c5bdd2ed788da9e703c37
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009 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 3 of the License, or
14 ;; (at your option) 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. If not, see <http://www.gnu.org/licenses/>.
24 ;;; Commentary:
26 ;; This file adds customize support for built-in variables.
28 ;; While dumping Emacs, this file is loaded, but it only records
29 ;; the standard values; it does not do the rest of the job.
30 ;; Later on, if the user makes a customization buffer,
31 ;; this file is loaded again with (require 'cus-start);
32 ;; then it does the whole job.
34 ;;; Code:
36 (let ((all '(;; alloc.c
37 (gc-cons-threshold alloc integer)
38 (garbage-collection-messages alloc boolean)
39 ;; buffer.c
40 (mode-line-format mode-line sexp) ;Hard to do right.
41 (default-major-mode internal function)
42 (enable-multibyte-characters mule boolean)
43 (case-fold-search matching boolean)
44 (fill-column fill integer)
45 (left-margin fill integer)
46 (tab-width editing-basics integer)
47 (ctl-arrow display boolean)
48 (truncate-lines display boolean)
49 (word-wrap display boolean)
50 (selective-display-ellipses display boolean)
51 (indicate-empty-lines fringe boolean)
52 (indicate-buffer-boundaries
53 fringe
54 (choice
55 (const :tag "No indicators" nil)
56 (const :tag "On left, with arrows" left)
57 (const :tag "On right, with arrows" right)
58 (set :tag "Pick your own design"
59 :value ((t . nil))
60 :format "%{%t%}:\n%v\n%d"
61 :doc "You can specify a default and then override it \
62 for individual indicators.
63 Leaving \"Default\" unchecked is equivalent with specifying a default of
64 \"Do not show\"."
65 (choice :tag "Default"
66 :value (t . nil)
67 (const :tag "Do not show" (t . nil))
68 (const :tag "On the left" (t . left))
69 (const :tag "On the right" (t . right)))
70 (choice :tag "Top"
71 :value (top . left)
72 (const :tag "Do not show" (top . nil))
73 (const :tag "On the left" (top . left))
74 (const :tag "On the right" (top . right)))
75 (choice :tag "Bottom"
76 :value (bottom . left)
77 (const :tag "Do not show" (bottom . nil))
78 (const :tag "On the left" (bottom . left))
79 (const :tag "On the right" (bottom . right)))
80 (choice :tag "Up arrow"
81 :value (up . left)
82 (const :tag "Do not show" (up . nil))
83 (const :tag "On the left" (up . left))
84 (const :tag "On the right" (up . right)))
85 (choice :tag "Down arrow"
86 :value (down . left)
87 (const :tag "Do not show" (down . nil))
88 (const :tag "On the left" (down . left))
89 (const :tag "On the right" (down . right))))
90 (other :tag "On left, no arrows" t)))
91 (scroll-up-aggressively windows
92 (choice (const :tag "off" nil) number)
93 "21.1")
94 (scroll-down-aggressively windows
95 (choice (const :tag "off" nil) number)
96 "21.1")
97 (line-spacing display (choice (const :tag "none" nil) integer)
98 "22.1")
99 ;; callint.c
100 (mark-even-if-inactive editing-basics boolean)
101 ;; callproc.c
102 (shell-file-name execute file)
103 (exec-path execute
104 (repeat (choice (const :tag "default directory" nil)
105 (directory :format "%v"))))
106 ;; charset.c
107 (charset-map-path installation
108 (repeat (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
126 :tag "Single coding system"
127 :value undecided
128 :match (lambda (widget value)
129 (and value (not (functionp value)))))
130 (function :value ignore))))
131 ;; dired.c
132 (completion-ignored-extensions dired
133 (repeat (string :format "%v")))
134 ;; dispnew.c
135 (baud-rate display integer)
136 (inverse-video display boolean)
137 (visible-bell display boolean)
138 (no-redraw-on-reenter display boolean)
139 ;; editfns.c
140 (user-full-name mail string)
141 ;; eval.c
142 (max-specpdl-size limits integer)
143 (max-lisp-eval-depth limits integer)
144 (max-mini-window-height limits
145 (choice (const :tag "quarter screen" nil)
146 number) "23.1")
147 (stack-trace-on-error debug
148 (choice (const :tag "off")
149 (repeat :menu-tag "When"
150 :value (nil)
151 (symbol :format "%v"))
152 (const :tag "always" t)))
153 (debug-on-error debug
154 (choice (const :tag "off")
155 (repeat :menu-tag "When"
156 :value (nil)
157 (symbol :format "%v"))
158 (const :tag "always" t)))
159 (debug-ignored-errors debug (repeat (choice symbol regexp)))
160 (debug-on-quit debug
161 (choice (const :tag "off")
162 (repeat :menu-tag "When"
163 :value (nil)
164 (symbol :format "%v"))
165 (const :tag "always" t)))
166 ;; fileio.c
167 (delete-by-moving-to-trash auto-save boolean "23.1")
168 (auto-save-visited-file-name auto-save boolean)
169 ;; fns.c
170 (use-dialog-box menu boolean "21.1")
171 (use-file-dialog menu boolean "22.1")
172 (focus-follows-mouse frames boolean "20.3")
173 ;; frame.c
174 (default-frame-alist frames
175 (repeat (cons :format "%v"
176 (symbol :tag "Parameter")
177 (sexp :tag "Value"))))
178 (mouse-highlight mouse (choice (const :tag "disabled" nil)
179 (const :tag "always shown" t)
180 (other :tag "hidden by keypress" 1))
181 "22.1")
182 ;; fringe.c
183 (overflow-newline-into-fringe fringe boolean)
184 ;; indent.c
185 (indent-tabs-mode indent boolean)
186 ;; keyboard.c
187 (meta-prefix-char keyboard character)
188 (auto-save-interval auto-save integer)
189 (auto-save-timeout auto-save (choice (const :tag "off" nil)
190 (integer :format "%v")))
191 (echo-keystrokes minibuffer number)
192 (polling-period keyboard integer)
193 (double-click-time mouse (restricted-sexp
194 :match-alternatives (integerp 'nil 't)))
195 (double-click-fuzz mouse integer "22.1")
196 (inhibit-local-menu-bar-menus menu boolean)
197 (help-char keyboard character)
198 (help-event-list keyboard (repeat (sexp :format "%v")))
199 (menu-prompting menu boolean)
200 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
201 (integer :tag "time" 2)
202 (other :tag "on")))
204 ;; This is not good news because it will use the wrong
205 ;; version-specific directories when you upgrade. We need
206 ;; customization of the front of the list, maintaining the standard
207 ;; value intact at the back.
208 ;;; (load-path environment
209 ;;; (repeat (choice :tag "[Current dir?]"
210 ;;; :format "%[Current dir?%] %v"
211 ;;; (const :tag " current dir" nil)
212 ;;; (directory :format "%v"))))
213 ;; minibuf.c
214 (enable-recursive-minibuffers minibuffer boolean)
215 (history-length minibuffer
216 (choice (const :tag "Infinite" t) integer)
217 "22.1")
218 (history-delete-duplicates minibuffer boolean "22.1")
219 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
221 (minibuffer-prompt-properties
222 minibuffer
223 (list
224 (checklist :inline t
225 (const :tag "Read-Only"
226 :doc "Prevent prompt from being modified"
227 :format "%t%n%h"
228 :inline t
229 (read-only t))
230 (const :tag "Don't Enter"
231 :doc "Prevent point from ever entering prompt"
232 :format "%t%n%h"
233 :inline t
234 (point-entered minibuffer-avoid-prompt)))
235 (repeat :inline t
236 :tag "Other Properties"
237 (list :inline t
238 :format "%v"
239 (symbol :tag "Property")
240 (sexp :tag "Value"))))
241 "21.1")
242 (minibuffer-auto-raise minibuffer boolean)
243 ;; options property set at end
244 (read-buffer-function minibuffer
245 (choice (const nil)
246 (function-item iswitchb-read-buffer)
247 function))
248 ;; msdos.c
249 (dos-unsupported-char-glyph display integer)
250 ;; nsterm.m
251 (ns-control-modifier
253 (choice (const :tag "No modifier" nil)
254 (const control) (const meta)
255 (const alt) (const hyper)
256 (const super)) "23.1")
257 (ns-command-modifier
259 (choice (const :tag "No modifier" nil)
260 (const control) (const meta)
261 (const alt) (const hyper)
262 (const super)) "23.1")
263 (ns-alternate-modifier
265 (choice (const :tag "No modifier (work as alternate/option)" none)
266 (const control) (const meta)
267 (const alt) (const hyper)
268 (const super)) "23.1")
269 (ns-function-modifier
271 (choice (const :tag "No modifier (work as function)" none)
272 (const control) (const meta)
273 (const alt) (const hyper)
274 (const super)) "23.1")
275 (ns-antialias-text ns boolean "23.1")
276 (ns-use-qd-smoothing ns boolean "23.1")
277 ;; process.c
278 (delete-exited-processes processes-basics boolean)
279 ;; syntax.c
280 (parse-sexp-ignore-comments editing-basics boolean)
281 (words-include-escapes editing-basics boolean)
282 (open-paren-in-column-0-is-defun-start editing-basics boolean
283 "21.1")
284 ;; term.c
285 (visible-cursor cursor boolean "22.1")
286 ;; undo.c
287 (undo-limit undo integer)
288 (undo-strong-limit undo integer)
289 (undo-outer-limit undo
290 (choice integer
291 (const :tag "No limit"
292 :format "%t\n%d"
293 :doc
294 "With this choice, \
295 the undo info for the current command never gets discarded.
296 This should only be chosen under exceptional circumstances,
297 since it could result in memory overflow and make Emacs crash."
298 nil))
299 "22.1")
300 ;; window.c
301 (temp-buffer-show-function windows (choice (const nil) function))
302 (next-screen-context-lines windows integer)
303 (window-min-height windows integer)
304 (window-min-width windows integer)
305 (scroll-preserve-screen-position
306 windows (choice
307 (const :tag "Off (nil)" :value nil)
308 (const :tag "Full screen (t)" :value t)
309 (other :tag "Always" 1)) "22.1")
310 ;; xdisp.c
311 (scroll-step windows integer)
312 (scroll-conservatively windows integer)
313 (scroll-margin windows integer)
314 (hscroll-margin windows integer "22.1")
315 (hscroll-step windows number "22.1")
316 (truncate-partial-width-windows display boolean "23.1")
317 (mode-line-inverse-video mode-line boolean)
318 (mode-line-in-non-selected-windows mode-line boolean "22.1")
319 (line-number-display-limit display
320 (choice integer
321 (const :tag "No limit" nil)))
322 (line-number-display-limit-width display integer "22.1")
323 (highlight-nonselected-windows display boolean)
324 (message-log-max debug (choice (const :tag "Disable" nil)
325 (integer :menu-tag "lines"
326 :format "%v")
327 (other :tag "Unlimited" t)))
328 (unibyte-display-via-language-environment mule boolean)
329 (blink-cursor-alist cursor alist "22.1")
330 (overline-margin display integer "22.1")
331 (underline-minimum-offset display integer "23.1")
332 (mouse-autoselect-window
333 display (choice
334 (const :tag "Off (nil)" :value nil)
335 (const :tag "Immediate" :value t)
336 (number :tag "Delay by secs" :value 0.5)) "22.1")
337 ;; xfaces.c
338 (scalable-fonts-allowed display boolean "22.1")
339 ;; xfns.c
340 (x-bitmap-file-path installation
341 (repeat (directory :format "%v")))
342 (x-gtk-use-old-file-dialog menu boolean "22.1")
343 (x-gtk-show-hidden-files menu boolean "22.1")
344 (x-gtk-file-dialog-help-text menu boolean "22.1")
345 (x-gtk-whole-detached-tool-bar x boolean "22.1")
346 ;; xterm.c
347 (x-use-underline-position-properties display boolean "22.1")
348 (x-underline-at-descent-line display boolean "22.1")
349 (x-stretch-cursor display boolean "21.1")))
350 this symbol group type standard version native-p
351 ;; This function turns a value
352 ;; into an expression which produces that value.
353 (quoter (lambda (sexp)
354 (if (or (memq sexp '(t nil))
355 (keywordp sexp)
356 (and (listp sexp)
357 (memq (car sexp) '(lambda)))
358 (stringp sexp)
359 (numberp sexp))
360 sexp
361 (list 'quote sexp)))))
362 (while all
363 (setq this (car all)
364 all (cdr all)
365 symbol (nth 0 this)
366 group (nth 1 this)
367 type (nth 2 this)
368 version (nth 3 this)
369 ;; If we did not specify any standard value expression above,
370 ;; use the current value as the standard value.
371 standard (if (nthcdr 4 this)
372 (nth 4 this)
373 (when (default-boundp symbol)
374 (funcall quoter (default-value symbol))))
375 ;; Don't complain about missing variables which are
376 ;; irrelevant to this platform.
377 native-p (save-match-data
378 (cond
379 ((string-match "\\`dos-" (symbol-name symbol))
380 (eq system-type 'ms-dos))
381 ((string-match "\\`w32-" (symbol-name symbol))
382 (eq system-type 'windows-nt))
383 ((string-match "\\`ns-" (symbol-name symbol))
384 (featurep 'ns))
385 ((string-match "\\`x-.*gtk" (symbol-name symbol))
386 (featurep 'gtk))
387 ((string-match "\\`x-" (symbol-name symbol))
388 (fboundp 'x-create-frame))
389 ((string-match "selection" (symbol-name symbol))
390 (fboundp 'x-selection-exists-p))
391 ((string-match "fringe" (symbol-name symbol))
392 (fboundp 'define-fringe-bitmap))
393 (t t))))
394 (if (not (boundp symbol))
395 ;; If variables are removed from C code, give an error here!
396 (and native-p
397 (message "Note, built-in variable `%S' not bound" symbol))
398 ;; Save the standard value, unless we already did.
399 (or (get symbol 'standard-value)
400 (put symbol 'standard-value (list standard)))
401 ;; If this is NOT while dumping Emacs,
402 ;; set up the rest of the customization info.
403 (unless purify-flag
404 ;; Add it to the right group.
405 (custom-add-to-group group symbol 'custom-variable)
406 ;; Set the type.
407 (put symbol 'custom-type type)
408 (put symbol 'custom-version version)))))
410 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
411 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
412 'custom-variable)
414 ;; Record cus-start as loaded
415 ;; if we have set up all the info that we can set up.
416 ;; Don't record cus-start as loaded
417 ;; if we have set up only the standard values.
418 (unless purify-flag
419 (provide 'cus-start))
421 ;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
422 ;;; cus-start.el ends here