merge from trunk, fix conflicts
[emacs.git] / lisp / cus-start.el
blobec05eb7c9b0ff07f98a1b6d749bfcf711f8f0968
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, 2010 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 (major-mode internal function)
42 (case-fold-search matching boolean)
43 (fill-column fill integer)
44 (left-margin fill integer)
45 (tab-width editing-basics integer)
46 (ctl-arrow display boolean)
47 (truncate-lines display boolean)
48 (word-wrap display boolean)
49 (selective-display-ellipses display boolean)
50 (indicate-empty-lines fringe boolean)
51 (indicate-buffer-boundaries
52 fringe
53 (choice
54 (const :tag "No indicators" nil)
55 (const :tag "On left, with arrows" left)
56 (const :tag "On right, with arrows" right)
57 (set :tag "Pick your own design"
58 :value ((t . nil))
59 :format "%{%t%}:\n%v\n%d"
60 :doc "You can specify a default and then override it \
61 for individual indicators.
62 Leaving \"Default\" unchecked is equivalent with specifying a default of
63 \"Do not show\"."
64 (choice :tag "Default"
65 :value (t . nil)
66 (const :tag "Do not show" (t . nil))
67 (const :tag "On the left" (t . left))
68 (const :tag "On the right" (t . right)))
69 (choice :tag "Top"
70 :value (top . left)
71 (const :tag "Do not show" (top . nil))
72 (const :tag "On the left" (top . left))
73 (const :tag "On the right" (top . right)))
74 (choice :tag "Bottom"
75 :value (bottom . left)
76 (const :tag "Do not show" (bottom . nil))
77 (const :tag "On the left" (bottom . left))
78 (const :tag "On the right" (bottom . right)))
79 (choice :tag "Up arrow"
80 :value (up . left)
81 (const :tag "Do not show" (up . nil))
82 (const :tag "On the left" (up . left))
83 (const :tag "On the right" (up . right)))
84 (choice :tag "Down arrow"
85 :value (down . left)
86 (const :tag "Do not show" (down . nil))
87 (const :tag "On the left" (down . left))
88 (const :tag "On the right" (down . right))))
89 (other :tag "On left, no arrows" t)))
90 (scroll-up-aggressively windows
91 (choice (const :tag "off" nil) number)
92 "21.1")
93 (scroll-down-aggressively windows
94 (choice (const :tag "off" nil) number)
95 "21.1")
96 (line-spacing display (choice (const :tag "none" nil) integer)
97 "22.1")
98 ;; callint.c
99 (mark-even-if-inactive editing-basics boolean)
100 ;; callproc.c
101 (shell-file-name execute file)
102 (exec-path execute
103 (repeat (choice (const :tag "default directory" nil)
104 (directory :format "%v"))))
105 ;; charset.c
106 (charset-map-path installation
107 (repeat (directory :format "%v")))
108 ;; coding.c
109 (inhibit-eol-conversion mule boolean)
110 (eol-mnemonic-undecided mule string)
111 (eol-mnemonic-unix mule string)
112 (eol-mnemonic-dos mule string)
113 (eol-mnemonic-mac mule string)
114 (file-coding-system-alist
115 mule
116 (alist
117 :key-type (regexp :tag "File regexp")
118 :value-type (choice
119 :value (undecided . undecided)
120 (cons :tag "Encoding/decoding pair"
121 :value (undecided . undecided)
122 (coding-system :tag "Decoding")
123 (coding-system :tag "Encoding"))
124 (coding-system
125 :tag "Single coding system"
126 :value undecided
127 :match (lambda (widget value)
128 (and value (not (functionp value)))))
129 (function :value ignore))))
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 (max-mini-window-height limits
144 (choice (const :tag "quarter screen" nil)
145 number) "23.1")
146 (stack-trace-on-error debug
147 (choice (const :tag "off")
148 (repeat :menu-tag "When"
149 :value (nil)
150 (symbol :format "%v"))
151 (const :tag "always" t)))
152 (debug-on-error debug
153 (choice (const :tag "off")
154 (repeat :menu-tag "When"
155 :value (nil)
156 (symbol :format "%v"))
157 (const :tag "always" t)))
158 (debug-ignored-errors debug (repeat (choice symbol regexp)))
159 (debug-on-quit debug
160 (choice (const :tag "off")
161 (repeat :menu-tag "When"
162 :value (nil)
163 (symbol :format "%v"))
164 (const :tag "always" t)))
165 ;; fileio.c
166 (delete-by-moving-to-trash auto-save boolean "23.1")
167 (auto-save-visited-file-name auto-save boolean)
168 ;; fns.c
169 (use-dialog-box menu boolean "21.1")
170 (use-file-dialog menu boolean "22.1")
171 (focus-follows-mouse frames boolean "20.3")
172 ;; frame.c
173 (default-frame-alist frames
174 (repeat (cons :format "%v"
175 (symbol :tag "Parameter")
176 (sexp :tag "Value"))))
177 (mouse-highlight mouse (choice (const :tag "disabled" nil)
178 (const :tag "always shown" t)
179 (other :tag "hidden by keypress" 1))
180 "22.1")
181 (make-pointer-invisible mouse boolean "23.2")
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 (select-active-regions killing
201 (choice (const :tag "always" t)
202 (const :tag "only shift-selection or mouse-drag" only)
203 (const :tag "off" nil))
204 "24.1")
205 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
206 (integer :tag "time" 2)
207 (other :tag "on")))
209 ;; This is not good news because it will use the wrong
210 ;; version-specific directories when you upgrade. We need
211 ;; customization of the front of the list, maintaining the standard
212 ;; value intact at the back.
213 ;;; (load-path environment
214 ;;; (repeat (choice :tag "[Current dir?]"
215 ;;; :format "%[Current dir?%] %v"
216 ;;; (const :tag " current dir" nil)
217 ;;; (directory :format "%v"))))
218 ;; minibuf.c
219 (enable-recursive-minibuffers minibuffer boolean)
220 (history-length minibuffer
221 (choice (const :tag "Infinite" t) integer)
222 "22.1")
223 (history-delete-duplicates minibuffer boolean "22.1")
224 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
226 (minibuffer-prompt-properties
227 minibuffer
228 (list
229 (checklist :inline t
230 (const :tag "Read-Only"
231 :doc "Prevent prompt from being modified"
232 :format "%t%n%h"
233 :inline t
234 (read-only t))
235 (const :tag "Don't Enter"
236 :doc "Prevent point from ever entering prompt"
237 :format "%t%n%h"
238 :inline t
239 (point-entered minibuffer-avoid-prompt)))
240 (repeat :inline t
241 :tag "Other Properties"
242 (list :inline t
243 :format "%v"
244 (symbol :tag "Property")
245 (sexp :tag "Value"))))
246 "21.1")
247 (minibuffer-auto-raise minibuffer boolean)
248 ;; options property set at end
249 (read-buffer-function minibuffer
250 (choice (const nil)
251 (function-item iswitchb-read-buffer)
252 function))
253 ;; msdos.c
254 (dos-unsupported-char-glyph display integer)
255 ;; nsterm.m
256 (ns-control-modifier
258 (choice (const :tag "No modifier" nil)
259 (const control) (const meta)
260 (const alt) (const hyper)
261 (const super)) "23.1")
262 (ns-command-modifier
264 (choice (const :tag "No modifier" nil)
265 (const control) (const meta)
266 (const alt) (const hyper)
267 (const super)) "23.1")
268 (ns-alternate-modifier
270 (choice (const :tag "No modifier (work as alternate/option)" none)
271 (const control) (const meta)
272 (const alt) (const hyper)
273 (const super)) "23.1")
274 (ns-function-modifier
276 (choice (const :tag "No modifier (work as function)" none)
277 (const control) (const meta)
278 (const alt) (const hyper)
279 (const super)) "23.1")
280 (ns-antialias-text ns boolean "23.1")
281 ;; process.c
282 (delete-exited-processes processes-basics boolean)
283 ;; syntax.c
284 (parse-sexp-ignore-comments editing-basics boolean)
285 (words-include-escapes editing-basics boolean)
286 (open-paren-in-column-0-is-defun-start editing-basics boolean
287 "21.1")
288 ;; term.c
289 (visible-cursor cursor boolean "22.1")
290 ;; undo.c
291 (undo-limit undo integer)
292 (undo-strong-limit undo integer)
293 (undo-outer-limit undo
294 (choice integer
295 (const :tag "No limit"
296 :format "%t\n%d"
297 :doc
298 "With this choice, \
299 the undo info for the current command never gets discarded.
300 This should only be chosen under exceptional circumstances,
301 since it could result in memory overflow and make Emacs crash."
302 nil))
303 "22.1")
304 ;; window.c
305 (temp-buffer-show-function windows (choice (const nil) function))
306 (next-screen-context-lines windows integer)
307 (window-min-height windows integer)
308 (window-min-width windows integer)
309 (scroll-preserve-screen-position
310 windows (choice
311 (const :tag "Off (nil)" :value nil)
312 (const :tag "Full screen (t)" :value t)
313 (other :tag "Always" 1)) "22.1")
314 (recenter-redisplay windows
315 (choice
316 (const :tag "Never (nil)" :value nil)
317 (const :tag "Only on ttys" :value tty)
318 (other :tag "Always" t))
319 "23.1")
320 ;; xdisp.c
321 (scroll-step windows integer)
322 (scroll-conservatively windows integer)
323 (scroll-margin windows integer)
324 (hscroll-margin windows integer "22.1")
325 (hscroll-step windows number "22.1")
326 (truncate-partial-width-windows display boolean "23.1")
327 (mode-line-inverse-video mode-line boolean)
328 (mode-line-in-non-selected-windows mode-line boolean "22.1")
329 (line-number-display-limit display
330 (choice integer
331 (const :tag "No limit" nil)))
332 (line-number-display-limit-width display integer "22.1")
333 (highlight-nonselected-windows display boolean)
334 (message-log-max debug (choice (const :tag "Disable" nil)
335 (integer :menu-tag "lines"
336 :format "%v")
337 (other :tag "Unlimited" t)))
338 (unibyte-display-via-language-environment mule boolean)
339 (blink-cursor-alist cursor alist "22.1")
340 (overline-margin display integer "22.1")
341 (underline-minimum-offset display integer "23.1")
342 (mouse-autoselect-window
343 display (choice
344 (const :tag "Off (nil)" :value nil)
345 (const :tag "Immediate" :value t)
346 (number :tag "Delay by secs" :value 0.5)) "22.1")
347 (tool-bar-style
348 frames (choice
349 (const :tag "Images" :value image)
350 (const :tag "Text" :value text)
351 (const :tag "Both" :value both)
352 (const :tag "Both-horiz" :value both-horiz)
353 (const :tag "Text-image-horiz" :value text-image-horiz)
354 (const :tag "System default" :value nil)) "23.3")
355 (tool-bar-max-label-size frames integer "23.3")
357 ;; xfaces.c
358 (scalable-fonts-allowed display boolean "22.1")
359 ;; xfns.c
360 (x-bitmap-file-path installation
361 (repeat (directory :format "%v")))
362 (x-gtk-use-old-file-dialog menu boolean "22.1")
363 (x-gtk-show-hidden-files menu boolean "22.1")
364 (x-gtk-file-dialog-help-text menu boolean "22.1")
365 (x-gtk-whole-detached-tool-bar x boolean "22.1")
366 (x-gtk-use-system-tooltips tooltip boolean "23.3")
367 ;; xterm.c
368 (x-use-underline-position-properties display boolean "22.1")
369 (x-underline-at-descent-line display boolean "22.1")
370 (x-stretch-cursor display boolean "21.1")
371 ;; xsettings.c
372 (font-use-system-font font-selection boolean "23.2")))
373 this symbol group type standard version native-p
374 ;; This function turns a value
375 ;; into an expression which produces that value.
376 (quoter (lambda (sexp)
377 (if (or (memq sexp '(t nil))
378 (keywordp sexp)
379 (and (listp sexp)
380 (memq (car sexp) '(lambda)))
381 (stringp sexp)
382 (numberp sexp))
383 sexp
384 (list 'quote sexp)))))
385 (while all
386 (setq this (car all)
387 all (cdr all)
388 symbol (nth 0 this)
389 group (nth 1 this)
390 type (nth 2 this)
391 version (nth 3 this)
392 ;; If we did not specify any standard value expression above,
393 ;; use the current value as the standard value.
394 standard (if (nthcdr 4 this)
395 (nth 4 this)
396 (when (default-boundp symbol)
397 (funcall quoter (default-value symbol))))
398 ;; Don't complain about missing variables which are
399 ;; irrelevant to this platform.
400 native-p (save-match-data
401 (cond
402 ((string-match "\\`dos-" (symbol-name symbol))
403 (eq system-type 'ms-dos))
404 ((string-match "\\`w32-" (symbol-name symbol))
405 (eq system-type 'windows-nt))
406 ((string-match "\\`ns-" (symbol-name symbol))
407 (featurep 'ns))
408 ((string-match "\\`x-.*gtk" (symbol-name symbol))
409 (featurep 'gtk))
410 ((string-match "\\`x-" (symbol-name symbol))
411 (fboundp 'x-create-frame))
412 ((string-match "selection" (symbol-name symbol))
413 (fboundp 'x-selection-exists-p))
414 ((string-match "fringe" (symbol-name symbol))
415 (fboundp 'define-fringe-bitmap))
416 ((equal "font-use-system-font" (symbol-name symbol))
417 (featurep 'system-font-setting))
418 ;; Conditioned on x-create-frame, because that's
419 ;; the condition for loadup.el to preload tool-bar.el.
420 ((string-match "tool-bar-" (symbol-name symbol))
421 (fboundp 'x-create-frame))
422 (t t))))
423 (if (not (boundp symbol))
424 ;; If variables are removed from C code, give an error here!
425 (and native-p
426 (message "Note, built-in variable `%S' not bound" symbol))
427 ;; Save the standard value, unless we already did.
428 (or (get symbol 'standard-value)
429 (put symbol 'standard-value (list standard)))
430 ;; If this is NOT while dumping Emacs,
431 ;; set up the rest of the customization info.
432 (unless purify-flag
433 ;; Add it to the right group.
434 (custom-add-to-group group symbol 'custom-variable)
435 ;; Set the type.
436 (put symbol 'custom-type type)
437 (put symbol 'custom-version version)))))
439 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
440 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
441 'custom-variable)
443 ;; Record cus-start as loaded
444 ;; if we have set up all the info that we can set up.
445 ;; Don't record cus-start as loaded
446 ;; if we have set up only the standard values.
447 (unless purify-flag
448 (provide 'cus-start))
450 ;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
451 ;;; cus-start.el ends here