Commit | Line | Data |
---|---|---|
1cd7adc6 | 1 | ;;; cus-start.el --- define customization properties of builtins |
1444b0c0 | 2 | ;; |
92233e7e | 3 | ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. |
1444b0c0 PA |
4 | ;; |
5 | ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | |
6 | ;; Keywords: internal | |
7 | ||
c2383d2d RS |
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 | |
086add15 LK |
22 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 | ;; Boston, MA 02110-1301, USA. | |
c2383d2d | 24 | |
1444b0c0 PA |
25 | ;;; Commentary: |
26 | ;; | |
4883633e | 27 | ;; This file adds customize support for built-in variables. |
1444b0c0 | 28 | |
4883633e RS |
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. | |
1444b0c0 | 34 | |
4883633e | 35 | ;;; Code: |
1444b0c0 | 36 | |
71296446 | 37 | (let ((all '(;; abbrev.c |
1444b0c0 PA |
38 | (abbrev-all-caps abbrev-mode boolean) |
39 | (pre-abbrev-expand-hook abbrev-mode hook) | |
40 | ;; alloc.c | |
41 | (gc-cons-threshold alloc integer) | |
0f014aa1 LT |
42 | (garbage-collection-messages alloc boolean) |
43 | ;; undo.c | |
1444b0c0 PA |
44 | (undo-limit undo integer) |
45 | (undo-strong-limit undo integer) | |
3bf93f74 LT |
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)) | |
bf247b6e | 56 | "22.1") |
1444b0c0 PA |
57 | ;; buffer.c |
58 | (mode-line-format modeline sexp) ;Hard to do right. | |
59 | (default-major-mode internal function) | |
924ef223 | 60 | (enable-multibyte-characters mule boolean) |
1444b0c0 PA |
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) | |
1444b0c0 | 67 | (selective-display-ellipses display boolean) |
eb94dac6 LT |
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) | |
52a434fd LT |
75 | (list :tag "Pick your own design" |
76 | :value ((t . nil)) | |
77 | (choice :tag "Default" | |
78 | (const :tag "Do not show" (t . nil)) | |
79 | (const :tag "On the left" (t . left)) | |
80 | (const :tag "On the right" (t . right))) | |
81 | (set :inline t | |
82 | :tag "Override default for" | |
83 | (choice :tag "Top" | |
84 | :value (top . left) | |
85 | (const :tag "Do not show" (top . nil)) | |
86 | (const :tag "On the left" (top . left)) | |
87 | (const :tag "On the right" (top . right))) | |
88 | (choice :tag "Bottom" | |
89 | :value (bottom . left) | |
90 | (const :tag "Do not show" (bottom . nil)) | |
91 | (const :tag "On the left" (bottom . left)) | |
92 | (const :tag "On the right" (bottom . right))) | |
93 | (choice :tag "Up arrow" | |
94 | :value (up . left) | |
95 | (const :tag "Do not show" (up . nil)) | |
96 | (const :tag "On the left" (up . left)) | |
97 | (const :tag "On the right" (up . right))) | |
98 | (choice :tag "Down arrow" | |
99 | :value (down . left) | |
100 | (const :tag "Do not show" (down . nil)) | |
101 | (const :tag "On the left" (down . left)) | |
102 | (const :tag "On the right" (down . right))))) | |
3233c063 | 103 | (other :tag "On left, no arrows" t)) |
eb94dac6 | 104 | "22.1") |
c6d57325 RS |
105 | (scroll-up-aggressively windows |
106 | (choice (const :tag "off" nil) number) | |
107 | "21.1") | |
108 | (scroll-down-aggressively windows | |
109 | (choice (const :tag "off" nil) number) | |
110 | "21.1") | |
1444b0c0 PA |
111 | ;; callint.c |
112 | (mark-even-if-inactive editing-basics boolean) | |
113 | ;; callproc.c | |
114 | (shell-file-name execute file) | |
115 | (exec-path execute | |
f747a488 | 116 | (repeat (choice (const :tag "default directory" nil) |
72e869ba | 117 | (directory :format "%v")))) |
5fc9eb7c DL |
118 | ;; coding.c |
119 | (inhibit-eol-conversion mule boolean) | |
de0d1fc5 EZ |
120 | (eol-mnemonic-undecided mule string) |
121 | (eol-mnemonic-unix mule string) | |
122 | (eol-mnemonic-dos mule string) | |
123 | (eol-mnemonic-mac mule string) | |
13eb63ff DL |
124 | (file-coding-system-alist |
125 | mule | |
126 | (alist | |
127 | :key-type (regexp :tag "File regexp") | |
128 | :value-type (choice | |
129 | :value (undecided . undecided) | |
130 | (cons :tag "Encoding/decoding pair" | |
131 | :value (undecided . undecided) | |
132 | (coding-system :tag "Decoding") | |
133 | (coding-system :tag "Encoding")) | |
134 | (coding-system :tag "Single coding system" | |
135 | :value undecided) | |
136 | (function :value ignore)))) | |
e5f51929 | 137 | (selection-coding-system mule coding-system) |
1444b0c0 | 138 | ;; dired.c |
71296446 | 139 | (completion-ignored-extensions dired |
1444b0c0 | 140 | (repeat (string :format "%v"))) |
0849a37e | 141 | ;; dispnew.c |
1444b0c0 PA |
142 | (baud-rate display integer) |
143 | (inverse-video display boolean) | |
144 | (visible-bell display boolean) | |
145 | (no-redraw-on-reenter display boolean) | |
146 | ;; editfns.c | |
147 | (user-full-name mail string) | |
148 | ;; eval.c | |
149 | (max-specpdl-size limits integer) | |
150 | (max-lisp-eval-depth limits integer) | |
151 | (stack-trace-on-error debug | |
152 | (choice (const :tag "off") | |
153 | (repeat :menu-tag "When" | |
154 | :value (nil) | |
155 | (symbol :format "%v")) | |
156 | (const :tag "always" t))) | |
71296446 | 157 | (debug-on-error debug |
1444b0c0 PA |
158 | (choice (const :tag "off") |
159 | (repeat :menu-tag "When" | |
160 | :value (nil) | |
161 | (symbol :format "%v")) | |
162 | (const :tag "always" t))) | |
163 | (debug-ignored-errors debug (repeat (choice symbol regexp))) | |
507c9247 RS |
164 | (debug-on-quit debug |
165 | (choice (const :tag "off") | |
166 | (repeat :menu-tag "When" | |
167 | :value (nil) | |
168 | (symbol :format "%v")) | |
169 | (const :tag "always" t))) | |
1444b0c0 PA |
170 | ;; fileio.c |
171 | (insert-default-directory minibuffer boolean) | |
bf247b6e | 172 | (read-file-name-completion-ignore-case minibuffer boolean "22.1") |
78976e0a | 173 | ;; fns.c |
37328bcd | 174 | (use-dialog-box menu boolean "21.1") |
bf247b6e | 175 | (use-file-dialog menu boolean "22.1") |
1444b0c0 PA |
176 | ;; frame.c |
177 | (default-frame-alist frames | |
178 | (repeat (cons :format "%v" | |
179 | (symbol :tag "Parameter") | |
180 | (sexp :tag "Value")))) | |
140fb7ff KS |
181 | (mouse-highlight mouse (choice (const :tag "disabled" nil) |
182 | (const :tag "always shown" t) | |
183 | (other :tag "hidden by keypress" 1))) | |
1444b0c0 PA |
184 | ;; indent.c |
185 | (indent-tabs-mode fill 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"))) | |
ac1b1728 | 191 | (echo-keystrokes minibuffer number) |
1444b0c0 | 192 | (polling-period keyboard integer) |
4db2b1c7 RS |
193 | (double-click-time mouse (restricted-sexp |
194 | :match-alternatives (integerp 'nil 't))) | |
3284b301 | 195 | (double-click-fuzz mouse integer) |
1444b0c0 PA |
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) | |
1444b0c0 PA |
200 | (suggest-key-bindings keyboard (choice (const :tag "off" nil) |
201 | (integer :tag "time" 2) | |
79221864 | 202 | (other :tag "on"))) |
5f537e54 | 203 | |
37328bcd DL |
204 | ;; This is not good news because it will use the wrong |
205 | ;; version-specific directories when you upgrade. We need | |
206 | ;; customization of the front of the list, maintaining the standard | |
207 | ;; value intact at the back. | |
71296446 | 208 | ;;; (load-path environment |
37328bcd DL |
209 | ;;; (repeat (choice :tag "[Current dir?]" |
210 | ;;; :format "%[Current dir?%] %v" | |
211 | ;;; (const :tag " current dir" nil) | |
212 | ;;; (directory :format "%v")))) | |
1444b0c0 PA |
213 | ;; minibuf.c |
214 | (completion-auto-help minibuffer boolean) | |
215 | (enable-recursive-minibuffers minibuffer boolean) | |
408f56b2 RS |
216 | (history-length minibuffer |
217 | (choice (const :tag "Infinite" t) | |
218 | integer)) | |
1e64386e | 219 | (history-delete-duplicates minibuffer boolean) |
8f62f2b8 MB |
220 | (minibuffer-prompt-properties |
221 | minibuffer | |
222 | (list | |
223 | (checklist :inline t | |
224 | (const :tag "Read-Only" | |
225 | :doc "Prevent prompt from being modified" | |
226 | :format "%t%n%h" | |
227 | :inline t | |
228 | (read-only t)) | |
229 | (const :tag "Inviolable" | |
230 | :doc "Prevent point from ever entering prompt" | |
231 | :format "%t%n%h" | |
232 | :inline t | |
233 | (point-entered minibuffer-avoid-prompt))) | |
234 | (repeat :inline t | |
235 | :tag "Other Properties" | |
236 | (list :inline t | |
237 | :format "%v" | |
238 | (symbol :tag "Property") | |
ecf5279a DL |
239 | (sexp :tag "Value")))) |
240 | "21.1") | |
1444b0c0 | 241 | (minibuffer-auto-raise minibuffer boolean) |
ecf5279a | 242 | ;; options property set at end |
a8a1b05d DL |
243 | (read-buffer-function minibuffer |
244 | (choice (const nil) | |
245 | (function-item iswitchb-read-buffer) | |
246 | function)) | |
b78fba02 EZ |
247 | ;; msdos.c |
248 | (dos-unsupported-char-glyph display integer) | |
1444b0c0 | 249 | ;; process.c |
4883633e | 250 | (delete-exited-processes processes-basics boolean) |
1444b0c0 PA |
251 | ;; syntax.c |
252 | (parse-sexp-ignore-comments editing-basics boolean) | |
253 | (words-include-escapes editing-basics boolean) | |
779d0b80 DL |
254 | (open-paren-in-column-0-is-defun-start editing-basics boolean |
255 | "21.1") | |
1444b0c0 | 256 | ;; window.c |
4cb464b7 DL |
257 | (temp-buffer-show-function windows (choice (const nil) function)) |
258 | (display-buffer-function windows (choice (const nil) function)) | |
1444b0c0 PA |
259 | (pop-up-frames frames boolean) |
260 | (pop-up-frame-function frames function) | |
71296446 JB |
261 | (special-display-buffer-names |
262 | frames | |
1444b0c0 PA |
263 | (repeat (choice :tag "Buffer" |
264 | :value "" | |
265 | (string :format "%v") | |
266 | (cons :tag "With attributes" | |
267 | :format "%v" | |
268 | :value ("" . nil) | |
269 | (string :format "%v") | |
270 | (repeat :tag "Attributes" | |
271 | (cons :format "%v" | |
272 | (symbol :tag "Parameter") | |
273 | (sexp :tag "Value"))))))) | |
274 | (special-display-regexps | |
71296446 | 275 | frames |
1444b0c0 PA |
276 | (repeat (choice :tag "Buffer" |
277 | :value "" | |
278 | (regexp :format "%v") | |
279 | (cons :tag "With attributes" | |
280 | :format "%v" | |
281 | :value ("" . nil) | |
282 | (regexp :format "%v") | |
283 | (repeat :tag "Attributes" | |
284 | (cons :format "%v" | |
285 | (symbol :tag "Parameter") | |
286 | (sexp :tag "Value"))))))) | |
287 | (special-display-function frames function) | |
288 | (same-window-buffer-names windows (repeat (string :format "%v"))) | |
289 | (same-window-regexps windows (repeat (regexp :format "%v"))) | |
290 | (pop-up-windows windows boolean) | |
d2946490 | 291 | (even-window-heights windows boolean) |
74f54b54 | 292 | (next-screen-context-lines windows integer) |
1444b0c0 PA |
293 | (split-height-threshold windows integer) |
294 | (window-min-height windows integer) | |
295 | (window-min-width windows integer) | |
bcc67965 | 296 | (scroll-preserve-screen-position windows boolean) |
13eb63ff | 297 | (display-buffer-reuse-frames windows boolean "21.1") |
1444b0c0 PA |
298 | ;; xdisp.c |
299 | (scroll-step windows integer) | |
ccbb360e RS |
300 | (scroll-conservatively windows integer) |
301 | (scroll-margin windows integer) | |
8b75db34 EZ |
302 | (hscroll-margin windows integer "21.3") |
303 | (hscroll-step windows number "21.3") | |
1444b0c0 | 304 | (truncate-partial-width-windows display boolean) |
67ee1125 | 305 | (mode-line-inverse-video modeline boolean) |
ec544bdd | 306 | (mode-line-in-non-selected-windows modeline boolean "21.3") |
37328bcd DL |
307 | (line-number-display-limit display |
308 | (choice integer | |
309 | (const :tag "No limit" nil))) | |
779d0b80 | 310 | (line-number-display-limit-width display integer) |
1444b0c0 PA |
311 | (highlight-nonselected-windows display boolean) |
312 | (message-log-max debug (choice (const :tag "Disable" nil) | |
313 | (integer :menu-tag "lines" | |
314 | :format "%v") | |
79221864 | 315 | (other :tag "Unlimited" t))) |
daba3e25 | 316 | (unibyte-display-via-language-environment mule boolean) |
bf247b6e | 317 | (blink-cursor-alist cursor alist "22.1") |
e5f51929 DL |
318 | ;; xfaces.c |
319 | (scalable-fonts-allowed display boolean) | |
1444b0c0 PA |
320 | ;; xfns.c |
321 | (x-bitmap-file-path installation | |
0849a37e | 322 | (repeat (directory :format "%v"))) |
bf247b6e | 323 | (x-use-old-gtk-file-dialog menu boolean "22.1") |
0849a37e | 324 | ;; xterm.c |
e8d9157b | 325 | (mouse-autoselect-window display boolean "21.3") |
e369c773 | 326 | (x-use-underline-position-properties display boolean "21.3") |
37328bcd | 327 | (x-stretch-cursor display boolean "21.1"))) |
a200d998 | 328 | this symbol group type standard version native-p |
4883633e RS |
329 | ;; This function turns a value |
330 | ;; into an expression which produces that value. | |
331 | (quoter (lambda (sexp) | |
332 | (if (or (memq sexp '(t nil)) | |
017266f8 | 333 | (keywordp sexp) |
4883633e RS |
334 | (and (listp sexp) |
335 | (memq (car sexp) '(lambda))) | |
336 | (stringp sexp) | |
37328bcd | 337 | (numberp sexp)) |
4883633e RS |
338 | sexp |
339 | (list 'quote sexp))))) | |
71296446 | 340 | (while all |
1444b0c0 PA |
341 | (setq this (car all) |
342 | all (cdr all) | |
343 | symbol (nth 0 this) | |
344 | group (nth 1 this) | |
00377857 | 345 | type (nth 2 this) |
37328bcd | 346 | version (nth 3 this) |
a200d998 RS |
347 | ;; If we did not specify any standard value expression above, |
348 | ;; use the current value as the standard value. | |
349 | standard (if (nthcdr 4 this) | |
350 | (nth 4 this) | |
720f4c79 | 351 | (when (default-boundp symbol) |
92233e7e | 352 | (funcall quoter (default-value symbol)))) |
00377857 EZ |
353 | ;; Don't complain about missing variables which are |
354 | ;; irrelevant to this platform. | |
355 | native-p (save-match-data | |
356 | (cond | |
357 | ((string-match "\\`dos-" (symbol-name symbol)) | |
358 | (eq system-type 'ms-dos)) | |
359 | ((string-match "\\`w32-" (symbol-name symbol)) | |
360 | (eq system-type 'windows-nt)) | |
2702394e EZ |
361 | ((string-match "\\`x-.*gtk" (symbol-name symbol)) |
362 | (or (boundp 'gtk) (not (eq system-type 'windows-nt)))) | |
197a09bf EZ |
363 | ((string-match "\\`x-" (symbol-name symbol)) |
364 | (fboundp 'x-create-frame)) | |
00377857 | 365 | (t t)))) |
1444b0c0 PA |
366 | (if (not (boundp symbol)) |
367 | ;; If variables are removed from C code, give an error here! | |
00377857 EZ |
368 | (and native-p |
369 | (message "Note, built-in variable `%S' not bound" symbol)) | |
4883633e RS |
370 | ;; Save the standard value, unless we already did. |
371 | (or (get symbol 'standard-value) | |
a200d998 | 372 | (put symbol 'standard-value (list standard))) |
4883633e RS |
373 | ;; If this is NOT while dumping Emacs, |
374 | ;; set up the rest of the customization info. | |
375 | (unless purify-flag | |
376 | ;; Add it to the right group. | |
377 | (custom-add-to-group group symbol 'custom-variable) | |
378 | ;; Set the type. | |
37328bcd DL |
379 | (put symbol 'custom-type type) |
380 | (put symbol 'custom-version version))))) | |
4883633e | 381 | |
ecf5279a | 382 | (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable) |
779d0b80 DL |
383 | (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start |
384 | 'custom-variable) | |
e5f51929 DL |
385 | (put 'selection-coding-system 'custom-set |
386 | (lambda (symbol value) | |
387 | (set-selection-coding-system value) | |
388 | (set symbol value))) | |
ecf5279a | 389 | |
4883633e RS |
390 | ;; Record cus-start as loaded |
391 | ;; if we have set up all the info that we can set up. | |
392 | ;; Don't record cus-start as loaded | |
393 | ;; if we have set up only the standard values. | |
394 | (unless purify-flag | |
395 | (provide 'cus-start)) | |
1444b0c0 | 396 | |
ab5796a9 | 397 | ;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60 |
1cd7adc6 | 398 | ;;; cus-start.el ends here |