]> code.delx.au - gnu-emacs/blob - lisp/cus-start.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / cus-start.el
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 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: internal
8
9 ;; This file is part of GNU Emacs.
10
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.
15
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.
20
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/>.
23
24 ;;; Commentary:
25 ;;
26 ;; This file adds customize support for built-in variables.
27
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.
33
34 ;;; Code:
35
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 (shift-select-mode editing-basics boolean)
102 ;; callproc.c
103 (shell-file-name execute file)
104 (exec-path execute
105 (repeat (choice (const :tag "default directory" nil)
106 (directory :format "%v"))))
107 ;; charset.c
108 (charset-map-path installation
109 (repeat (directory :format "%v")))
110 ;; coding.c
111 (inhibit-eol-conversion mule boolean)
112 (eol-mnemonic-undecided mule string)
113 (eol-mnemonic-unix mule string)
114 (eol-mnemonic-dos mule string)
115 (eol-mnemonic-mac mule string)
116 (file-coding-system-alist
117 mule
118 (alist
119 :key-type (regexp :tag "File regexp")
120 :value-type (choice
121 :value (undecided . undecided)
122 (cons :tag "Encoding/decoding pair"
123 :value (undecided . undecided)
124 (coding-system :tag "Decoding")
125 (coding-system :tag "Encoding"))
126 (coding-system
127 :tag "Single coding system"
128 :value undecided
129 :match (lambda (widget value)
130 (and value (not (functionp value)))))
131 (function :value ignore))))
132 ;; dired.c
133 (completion-ignored-extensions dired
134 (repeat (string :format "%v")))
135 ;; dispnew.c
136 (baud-rate display integer)
137 (inverse-video display boolean)
138 (visible-bell display boolean)
139 (no-redraw-on-reenter display boolean)
140 ;; editfns.c
141 (user-full-name mail string)
142 ;; eval.c
143 (max-specpdl-size limits integer)
144 (max-lisp-eval-depth limits integer)
145 (max-mini-window-height limits
146 (choice (const :tag "quarter screen" nil)
147 number) "23.1")
148 (stack-trace-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-on-error debug
155 (choice (const :tag "off")
156 (repeat :menu-tag "When"
157 :value (nil)
158 (symbol :format "%v"))
159 (const :tag "always" t)))
160 (debug-ignored-errors debug (repeat (choice symbol regexp)))
161 (debug-on-quit debug
162 (choice (const :tag "off")
163 (repeat :menu-tag "When"
164 :value (nil)
165 (symbol :format "%v"))
166 (const :tag "always" t)))
167 ;; fileio.c
168 (delete-by-moving-to-trash auto-save boolean "23.1")
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")))
203 ;; macselect.c
204 (mac-dnd-known-types mac (repeat string) "22.1")
205 ;; macterm.c
206 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
207 (const control) (const meta)
208 (const alt) (const hyper)
209 (const super)) "22.1")
210 (mac-command-modifier mac (choice (const :tag "No modifier" nil)
211 (const control) (const meta)
212 (const alt) (const hyper)
213 (const super)) "22.1")
214 (mac-option-modifier mac (choice (const :tag "No modifier (work as option)" nil)
215 (const control) (const meta)
216 (const alt) (const hyper)
217 (const super)) "22.1")
218 (mac-function-modifier mac
219 (choice (const :tag "No modifier (work as function)" nil)
220 (const control) (const meta)
221 (const alt) (const hyper)
222 (const super)) "22.1")
223 (mac-emulate-three-button-mouse mac
224 (choice (const :tag "No emulation" nil)
225 (const :tag "Option->2, Command->3" t)
226 (const :tag "Command->2, Option->3" reverse))
227 "22.1")
228 (mac-wheel-button-is-mouse-2 mac boolean "22.1")
229 (mac-pass-command-to-system mac boolean "22.1")
230 (mac-pass-control-to-system mac boolean "22.1")
231 (mac-allow-anti-aliasing mac boolean "22.1")
232 (mac-ts-script-language-on-focus mac
233 (choice (const :tag "System default behavior" nil)
234 (const :tag "Restore to script/language used in the last focus frame" t)
235 (cons :tag "Specify script/language"
236 (integer :tag "Script code")
237 (integer :tag "Language code")))
238 "22.1")
239
240 ;; This is not good news because it will use the wrong
241 ;; version-specific directories when you upgrade. We need
242 ;; customization of the front of the list, maintaining the standard
243 ;; value intact at the back.
244 ;;; (load-path environment
245 ;;; (repeat (choice :tag "[Current dir?]"
246 ;;; :format "%[Current dir?%] %v"
247 ;;; (const :tag " current dir" nil)
248 ;;; (directory :format "%v"))))
249 ;; minibuf.c
250 (enable-recursive-minibuffers minibuffer boolean)
251 (history-length minibuffer
252 (choice (const :tag "Infinite" t) integer)
253 "22.1")
254 (history-delete-duplicates minibuffer boolean "22.1")
255 (minibuffer-prompt-properties
256 minibuffer
257 (list
258 (checklist :inline t
259 (const :tag "Read-Only"
260 :doc "Prevent prompt from being modified"
261 :format "%t%n%h"
262 :inline t
263 (read-only t))
264 (const :tag "Don't Enter"
265 :doc "Prevent point from ever entering prompt"
266 :format "%t%n%h"
267 :inline t
268 (point-entered minibuffer-avoid-prompt)))
269 (repeat :inline t
270 :tag "Other Properties"
271 (list :inline t
272 :format "%v"
273 (symbol :tag "Property")
274 (sexp :tag "Value"))))
275 "21.1")
276 (minibuffer-auto-raise minibuffer boolean)
277 ;; options property set at end
278 (read-buffer-function minibuffer
279 (choice (const nil)
280 (function-item iswitchb-read-buffer)
281 function))
282 ;; msdos.c
283 (dos-unsupported-char-glyph display integer)
284 ;; process.c
285 (delete-exited-processes processes-basics boolean)
286 ;; syntax.c
287 (parse-sexp-ignore-comments editing-basics boolean)
288 (words-include-escapes editing-basics boolean)
289 (open-paren-in-column-0-is-defun-start editing-basics boolean
290 "21.1")
291 ;; term.c
292 (visible-cursor cursor boolean "22.1")
293 ;; undo.c
294 (undo-limit undo integer)
295 (undo-strong-limit undo integer)
296 (undo-outer-limit undo
297 (choice integer
298 (const :tag "No limit"
299 :format "%t\n%d"
300 :doc
301 "With this choice, \
302 the undo info for the current command never gets discarded.
303 This should only be chosen under exceptional circumstances,
304 since it could result in memory overflow and make Emacs crash."
305 nil))
306 "22.1")
307 ;; window.c
308 (temp-buffer-show-function windows (choice (const nil) function))
309 (next-screen-context-lines windows integer)
310 (window-min-height windows integer)
311 (window-min-width windows integer)
312 (scroll-preserve-screen-position
313 windows (choice
314 (const :tag "Off (nil)" :value nil)
315 (const :tag "Full screen (t)" :value t)
316 (other :tag "Always" 1)) "22.1")
317 ;; xdisp.c
318 (scroll-step windows integer)
319 (scroll-conservatively windows integer)
320 (scroll-margin windows integer)
321 (hscroll-margin windows integer "22.1")
322 (hscroll-step windows number "22.1")
323 (truncate-partial-width-windows display boolean)
324 (mode-line-inverse-video mode-line boolean)
325 (mode-line-in-non-selected-windows mode-line boolean "22.1")
326 (line-number-display-limit display
327 (choice integer
328 (const :tag "No limit" nil)))
329 (line-number-display-limit-width display integer "22.1")
330 (highlight-nonselected-windows display boolean)
331 (message-log-max debug (choice (const :tag "Disable" nil)
332 (integer :menu-tag "lines"
333 :format "%v")
334 (other :tag "Unlimited" t)))
335 (unibyte-display-via-language-environment mule boolean)
336 (blink-cursor-alist cursor alist "22.1")
337 (overline-margin display integer "22.1")
338 (underline-minimum-offset display integer "23.1")
339 (mouse-autoselect-window
340 display (choice
341 (const :tag "Off (nil)" :value nil)
342 (const :tag "Immediate" :value t)
343 (number :tag "Delay by secs" :value 0.5)) "22.1")
344 ;; xfaces.c
345 (scalable-fonts-allowed display boolean "22.1")
346 ;; xfns.c
347 (x-bitmap-file-path installation
348 (repeat (directory :format "%v")))
349 (x-gtk-use-old-file-dialog menu boolean "22.1")
350 (x-gtk-show-hidden-files menu boolean "22.1")
351 (x-gtk-file-dialog-help-text menu boolean "22.1")
352 (x-gtk-whole-detached-tool-bar x boolean "22.1")
353 ;; xterm.c
354 (x-use-underline-position-properties display boolean "22.1")
355 (x-underline-at-descent-line display boolean "22.1")
356 (x-stretch-cursor display boolean "21.1")))
357 this symbol group type standard version native-p
358 ;; This function turns a value
359 ;; into an expression which produces that value.
360 (quoter (lambda (sexp)
361 (if (or (memq sexp '(t nil))
362 (keywordp sexp)
363 (and (listp sexp)
364 (memq (car sexp) '(lambda)))
365 (stringp sexp)
366 (numberp sexp))
367 sexp
368 (list 'quote sexp)))))
369 (while all
370 (setq this (car all)
371 all (cdr all)
372 symbol (nth 0 this)
373 group (nth 1 this)
374 type (nth 2 this)
375 version (nth 3 this)
376 ;; If we did not specify any standard value expression above,
377 ;; use the current value as the standard value.
378 standard (if (nthcdr 4 this)
379 (nth 4 this)
380 (when (default-boundp symbol)
381 (funcall quoter (default-value symbol))))
382 ;; Don't complain about missing variables which are
383 ;; irrelevant to this platform.
384 native-p (save-match-data
385 (cond
386 ((string-match "\\`dos-" (symbol-name symbol))
387 (eq system-type 'ms-dos))
388 ((string-match "\\`w32-" (symbol-name symbol))
389 (eq system-type 'windows-nt))
390 ((string-match "\\`mac-" (symbol-name symbol))
391 (featurep 'mac-carbon))
392 ((string-match "\\`x-.*gtk" (symbol-name symbol))
393 (featurep 'gtk))
394 ((string-match "\\`x-" (symbol-name symbol))
395 (fboundp 'x-create-frame))
396 ((string-match "selection" (symbol-name symbol))
397 (fboundp 'x-selection-exists-p))
398 ((string-match "fringe" (symbol-name symbol))
399 (fboundp 'define-fringe-bitmap))
400 (t t))))
401 (if (not (boundp symbol))
402 ;; If variables are removed from C code, give an error here!
403 (and native-p
404 (message "Note, built-in variable `%S' not bound" symbol))
405 ;; Save the standard value, unless we already did.
406 (or (get symbol 'standard-value)
407 (put symbol 'standard-value (list standard)))
408 ;; If this is NOT while dumping Emacs,
409 ;; set up the rest of the customization info.
410 (unless purify-flag
411 ;; Add it to the right group.
412 (custom-add-to-group group symbol 'custom-variable)
413 ;; Set the type.
414 (put symbol 'custom-type type)
415 (put symbol 'custom-version version)))))
416
417 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
418 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
419 'custom-variable)
420
421 ;; Record cus-start as loaded
422 ;; if we have set up all the info that we can set up.
423 ;; Don't record cus-start as loaded
424 ;; if we have set up only the standard values.
425 (unless purify-flag
426 (provide 'cus-start))
427
428 ;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
429 ;;; cus-start.el ends here