]> code.delx.au - gnu-emacs/blob - lisp/cus-start.el
(compilation-mode-map): Bind TAB to `compilation-next-error'
[gnu-emacs] / lisp / cus-start.el
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
7
8 ;; This file is part of GNU Emacs.
9
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.
14
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.
19
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., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Commentary:
26 ;;
27 ;; This file adds customize support for built-in variables.
28
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.
34
35 ;;; Code:
36
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 fringe boolean "21.1")
69 (indicate-buffer-boundaries
70 fringe
71 (choice
72 (const :tag "No indicators" nil)
73 (const :tag "On left, with arrows" left)
74 (const :tag "On right, with arrows" right)
75 (set :tag "Pick your own design"
76 :value ((t . nil))
77 :format "%{%t%}:\n%v\n%d"
78 :doc "You can specify a default and then override it \
79 for individual indicators.
80 Leaving \"Default\" unchecked is equivalent with specifying a default of
81 \"Do not show\"."
82 (choice :tag "Default"
83 :value (t . nil)
84 (const :tag "Do not show" (t . nil))
85 (const :tag "On the left" (t . left))
86 (const :tag "On the right" (t . right)))
87 (choice :tag "Top"
88 :value (top . left)
89 (const :tag "Do not show" (top . nil))
90 (const :tag "On the left" (top . left))
91 (const :tag "On the right" (top . right)))
92 (choice :tag "Bottom"
93 :value (bottom . left)
94 (const :tag "Do not show" (bottom . nil))
95 (const :tag "On the left" (bottom . left))
96 (const :tag "On the right" (bottom . right)))
97 (choice :tag "Up arrow"
98 :value (up . left)
99 (const :tag "Do not show" (up . nil))
100 (const :tag "On the left" (up . left))
101 (const :tag "On the right" (up . right)))
102 (choice :tag "Down arrow"
103 :value (down . left)
104 (const :tag "Do not show" (down . nil))
105 (const :tag "On the left" (down . left))
106 (const :tag "On the right" (down . right))))
107 (other :tag "On left, no arrows" t))
108 "22.1")
109 (scroll-up-aggressively windows
110 (choice (const :tag "off" nil) number)
111 "21.1")
112 (scroll-down-aggressively windows
113 (choice (const :tag "off" nil) number)
114 "21.1")
115 ;; callint.c
116 (mark-even-if-inactive editing-basics boolean)
117 ;; callproc.c
118 (shell-file-name execute file)
119 (exec-path execute
120 (repeat (choice (const :tag "default directory" nil)
121 (directory :format "%v"))))
122 ;; coding.c
123 (inhibit-eol-conversion mule boolean)
124 (eol-mnemonic-undecided mule string)
125 (eol-mnemonic-unix mule string)
126 (eol-mnemonic-dos mule string)
127 (eol-mnemonic-mac mule string)
128 (file-coding-system-alist
129 mule
130 (alist
131 :key-type (regexp :tag "File regexp")
132 :value-type (choice
133 :value (undecided . undecided)
134 (cons :tag "Encoding/decoding pair"
135 :value (undecided . undecided)
136 (coding-system :tag "Decoding")
137 (coding-system :tag "Encoding"))
138 (coding-system :tag "Single coding system"
139 :value undecided)
140 (function :value ignore))))
141 (selection-coding-system mule coding-system)
142 ;; dired.c
143 (completion-ignored-extensions dired
144 (repeat (string :format "%v")))
145 ;; dispnew.c
146 (baud-rate display integer)
147 (inverse-video display boolean)
148 (visible-bell display boolean)
149 (no-redraw-on-reenter display boolean)
150 ;; editfns.c
151 (user-full-name mail string)
152 ;; eval.c
153 (max-specpdl-size limits integer)
154 (max-lisp-eval-depth limits integer)
155 (stack-trace-on-error debug
156 (choice (const :tag "off")
157 (repeat :menu-tag "When"
158 :value (nil)
159 (symbol :format "%v"))
160 (const :tag "always" t)))
161 (debug-on-error debug
162 (choice (const :tag "off")
163 (repeat :menu-tag "When"
164 :value (nil)
165 (symbol :format "%v"))
166 (const :tag "always" t)))
167 (debug-ignored-errors debug (repeat (choice symbol regexp)))
168 (debug-on-quit debug
169 (choice (const :tag "off")
170 (repeat :menu-tag "When"
171 :value (nil)
172 (symbol :format "%v"))
173 (const :tag "always" t)))
174 ;; fileio.c
175 (insert-default-directory minibuffer boolean)
176 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
177 ;; fns.c
178 (use-dialog-box menu boolean "21.1")
179 (use-file-dialog menu boolean "22.1")
180 ;; frame.c
181 (default-frame-alist frames
182 (repeat (cons :format "%v"
183 (symbol :tag "Parameter")
184 (sexp :tag "Value"))))
185 (mouse-highlight mouse (choice (const :tag "disabled" nil)
186 (const :tag "always shown" t)
187 (other :tag "hidden by keypress" 1)))
188 ;; indent.c
189 (indent-tabs-mode fill boolean)
190 ;; keyboard.c
191 (meta-prefix-char keyboard character)
192 (auto-save-interval auto-save integer)
193 (auto-save-timeout auto-save (choice (const :tag "off" nil)
194 (integer :format "%v")))
195 (echo-keystrokes minibuffer number)
196 (polling-period keyboard integer)
197 (double-click-time mouse (restricted-sexp
198 :match-alternatives (integerp 'nil 't)))
199 (double-click-fuzz mouse integer)
200 (inhibit-local-menu-bar-menus menu boolean)
201 (help-char keyboard character)
202 (help-event-list keyboard (repeat (sexp :format "%v")))
203 (menu-prompting menu boolean)
204 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
205 (integer :tag "time" 2)
206 (other :tag "on")))
207
208 ;; This is not good news because it will use the wrong
209 ;; version-specific directories when you upgrade. We need
210 ;; customization of the front of the list, maintaining the standard
211 ;; value intact at the back.
212 ;;; (load-path environment
213 ;;; (repeat (choice :tag "[Current dir?]"
214 ;;; :format "%[Current dir?%] %v"
215 ;;; (const :tag " current dir" nil)
216 ;;; (directory :format "%v"))))
217 ;; minibuf.c
218 (completion-auto-help minibuffer boolean)
219 (enable-recursive-minibuffers minibuffer boolean)
220 (history-length minibuffer
221 (choice (const :tag "Infinite" t)
222 integer))
223 (history-delete-duplicates minibuffer boolean)
224 (minibuffer-prompt-properties
225 minibuffer
226 (list
227 (checklist :inline t
228 (const :tag "Read-Only"
229 :doc "Prevent prompt from being modified"
230 :format "%t%n%h"
231 :inline t
232 (read-only t))
233 (const :tag "Inviolable"
234 :doc "Prevent point from ever entering prompt"
235 :format "%t%n%h"
236 :inline t
237 (point-entered minibuffer-avoid-prompt)))
238 (repeat :inline t
239 :tag "Other Properties"
240 (list :inline t
241 :format "%v"
242 (symbol :tag "Property")
243 (sexp :tag "Value"))))
244 "21.1")
245 (minibuffer-auto-raise minibuffer boolean)
246 ;; options property set at end
247 (read-buffer-function minibuffer
248 (choice (const nil)
249 (function-item iswitchb-read-buffer)
250 function))
251 ;; msdos.c
252 (dos-unsupported-char-glyph display integer)
253 ;; process.c
254 (delete-exited-processes processes-basics boolean)
255 ;; syntax.c
256 (parse-sexp-ignore-comments editing-basics boolean)
257 (words-include-escapes editing-basics boolean)
258 (open-paren-in-column-0-is-defun-start editing-basics boolean
259 "21.1")
260 ;; window.c
261 (temp-buffer-show-function windows (choice (const nil) function))
262 (display-buffer-function windows (choice (const nil) function))
263 (pop-up-frames frames boolean)
264 (pop-up-frame-function frames function)
265 (special-display-buffer-names
266 frames
267 (repeat (choice :tag "Buffer"
268 :value ""
269 (string :format "%v")
270 (cons :tag "With attributes"
271 :format "%v"
272 :value ("" . nil)
273 (string :format "%v")
274 (repeat :tag "Attributes"
275 (cons :format "%v"
276 (symbol :tag "Parameter")
277 (sexp :tag "Value")))))))
278 (special-display-regexps
279 frames
280 (repeat (choice :tag "Buffer"
281 :value ""
282 (regexp :format "%v")
283 (cons :tag "With attributes"
284 :format "%v"
285 :value ("" . nil)
286 (regexp :format "%v")
287 (repeat :tag "Attributes"
288 (cons :format "%v"
289 (symbol :tag "Parameter")
290 (sexp :tag "Value")))))))
291 (special-display-function frames function)
292 (same-window-buffer-names windows (repeat (string :format "%v")))
293 (same-window-regexps windows (repeat (regexp :format "%v")))
294 (pop-up-windows windows boolean)
295 (even-window-heights windows boolean)
296 (next-screen-context-lines windows integer)
297 (split-height-threshold windows integer)
298 (window-min-height windows integer)
299 (window-min-width windows integer)
300 (scroll-preserve-screen-position windows boolean)
301 (display-buffer-reuse-frames windows boolean "21.1")
302 ;; xdisp.c
303 (scroll-step windows integer)
304 (scroll-conservatively windows integer)
305 (scroll-margin windows integer)
306 (hscroll-margin windows integer "21.3")
307 (hscroll-step windows number "21.3")
308 (truncate-partial-width-windows display boolean)
309 (mode-line-inverse-video modeline boolean)
310 (mode-line-in-non-selected-windows modeline boolean "21.3")
311 (line-number-display-limit display
312 (choice integer
313 (const :tag "No limit" nil)))
314 (line-number-display-limit-width display integer)
315 (highlight-nonselected-windows display boolean)
316 (message-log-max debug (choice (const :tag "Disable" nil)
317 (integer :menu-tag "lines"
318 :format "%v")
319 (other :tag "Unlimited" t)))
320 (unibyte-display-via-language-environment mule boolean)
321 (blink-cursor-alist cursor alist "22.1")
322 ;; xfaces.c
323 (scalable-fonts-allowed display boolean)
324 ;; xfns.c
325 (x-bitmap-file-path installation
326 (repeat (directory :format "%v")))
327 (x-use-old-gtk-file-dialog menu boolean "22.1")
328 ;; xterm.c
329 (mouse-autoselect-window display boolean "21.3")
330 (x-use-underline-position-properties display boolean "21.3")
331 (x-stretch-cursor display boolean "21.1")))
332 this symbol group type standard version native-p
333 ;; This function turns a value
334 ;; into an expression which produces that value.
335 (quoter (lambda (sexp)
336 (if (or (memq sexp '(t nil))
337 (keywordp sexp)
338 (and (listp sexp)
339 (memq (car sexp) '(lambda)))
340 (stringp sexp)
341 (numberp sexp))
342 sexp
343 (list 'quote sexp)))))
344 (while all
345 (setq this (car all)
346 all (cdr all)
347 symbol (nth 0 this)
348 group (nth 1 this)
349 type (nth 2 this)
350 version (nth 3 this)
351 ;; If we did not specify any standard value expression above,
352 ;; use the current value as the standard value.
353 standard (if (nthcdr 4 this)
354 (nth 4 this)
355 (when (default-boundp symbol)
356 (funcall quoter (default-value symbol))))
357 ;; Don't complain about missing variables which are
358 ;; irrelevant to this platform.
359 native-p (save-match-data
360 (cond
361 ((string-match "\\`dos-" (symbol-name symbol))
362 (eq system-type 'ms-dos))
363 ((string-match "\\`w32-" (symbol-name symbol))
364 (eq system-type 'windows-nt))
365 ((string-match "\\`x-.*gtk" (symbol-name symbol))
366 (or (boundp 'gtk) (not (eq system-type 'windows-nt))))
367 ((string-match "\\`x-" (symbol-name symbol))
368 (fboundp 'x-create-frame))
369 (t t))))
370 (if (not (boundp symbol))
371 ;; If variables are removed from C code, give an error here!
372 (and native-p
373 (message "Note, built-in variable `%S' not bound" symbol))
374 ;; Save the standard value, unless we already did.
375 (or (get symbol 'standard-value)
376 (put symbol 'standard-value (list standard)))
377 ;; If this is NOT while dumping Emacs,
378 ;; set up the rest of the customization info.
379 (unless purify-flag
380 ;; Add it to the right group.
381 (custom-add-to-group group symbol 'custom-variable)
382 ;; Set the type.
383 (put symbol 'custom-type type)
384 (put symbol 'custom-version version)))))
385
386 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
387 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
388 'custom-variable)
389 (put 'selection-coding-system 'custom-set
390 (lambda (symbol value)
391 (set-selection-coding-system value)
392 (set symbol value)))
393
394 ;; Record cus-start as loaded
395 ;; if we have set up all the info that we can set up.
396 ;; Don't record cus-start as loaded
397 ;; if we have set up only the standard values.
398 (unless purify-flag
399 (provide 'cus-start))
400
401 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
402 ;;; cus-start.el ends here