]> code.delx.au - gnu-emacs/blob - lisp/cus-start.el
Merge from emacs--devo--0
[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 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, or (at your option)
14 ;; 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; 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.
25
26 ;;; Commentary:
27 ;;
28 ;; This file adds customize support for built-in variables.
29
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.
35
36 ;;; Code:
37
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)
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 (scroll-up-aggressively windows
96 (choice (const :tag "off" nil) number)
97 "21.1")
98 (scroll-down-aggressively windows
99 (choice (const :tag "off" nil) number)
100 "21.1")
101 (line-spacing display (choice (const :tag "none" nil) integer))
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
126 :tag "Single coding system"
127 :value undecided
128 :match (lambda (widget value)
129 (and value (not (functionp value)))))
130 (function :value ignore))))
131 (selection-coding-system mule coding-system)
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))
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 (insert-default-directory minibuffer boolean)
169 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
170 ;; fns.c
171 (use-dialog-box menu boolean "21.1")
172 (use-file-dialog menu boolean "22.1")
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 ;; fringe.c
182 (overflow-newline-into-fringe fringe boolean)
183 ;; indent.c
184 (indent-tabs-mode indent boolean)
185 ;; keyboard.c
186 (meta-prefix-char keyboard character)
187 (auto-save-interval auto-save integer)
188 (auto-save-timeout auto-save (choice (const :tag "off" nil)
189 (integer :format "%v")))
190 (echo-keystrokes minibuffer number)
191 (polling-period keyboard integer)
192 (double-click-time mouse (restricted-sexp
193 :match-alternatives (integerp 'nil 't)))
194 (double-click-fuzz mouse integer)
195 (inhibit-local-menu-bar-menus menu boolean)
196 (help-char keyboard character)
197 (help-event-list keyboard (repeat (sexp :format "%v")))
198 (menu-prompting menu boolean)
199 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
200 (integer :tag "time" 2)
201 (other :tag "on")))
202 ;; macselect.c
203 (mac-dnd-known-types mac (repeat string) "22.1")
204 ;; macterm.c
205 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
206 (const control) (const meta)
207 (const alt) (const hyper)
208 (const super)) "22.1")
209 (mac-command-modifier mac (choice (const :tag "No modifier" nil)
210 (const control) (const meta)
211 (const alt) (const hyper)
212 (const super)) "22.1")
213 (mac-option-modifier mac (choice (const :tag "No modifier (work as option)" nil)
214 (const control) (const meta)
215 (const alt) (const hyper)
216 (const super)) "22.1")
217 (mac-function-modifier mac
218 (choice (const :tag "No modifier (work as function)" nil)
219 (const control) (const meta)
220 (const alt) (const hyper)
221 (const super)) "22.1")
222 (mac-emulate-three-button-mouse mac
223 (choice (const :tag "No emulation" nil)
224 (const :tag "Option->2, Command->3" t)
225 (const :tag "Command->2, Option->3" reverse))
226 "22.1")
227 (mac-wheel-button-is-mouse-2 mac boolean "22.1")
228 (mac-pass-command-to-system mac boolean "22.1")
229 (mac-pass-control-to-system mac boolean "22.1")
230 (mac-allow-anti-aliasing mac boolean "22.1")
231 (mac-ts-script-language-on-focus mac
232 (choice (const :tag "System default behavior" nil)
233 (const :tag "Restore to script/language used in the last focus frame" t)
234 (cons :tag "Specify script/language"
235 (integer :tag "Script code")
236 (integer :tag "Language code")))
237 "22.1")
238
239 ;; This is not good news because it will use the wrong
240 ;; version-specific directories when you upgrade. We need
241 ;; customization of the front of the list, maintaining the standard
242 ;; value intact at the back.
243 ;;; (load-path environment
244 ;;; (repeat (choice :tag "[Current dir?]"
245 ;;; :format "%[Current dir?%] %v"
246 ;;; (const :tag " current dir" nil)
247 ;;; (directory :format "%v"))))
248 ;; minibuf.c
249 (completion-auto-help minibuffer boolean)
250 (enable-recursive-minibuffers minibuffer boolean)
251 (history-length minibuffer
252 (choice (const :tag "Infinite" t)
253 integer))
254 (history-delete-duplicates minibuffer boolean)
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 (display-buffer-function windows (choice (const nil) function))
310 (pop-up-frames frames boolean)
311 (pop-up-frame-function frames function)
312 (special-display-buffer-names
313 frames
314 (repeat (choice :tag "Buffer"
315 :value ""
316 (string :format "%v")
317 (cons :tag "With attributes"
318 :format "%v"
319 :value ("" . nil)
320 (string :format "%v")
321 (repeat :tag "Attributes"
322 (cons :format "%v"
323 (symbol :tag "Parameter")
324 (sexp :tag "Value")))))))
325 (special-display-regexps
326 frames
327 (repeat (choice :tag "Buffer"
328 :value ""
329 (regexp :format "%v")
330 (cons :tag "With attributes"
331 :format "%v"
332 :value ("" . nil)
333 (regexp :format "%v")
334 (repeat :tag "Attributes"
335 (cons :format "%v"
336 (symbol :tag "Parameter")
337 (sexp :tag "Value")))))))
338 (special-display-function frames function)
339 (same-window-buffer-names windows (repeat (string :format "%v")))
340 (same-window-regexps windows (repeat (regexp :format "%v")))
341 (pop-up-windows windows boolean)
342 (even-window-heights windows boolean)
343 (next-screen-context-lines windows integer)
344 (split-height-threshold windows integer)
345 (window-min-height windows integer)
346 (window-min-width windows integer)
347 (scroll-preserve-screen-position
348 windows (choice
349 (const :tag "Off (nil)" :value nil)
350 (const :tag "Full screen (t)" :value t)
351 (other :tag "Always" 1)))
352 (display-buffer-reuse-frames windows boolean "21.1")
353 ;; xdisp.c
354 (scroll-step windows integer)
355 (scroll-conservatively windows integer)
356 (scroll-margin windows integer)
357 (hscroll-margin windows integer "22.1")
358 (hscroll-step windows number "22.1")
359 (truncate-partial-width-windows display boolean)
360 (mode-line-inverse-video modeline boolean)
361 (mode-line-in-non-selected-windows modeline boolean "22.1")
362 (line-number-display-limit display
363 (choice integer
364 (const :tag "No limit" nil)))
365 (line-number-display-limit-width display integer)
366 (highlight-nonselected-windows display boolean)
367 (message-log-max debug (choice (const :tag "Disable" nil)
368 (integer :menu-tag "lines"
369 :format "%v")
370 (other :tag "Unlimited" t)))
371 (unibyte-display-via-language-environment mule boolean)
372 (blink-cursor-alist cursor alist "22.1")
373 (overline-margin display integer "22.1")
374 (mouse-autoselect-window
375 display (choice
376 (const :tag "Off (nil)" :value nil)
377 (const :tag "Immediate" :value t)
378 (number :tag "Delay by secs" :value 0.5)) "22.1")
379 ;; xfaces.c
380 (scalable-fonts-allowed display boolean)
381 ;; xfns.c
382 (x-bitmap-file-path installation
383 (repeat (directory :format "%v")))
384 (x-gtk-use-old-file-dialog menu boolean "22.1")
385 (x-gtk-show-hidden-files menu boolean "22.1")
386 (x-gtk-file-dialog-help-text menu boolean "22.1")
387 (x-gtk-whole-detached-tool-bar x boolean "22.1")
388 ;; xterm.c
389 (x-use-underline-position-properties display boolean "22.1")
390 (x-underline-at-descent-line display boolean "22.1")
391 (x-stretch-cursor display boolean "21.1")))
392 this symbol group type standard version native-p
393 ;; This function turns a value
394 ;; into an expression which produces that value.
395 (quoter (lambda (sexp)
396 (if (or (memq sexp '(t nil))
397 (keywordp sexp)
398 (and (listp sexp)
399 (memq (car sexp) '(lambda)))
400 (stringp sexp)
401 (numberp sexp))
402 sexp
403 (list 'quote sexp)))))
404 (while all
405 (setq this (car all)
406 all (cdr all)
407 symbol (nth 0 this)
408 group (nth 1 this)
409 type (nth 2 this)
410 version (nth 3 this)
411 ;; If we did not specify any standard value expression above,
412 ;; use the current value as the standard value.
413 standard (if (nthcdr 4 this)
414 (nth 4 this)
415 (when (default-boundp symbol)
416 (funcall quoter (default-value symbol))))
417 ;; Don't complain about missing variables which are
418 ;; irrelevant to this platform.
419 native-p (save-match-data
420 (cond
421 ((string-match "\\`dos-" (symbol-name symbol))
422 (eq system-type 'ms-dos))
423 ((string-match "\\`w32-" (symbol-name symbol))
424 (eq system-type 'windows-nt))
425 ((string-match "\\`mac-" (symbol-name symbol))
426 (or (eq system-type 'mac) (eq system-type 'darwin)))
427 ((string-match "\\`x-.*gtk" (symbol-name symbol))
428 (featurep 'gtk))
429 ((string-match "\\`x-" (symbol-name symbol))
430 (fboundp 'x-create-frame))
431 ((string-match "selection" (symbol-name symbol))
432 (fboundp 'x-selection-exists-p))
433 ((string-match "fringe" (symbol-name symbol))
434 (fboundp 'define-fringe-bitmap))
435 (t t))))
436 (if (not (boundp symbol))
437 ;; If variables are removed from C code, give an error here!
438 (and native-p
439 (message "Note, built-in variable `%S' not bound" symbol))
440 ;; Save the standard value, unless we already did.
441 (or (get symbol 'standard-value)
442 (put symbol 'standard-value (list standard)))
443 ;; If this is NOT while dumping Emacs,
444 ;; set up the rest of the customization info.
445 (unless purify-flag
446 ;; Add it to the right group.
447 (custom-add-to-group group symbol 'custom-variable)
448 ;; Set the type.
449 (put symbol 'custom-type type)
450 (put symbol 'custom-version version)))))
451
452 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
453 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
454 'custom-variable)
455 (put 'selection-coding-system 'custom-set
456 (lambda (symbol value)
457 (set-selection-coding-system value)
458 (set symbol value)))
459
460 ;; Record cus-start as loaded
461 ;; if we have set up all the info that we can set up.
462 ;; Don't record cus-start as loaded
463 ;; if we have set up only the standard values.
464 (unless purify-flag
465 (provide 'cus-start))
466
467 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
468 ;;; cus-start.el ends here