]> code.delx.au - gnu-emacs/blob - lisp/cus-start.el
(enum event_kind) [MAC_OS]: Update comment for MAC_APPLE_EVENT.
[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 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 2, 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 :tag "Single coding system"
126 :value undecided)
127 (function :value ignore))))
128 (selection-coding-system mule coding-system)
129 ;; dired.c
130 (completion-ignored-extensions dired
131 (repeat (string :format "%v")))
132 ;; dispnew.c
133 (baud-rate display integer)
134 (inverse-video display boolean)
135 (visible-bell display boolean)
136 (no-redraw-on-reenter display boolean)
137 ;; editfns.c
138 (user-full-name mail string)
139 ;; eval.c
140 (max-specpdl-size limits integer)
141 (max-lisp-eval-depth limits integer)
142 (stack-trace-on-error debug
143 (choice (const :tag "off")
144 (repeat :menu-tag "When"
145 :value (nil)
146 (symbol :format "%v"))
147 (const :tag "always" t)))
148 (debug-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-ignored-errors debug (repeat (choice symbol regexp)))
155 (debug-on-quit debug
156 (choice (const :tag "off")
157 (repeat :menu-tag "When"
158 :value (nil)
159 (symbol :format "%v"))
160 (const :tag "always" t)))
161 ;; fileio.c
162 (insert-default-directory minibuffer boolean)
163 (read-file-name-completion-ignore-case minibuffer boolean "22.1")
164 ;; fns.c
165 (use-dialog-box menu boolean "21.1")
166 (use-file-dialog menu boolean "22.1")
167 ;; frame.c
168 (default-frame-alist frames
169 (repeat (cons :format "%v"
170 (symbol :tag "Parameter")
171 (sexp :tag "Value"))))
172 (mouse-highlight mouse (choice (const :tag "disabled" nil)
173 (const :tag "always shown" t)
174 (other :tag "hidden by keypress" 1)))
175 ;; fringe.c
176 (overflow-newline-into-fringe fringe boolean)
177 ;; indent.c
178 (indent-tabs-mode fill boolean)
179 ;; keyboard.c
180 (meta-prefix-char keyboard character)
181 (auto-save-interval auto-save integer)
182 (auto-save-timeout auto-save (choice (const :tag "off" nil)
183 (integer :format "%v")))
184 (echo-keystrokes minibuffer number)
185 (polling-period keyboard integer)
186 (double-click-time mouse (restricted-sexp
187 :match-alternatives (integerp 'nil 't)))
188 (double-click-fuzz mouse integer)
189 (inhibit-local-menu-bar-menus menu boolean)
190 (help-char keyboard character)
191 (help-event-list keyboard (repeat (sexp :format "%v")))
192 (menu-prompting menu boolean)
193 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
194 (integer :tag "time" 2)
195 (other :tag "on")))
196 ;; macselect.c
197 (mac-dnd-known-types mac (repeat string) "22.1")
198 ;; macterm.c
199 (mac-control-modifier mac (choice (const :tag "No modifier" nil)
200 (const control) (const meta)
201 (const alt) (const hyper)
202 (const super)) "22.1")
203 (mac-command-modifier mac (choice (const :tag "No modifier" nil)
204 (const control) (const meta)
205 (const alt) (const hyper)
206 (const super)) "22.1")
207 (mac-option-modifier mac (choice (const :tag "No modifier (work as option)" nil)
208 (const control) (const meta)
209 (const alt) (const hyper)
210 (const super)) "22.1")
211 (mac-function-modifier mac
212 (choice (const :tag "No modifier (work as function)" nil)
213 (const control) (const meta)
214 (const alt) (const hyper)
215 (const super)) "22.1")
216 (mac-emulate-three-button-mouse mac
217 (choice (const :tag "No emulation" nil)
218 (const :tag "Option->2, Command->3" t)
219 (const :tag "Command->2, Option->3" reverse))
220 "22.1")
221 (mac-wheel-button-is-mouse-2 mac boolean "22.1")
222 (mac-pass-command-to-system mac boolean "22.1")
223 (mac-pass-control-to-system mac boolean "22.1")
224 (mac-allow-anti-aliasing mac boolean "22.1")
225
226 ;; This is not good news because it will use the wrong
227 ;; version-specific directories when you upgrade. We need
228 ;; customization of the front of the list, maintaining the standard
229 ;; value intact at the back.
230 ;;; (load-path environment
231 ;;; (repeat (choice :tag "[Current dir?]"
232 ;;; :format "%[Current dir?%] %v"
233 ;;; (const :tag " current dir" nil)
234 ;;; (directory :format "%v"))))
235 ;; minibuf.c
236 (completion-auto-help minibuffer boolean)
237 (enable-recursive-minibuffers minibuffer boolean)
238 (history-length minibuffer
239 (choice (const :tag "Infinite" t)
240 integer))
241 (history-delete-duplicates minibuffer boolean)
242 (minibuffer-prompt-properties
243 minibuffer
244 (list
245 (checklist :inline t
246 (const :tag "Read-Only"
247 :doc "Prevent prompt from being modified"
248 :format "%t%n%h"
249 :inline t
250 (read-only t))
251 (const :tag "Don't Enter"
252 :doc "Prevent point from ever entering prompt"
253 :format "%t%n%h"
254 :inline t
255 (point-entered minibuffer-avoid-prompt)))
256 (repeat :inline t
257 :tag "Other Properties"
258 (list :inline t
259 :format "%v"
260 (symbol :tag "Property")
261 (sexp :tag "Value"))))
262 "21.1")
263 (minibuffer-auto-raise minibuffer boolean)
264 ;; options property set at end
265 (read-buffer-function minibuffer
266 (choice (const nil)
267 (function-item iswitchb-read-buffer)
268 function))
269 ;; msdos.c
270 (dos-unsupported-char-glyph display integer)
271 ;; process.c
272 (delete-exited-processes processes-basics boolean)
273 ;; syntax.c
274 (parse-sexp-ignore-comments editing-basics boolean)
275 (words-include-escapes editing-basics boolean)
276 (open-paren-in-column-0-is-defun-start editing-basics boolean
277 "21.1")
278 ;; term.c
279 (visible-cursor cursor boolean "22.1")
280 ;; undo.c
281 (undo-limit undo integer)
282 (undo-strong-limit undo integer)
283 (undo-outer-limit undo
284 (choice integer
285 (const :tag "No limit"
286 :format "%t\n%d"
287 :doc
288 "With this choice, \
289 the undo info for the current command never gets discarded.
290 This should only be chosen under exceptional circumstances,
291 since it could result in memory overflow and make Emacs crash."
292 nil))
293 "22.1")
294 ;; window.c
295 (temp-buffer-show-function windows (choice (const nil) function))
296 (display-buffer-function windows (choice (const nil) function))
297 (pop-up-frames frames boolean)
298 (pop-up-frame-function frames function)
299 (special-display-buffer-names
300 frames
301 (repeat (choice :tag "Buffer"
302 :value ""
303 (string :format "%v")
304 (cons :tag "With attributes"
305 :format "%v"
306 :value ("" . nil)
307 (string :format "%v")
308 (repeat :tag "Attributes"
309 (cons :format "%v"
310 (symbol :tag "Parameter")
311 (sexp :tag "Value")))))))
312 (special-display-regexps
313 frames
314 (repeat (choice :tag "Buffer"
315 :value ""
316 (regexp :format "%v")
317 (cons :tag "With attributes"
318 :format "%v"
319 :value ("" . nil)
320 (regexp :format "%v")
321 (repeat :tag "Attributes"
322 (cons :format "%v"
323 (symbol :tag "Parameter")
324 (sexp :tag "Value")))))))
325 (special-display-function frames function)
326 (same-window-buffer-names windows (repeat (string :format "%v")))
327 (same-window-regexps windows (repeat (regexp :format "%v")))
328 (pop-up-windows windows boolean)
329 (even-window-heights windows boolean)
330 (next-screen-context-lines windows integer)
331 (split-height-threshold windows integer)
332 (window-min-height windows integer)
333 (window-min-width windows integer)
334 (scroll-preserve-screen-position windows boolean)
335 (display-buffer-reuse-frames windows boolean "21.1")
336 ;; xdisp.c
337 (scroll-step windows integer)
338 (scroll-conservatively windows integer)
339 (scroll-margin windows integer)
340 (hscroll-margin windows integer "21.3")
341 (hscroll-step windows number "21.3")
342 (truncate-partial-width-windows display boolean)
343 (mode-line-inverse-video modeline boolean)
344 (mode-line-in-non-selected-windows modeline boolean "21.3")
345 (line-number-display-limit display
346 (choice integer
347 (const :tag "No limit" nil)))
348 (line-number-display-limit-width display integer)
349 (highlight-nonselected-windows display boolean)
350 (message-log-max debug (choice (const :tag "Disable" nil)
351 (integer :menu-tag "lines"
352 :format "%v")
353 (other :tag "Unlimited" t)))
354 (unibyte-display-via-language-environment mule boolean)
355 (blink-cursor-alist cursor alist "22.1")
356 ;; xfaces.c
357 (scalable-fonts-allowed display boolean)
358 ;; xfns.c
359 (x-bitmap-file-path installation
360 (repeat (directory :format "%v")))
361 (x-use-old-gtk-file-dialog menu boolean "22.1")
362 (x-gtk-show-hidden-files menu boolean "22.1")
363 (x-gtk-whole-detached-tool-bar x boolean "22.1")
364 ;; xterm.c
365 (mouse-autoselect-window display boolean "21.3")
366 (x-use-underline-position-properties display boolean "21.3")
367 (x-stretch-cursor display boolean "21.1")))
368 this symbol group type standard version native-p
369 ;; This function turns a value
370 ;; into an expression which produces that value.
371 (quoter (lambda (sexp)
372 (if (or (memq sexp '(t nil))
373 (keywordp sexp)
374 (and (listp sexp)
375 (memq (car sexp) '(lambda)))
376 (stringp sexp)
377 (numberp sexp))
378 sexp
379 (list 'quote sexp)))))
380 (while all
381 (setq this (car all)
382 all (cdr all)
383 symbol (nth 0 this)
384 group (nth 1 this)
385 type (nth 2 this)
386 version (nth 3 this)
387 ;; If we did not specify any standard value expression above,
388 ;; use the current value as the standard value.
389 standard (if (nthcdr 4 this)
390 (nth 4 this)
391 (when (default-boundp symbol)
392 (funcall quoter (default-value symbol))))
393 ;; Don't complain about missing variables which are
394 ;; irrelevant to this platform.
395 native-p (save-match-data
396 (cond
397 ((string-match "\\`dos-" (symbol-name symbol))
398 (eq system-type 'ms-dos))
399 ((string-match "\\`w32-" (symbol-name symbol))
400 (eq system-type 'windows-nt))
401 ((string-match "\\`mac-" (symbol-name symbol))
402 (eq window-system 'mac))
403 ((string-match "\\`x-.*gtk" (symbol-name symbol))
404 (or (boundp 'gtk)
405 (and window-system
406 (not (eq window-system 'pc))
407 (not (eq window-system 'mac))
408 (not (eq system-type 'windows-nt)))))
409 ((string-match "\\`x-" (symbol-name symbol))
410 (fboundp 'x-create-frame))
411 ((string-match "selection" (symbol-name symbol))
412 (fboundp 'x-selection-exists-p))
413 ((string-match "fringe" (symbol-name symbol))
414 (fboundp 'define-fringe-bitmap))
415 (t t))))
416 (if (not (boundp symbol))
417 ;; If variables are removed from C code, give an error here!
418 (and native-p
419 (message "Note, built-in variable `%S' not bound" symbol))
420 ;; Save the standard value, unless we already did.
421 (or (get symbol 'standard-value)
422 (put symbol 'standard-value (list standard)))
423 ;; If this is NOT while dumping Emacs,
424 ;; set up the rest of the customization info.
425 (unless purify-flag
426 ;; Add it to the right group.
427 (custom-add-to-group group symbol 'custom-variable)
428 ;; Set the type.
429 (put symbol 'custom-type type)
430 (put symbol 'custom-version version)))))
431
432 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
433 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
434 'custom-variable)
435 (put 'selection-coding-system 'custom-set
436 (lambda (symbol value)
437 (set-selection-coding-system value)
438 (set symbol value)))
439
440 ;; Record cus-start as loaded
441 ;; if we have set up all the info that we can set up.
442 ;; Don't record cus-start as loaded
443 ;; if we have set up only the standard values.
444 (unless purify-flag
445 (provide 'cus-start))
446
447 ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
448 ;;; cus-start.el ends here