gnus-group.el (gnus-group-completing-read): Remove all newlines from group names...
[bpt/emacs.git] / lisp / cus-start.el
CommitLineData
1cd7adc6 1;;; cus-start.el --- define customization properties of builtins
1444b0c0 2;;
0d30b337 3;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
114f9c96 4;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
1444b0c0
PA
5;;
6;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7;; Keywords: internal
bd78fa1d 8;; Package: emacs
1444b0c0 9
c2383d2d
RS
10;; This file is part of GNU Emacs.
11
eb3fa2cf 12;; GNU Emacs is free software: you can redistribute it and/or modify
c2383d2d 13;; it under the terms of the GNU General Public License as published by
eb3fa2cf
GM
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
c2383d2d
RS
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
eb3fa2cf 23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
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
e047f448 37(let ((all '(;; alloc.c
1444b0c0 38 (gc-cons-threshold alloc integer)
0f014aa1 39 (garbage-collection-messages alloc boolean)
1444b0c0 40 ;; buffer.c
e45db0fb 41 (mode-line-format mode-line sexp) ;Hard to do right.
4e3b4528 42 (major-mode internal function)
1444b0c0
PA
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)
84975bbe 49 (word-wrap display boolean)
1444b0c0 50 (selective-display-ellipses display boolean)
516b77a3 51 (indicate-empty-lines fringe boolean)
eb94dac6
LT
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)
a4fbb790
LT
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 \
62for individual indicators.
63Leaving \"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))))
516b77a3 90 (other :tag "On left, no arrows" t)))
c6d57325
RS
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")
6671cab3
MR
97 (line-spacing display (choice (const :tag "none" nil) integer)
98 "22.1")
1444b0c0
PA
99 ;; callint.c
100 (mark-even-if-inactive editing-basics boolean)
101 ;; callproc.c
102 (shell-file-name execute file)
103 (exec-path execute
f747a488 104 (repeat (choice (const :tag "default directory" nil)
72e869ba 105 (directory :format "%v"))))
5e3097cd 106 ;; charset.c
c11f69e1
KH
107 (charset-map-path installation
108 (repeat (directory :format "%v")))
5fc9eb7c
DL
109 ;; coding.c
110 (inhibit-eol-conversion mule boolean)
de0d1fc5
EZ
111 (eol-mnemonic-undecided mule string)
112 (eol-mnemonic-unix mule string)
113 (eol-mnemonic-dos mule string)
114 (eol-mnemonic-mac mule string)
13eb63ff
DL
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"))
70c2811c
KY
125 (coding-system
126 :tag "Single coding system"
127 :value undecided
128 :match (lambda (widget value)
129 (and value (not (functionp value)))))
13eb63ff 130 (function :value ignore))))
1444b0c0 131 ;; dired.c
71296446 132 (completion-ignored-extensions dired
1444b0c0 133 (repeat (string :format "%v")))
0849a37e 134 ;; dispnew.c
1444b0c0
PA
135 (baud-rate display integer)
136 (inverse-video display boolean)
137 (visible-bell display boolean)
138 (no-redraw-on-reenter display boolean)
139 ;; editfns.c
140 (user-full-name mail string)
141 ;; eval.c
142 (max-specpdl-size limits integer)
143 (max-lisp-eval-depth limits integer)
f8add097
RS
144 (max-mini-window-height limits
145 (choice (const :tag "quarter screen" nil)
6671cab3 146 number) "23.1")
1444b0c0
PA
147 (stack-trace-on-error debug
148 (choice (const :tag "off")
149 (repeat :menu-tag "When"
150 :value (nil)
151 (symbol :format "%v"))
152 (const :tag "always" t)))
71296446 153 (debug-on-error debug
1444b0c0
PA
154 (choice (const :tag "off")
155 (repeat :menu-tag "When"
156 :value (nil)
157 (symbol :format "%v"))
158 (const :tag "always" t)))
159 (debug-ignored-errors debug (repeat (choice symbol regexp)))
507c9247
RS
160 (debug-on-quit debug
161 (choice (const :tag "off")
162 (repeat :menu-tag "When"
163 :value (nil)
164 (symbol :format "%v"))
165 (const :tag "always" t)))
6cf29fe8
JR
166 ;; fileio.c
167 (delete-by-moving-to-trash auto-save boolean "23.1")
6ba7a6f0 168 (auto-save-visited-file-name auto-save boolean)
78976e0a 169 ;; fns.c
37328bcd 170 (use-dialog-box menu boolean "21.1")
bf247b6e 171 (use-file-dialog menu boolean "22.1")
f4c307a5 172 (focus-follows-mouse frames boolean "20.3")
1444b0c0
PA
173 ;; frame.c
174 (default-frame-alist frames
175 (repeat (cons :format "%v"
176 (symbol :tag "Parameter")
177 (sexp :tag "Value"))))
140fb7ff
KS
178 (mouse-highlight mouse (choice (const :tag "disabled" nil)
179 (const :tag "always shown" t)
6671cab3
MR
180 (other :tag "hidden by keypress" 1))
181 "22.1")
e044e4fc 182 (make-pointer-invisible mouse boolean "23.2")
48d707c5 183 ;; fringe.c
516b77a3 184 (overflow-newline-into-fringe fringe boolean)
1444b0c0 185 ;; indent.c
01892a52 186 (indent-tabs-mode indent boolean)
1444b0c0
PA
187 ;; keyboard.c
188 (meta-prefix-char keyboard character)
189 (auto-save-interval auto-save integer)
190 (auto-save-timeout auto-save (choice (const :tag "off" nil)
191 (integer :format "%v")))
ac1b1728 192 (echo-keystrokes minibuffer number)
1444b0c0 193 (polling-period keyboard integer)
4db2b1c7
RS
194 (double-click-time mouse (restricted-sexp
195 :match-alternatives (integerp 'nil 't)))
6671cab3 196 (double-click-fuzz mouse integer "22.1")
1444b0c0
PA
197 (inhibit-local-menu-bar-menus menu boolean)
198 (help-char keyboard character)
199 (help-event-list keyboard (repeat (sexp :format "%v")))
200 (menu-prompting menu boolean)
9852377f 201 (select-active-regions killing
7c23dd44
CY
202 (choice (const :tag "always" t)
203 (const :tag "only shift-selection or mouse-drag" only)
9852377f
CY
204 (const :tag "off" nil))
205 "24.1")
1444b0c0
PA
206 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
207 (integer :tag "time" 2)
79221864 208 (other :tag "on")))
5f537e54 209
37328bcd
DL
210;; This is not good news because it will use the wrong
211;; version-specific directories when you upgrade. We need
212;; customization of the front of the list, maintaining the standard
213;; value intact at the back.
71296446 214;;; (load-path environment
37328bcd
DL
215;;; (repeat (choice :tag "[Current dir?]"
216;;; :format "%[Current dir?%] %v"
217;;; (const :tag " current dir" nil)
218;;; (directory :format "%v"))))
1444b0c0 219 ;; minibuf.c
1444b0c0 220 (enable-recursive-minibuffers minibuffer boolean)
408f56b2 221 (history-length minibuffer
6671cab3
MR
222 (choice (const :tag "Infinite" t) integer)
223 "22.1")
224 (history-delete-duplicates minibuffer boolean "22.1")
ed278e5d
CY
225 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
226
8f62f2b8
MB
227 (minibuffer-prompt-properties
228 minibuffer
229 (list
230 (checklist :inline t
231 (const :tag "Read-Only"
232 :doc "Prevent prompt from being modified"
233 :format "%t%n%h"
234 :inline t
235 (read-only t))
c9133fa6 236 (const :tag "Don't Enter"
8f62f2b8
MB
237 :doc "Prevent point from ever entering prompt"
238 :format "%t%n%h"
239 :inline t
240 (point-entered minibuffer-avoid-prompt)))
241 (repeat :inline t
242 :tag "Other Properties"
243 (list :inline t
244 :format "%v"
245 (symbol :tag "Property")
ecf5279a
DL
246 (sexp :tag "Value"))))
247 "21.1")
1444b0c0 248 (minibuffer-auto-raise minibuffer boolean)
ecf5279a 249 ;; options property set at end
a8a1b05d
DL
250 (read-buffer-function minibuffer
251 (choice (const nil)
252 (function-item iswitchb-read-buffer)
253 function))
b78fba02
EZ
254 ;; msdos.c
255 (dos-unsupported-char-glyph display integer)
bc9ebf41 256 ;; nsterm.m
77346ecd 257 (ns-control-modifier
ae2349fe 258 ns
bc9ebf41
DR
259 (choice (const :tag "No modifier" nil)
260 (const control) (const meta)
261 (const alt) (const hyper)
262 (const super)) "23.1")
77346ecd 263 (ns-command-modifier
ae2349fe 264 ns
bc9ebf41
DR
265 (choice (const :tag "No modifier" nil)
266 (const control) (const meta)
267 (const alt) (const hyper)
268 (const super)) "23.1")
77346ecd 269 (ns-alternate-modifier
ae2349fe 270 ns
bc9ebf41
DR
271 (choice (const :tag "No modifier (work as alternate/option)" none)
272 (const control) (const meta)
273 (const alt) (const hyper)
274 (const super)) "23.1")
a2e35ef5
JD
275 (ns-right-alternate-modifier
276 ns
277 (choice (const :tag "No modifier (work as alternate/option)" none)
278 (const :tag "Use the value of ns-alternate-modifier"
279 left)
280 (const control) (const meta)
281 (const alt) (const hyper)
282 (const super)) "23.3")
77346ecd 283 (ns-function-modifier
ae2349fe 284 ns
bc9ebf41
DR
285 (choice (const :tag "No modifier (work as function)" none)
286 (const control) (const meta)
287 (const alt) (const hyper)
288 (const super)) "23.1")
289 (ns-antialias-text ns boolean "23.1")
1444b0c0 290 ;; process.c
4883633e 291 (delete-exited-processes processes-basics boolean)
1444b0c0
PA
292 ;; syntax.c
293 (parse-sexp-ignore-comments editing-basics boolean)
294 (words-include-escapes editing-basics boolean)
6b61353c
KH
295 (open-paren-in-column-0-is-defun-start editing-basics boolean
296 "21.1")
98e071b5
SM
297 ;; term.c
298 (visible-cursor cursor boolean "22.1")
0f08b956
LT
299 ;; undo.c
300 (undo-limit undo integer)
301 (undo-strong-limit undo integer)
302 (undo-outer-limit undo
303 (choice integer
304 (const :tag "No limit"
305 :format "%t\n%d"
306 :doc
307 "With this choice, \
308the undo info for the current command never gets discarded.
309This should only be chosen under exceptional circumstances,
310since it could result in memory overflow and make Emacs crash."
311 nil))
312 "22.1")
1444b0c0 313 ;; window.c
4cb464b7 314 (temp-buffer-show-function windows (choice (const nil) function))
74f54b54 315 (next-screen-context-lines windows integer)
1444b0c0
PA
316 (window-min-height windows integer)
317 (window-min-width windows integer)
7704b6b1
KS
318 (scroll-preserve-screen-position
319 windows (choice
320 (const :tag "Off (nil)" :value nil)
321 (const :tag "Full screen (t)" :value t)
6671cab3 322 (other :tag "Always" 1)) "22.1")
666e158e
MB
323 (recenter-redisplay windows
324 (choice
325 (const :tag "Never (nil)" :value nil)
326 (const :tag "Only on ttys" :value tty)
327 (other :tag "Always" t))
328 "23.1")
1444b0c0
PA
329 ;; xdisp.c
330 (scroll-step windows integer)
ccbb360e
RS
331 (scroll-conservatively windows integer)
332 (scroll-margin windows integer)
4e371ce8
EZ
333 (hscroll-margin windows integer "22.1")
334 (hscroll-step windows number "22.1")
3a66cc91 335 (truncate-partial-width-windows display boolean "23.1")
e45db0fb
MR
336 (mode-line-inverse-video mode-line boolean)
337 (mode-line-in-non-selected-windows mode-line boolean "22.1")
37328bcd
DL
338 (line-number-display-limit display
339 (choice integer
340 (const :tag "No limit" nil)))
6671cab3 341 (line-number-display-limit-width display integer "22.1")
1444b0c0
PA
342 (highlight-nonselected-windows display boolean)
343 (message-log-max debug (choice (const :tag "Disable" nil)
344 (integer :menu-tag "lines"
345 :format "%v")
79221864 346 (other :tag "Unlimited" t)))
daba3e25 347 (unibyte-display-via-language-environment mule boolean)
bf247b6e 348 (blink-cursor-alist cursor alist "22.1")
03c25271 349 (overline-margin display integer "22.1")
2a3bd2e1 350 (underline-minimum-offset display integer "23.1")
612c16f1
CY
351 (mouse-autoselect-window
352 display (choice
353 (const :tag "Off (nil)" :value nil)
354 (const :tag "Immediate" :value t)
355 (number :tag "Delay by secs" :value 0.5)) "22.1")
f904c0f9
JD
356 (tool-bar-style
357 frames (choice
358 (const :tag "Images" :value image)
359 (const :tag "Text" :value text)
360 (const :tag "Both" :value both)
361 (const :tag "Both-horiz" :value both-horiz)
8a52f00a 362 (const :tag "Text-image-horiz" :value text-image-horiz)
f904c0f9
JD
363 (const :tag "System default" :value nil)) "23.3")
364 (tool-bar-max-label-size frames integer "23.3")
365
e5f51929 366 ;; xfaces.c
6671cab3 367 (scalable-fonts-allowed display boolean "22.1")
1444b0c0
PA
368 ;; xfns.c
369 (x-bitmap-file-path installation
0849a37e 370 (repeat (directory :format "%v")))
c4823934 371 (x-gtk-use-old-file-dialog menu boolean "22.1")
91b5a204 372 (x-gtk-show-hidden-files menu boolean "22.1")
c4823934 373 (x-gtk-file-dialog-help-text menu boolean "22.1")
0dd95b49 374 (x-gtk-whole-detached-tool-bar x boolean "22.1")
aa1859f5 375 (x-gtk-use-system-tooltips tooltip boolean "23.3")
0849a37e 376 ;; xterm.c
4e371ce8 377 (x-use-underline-position-properties display boolean "22.1")
03c25271 378 (x-underline-at-descent-line display boolean "22.1")
dfb3c4c6
JD
379 (x-stretch-cursor display boolean "21.1")
380 ;; xsettings.c
381 (font-use-system-font font-selection boolean "23.2")))
a200d998 382 this symbol group type standard version native-p
4883633e
RS
383 ;; This function turns a value
384 ;; into an expression which produces that value.
385 (quoter (lambda (sexp)
386 (if (or (memq sexp '(t nil))
017266f8 387 (keywordp sexp)
4883633e
RS
388 (and (listp sexp)
389 (memq (car sexp) '(lambda)))
390 (stringp sexp)
37328bcd 391 (numberp sexp))
4883633e
RS
392 sexp
393 (list 'quote sexp)))))
71296446 394 (while all
1444b0c0
PA
395 (setq this (car all)
396 all (cdr all)
397 symbol (nth 0 this)
398 group (nth 1 this)
00377857 399 type (nth 2 this)
37328bcd 400 version (nth 3 this)
a200d998
RS
401 ;; If we did not specify any standard value expression above,
402 ;; use the current value as the standard value.
403 standard (if (nthcdr 4 this)
404 (nth 4 this)
720f4c79 405 (when (default-boundp symbol)
92233e7e 406 (funcall quoter (default-value symbol))))
00377857
EZ
407 ;; Don't complain about missing variables which are
408 ;; irrelevant to this platform.
409 native-p (save-match-data
410 (cond
411 ((string-match "\\`dos-" (symbol-name symbol))
412 (eq system-type 'ms-dos))
413 ((string-match "\\`w32-" (symbol-name symbol))
414 (eq system-type 'windows-nt))
77346ecd
EZ
415 ((string-match "\\`ns-" (symbol-name symbol))
416 (featurep 'ns))
2702394e 417 ((string-match "\\`x-.*gtk" (symbol-name symbol))
79cf2123 418 (featurep 'gtk))
197a09bf
EZ
419 ((string-match "\\`x-" (symbol-name symbol))
420 (fboundp 'x-create-frame))
6eb33acb
EZ
421 ((string-match "selection" (symbol-name symbol))
422 (fboundp 'x-selection-exists-p))
423 ((string-match "fringe" (symbol-name symbol))
424 (fboundp 'define-fringe-bitmap))
8b571bf3
JD
425 ((equal "font-use-system-font" (symbol-name symbol))
426 (featurep 'system-font-setting))
c0162ade
EZ
427 ;; Conditioned on x-create-frame, because that's
428 ;; the condition for loadup.el to preload tool-bar.el.
429 ((string-match "tool-bar-" (symbol-name symbol))
430 (fboundp 'x-create-frame))
00377857 431 (t t))))
1444b0c0
PA
432 (if (not (boundp symbol))
433 ;; If variables are removed from C code, give an error here!
00377857
EZ
434 (and native-p
435 (message "Note, built-in variable `%S' not bound" symbol))
4883633e
RS
436 ;; Save the standard value, unless we already did.
437 (or (get symbol 'standard-value)
a200d998 438 (put symbol 'standard-value (list standard)))
4883633e
RS
439 ;; If this is NOT while dumping Emacs,
440 ;; set up the rest of the customization info.
441 (unless purify-flag
442 ;; Add it to the right group.
443 (custom-add-to-group group symbol 'custom-variable)
444 ;; Set the type.
37328bcd
DL
445 (put symbol 'custom-type type)
446 (put symbol 'custom-version version)))))
4883633e 447
ecf5279a 448(custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
6b61353c
KH
449(custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
450 'custom-variable)
ecf5279a 451
4883633e
RS
452;; Record cus-start as loaded
453;; if we have set up all the info that we can set up.
454;; Don't record cus-start as loaded
455;; if we have set up only the standard values.
456(unless purify-flag
457 (provide 'cus-start))
1444b0c0 458
c8f1ea76 459;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
1cd7adc6 460;;; cus-start.el ends here