; Auto-commit of ChangeLog files.
[emacs.git] / lisp / cus-start.el
blobb4d2139022c87f3a76d852fb415e9382a9c16983
1 ;;; cus-start.el --- define customization properties of builtins -*- lexical-binding:t -*-
3 ;; Copyright (C) 1997, 1999-2015 Free Software Foundation, Inc.
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: internal
7 ;; Package: emacs
9 ;; This file is part of GNU Emacs.
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 of the License, or
14 ;; (at your option) any later version.
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.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 ;;; Commentary:
26 ;; This file adds customize support for built-in variables.
28 ;; While dumping Emacs, this file is loaded, but it only records
29 ;; the standard values; it does not do the rest of the job.
30 ;; Later on, if the user makes a customization buffer,
31 ;; this file is loaded again with (require 'cus-start);
32 ;; then it does the whole job.
34 ;;; Code:
36 (defun minibuffer-prompt-properties--setter (symbol value)
37 (set-default symbol value)
38 (if (memq 'cursor-intangible value)
39 (add-hook 'minibuffer-setup-hook 'cursor-intangible-mode)
40 ;; Removing it is a bit trickier since it could have been added by someone
41 ;; else as well, so let's just not bother.
44 ;; Elements of this list have the form:
45 ;; SYMBOL GROUP TYPE VERSION REST...
46 ;; SYMBOL is the name of the variable.
47 ;; GROUP is the custom group to which it belongs (may also be a list
48 ;; of groups)
49 ;; TYPE is the defcustom :type.
50 ;; VERSION is the defcustom :version (or nil).
51 ;; REST is a set of :KEYWORD VALUE pairs. Accepted :KEYWORDs are:
52 ;; :standard - standard value for SYMBOL (else use current value)
53 ;; :set - custom-set property
54 ;; :risky - risky-local-variable property
55 ;; :safe - safe-local-variable property
56 ;; :tag - custom-tag property
57 (let (standard native-p prop propval
58 ;; This function turns a value
59 ;; into an expression which produces that value.
60 (quoter (lambda (sexp)
61 ;; FIXME: We'd like to use macroexp-quote here, but cus-start
62 ;; is loaded too early in loadup.el for that.
63 (if (or (memq sexp '(t nil))
64 (keywordp sexp)
65 (and (listp sexp)
66 (memq (car sexp) '(lambda)))
67 (stringp sexp)
68 (numberp sexp))
69 sexp
70 (list 'quote sexp)))))
71 (pcase-dolist
72 (`(,symbol ,group ,type ,version . ,rest)
73 '(;; alloc.c
74 (gc-cons-threshold alloc integer)
75 (gc-cons-percentage alloc float)
76 (garbage-collection-messages alloc boolean)
77 ;; buffer.c
78 (cursor-type
79 display
80 (choice
81 (const :tag "Frame default" t)
82 (const :tag "Filled box" box)
83 (const :tag "Hollow cursor" hollow)
84 (const :tag "Vertical bar" bar)
85 (cons :tag "Vertical bar with specified width"
86 (const bar) integer)
87 (const :tag "Horizontal bar" hbar)
88 (cons :tag "Horizontal bar with specified width"
89 (const hbar) integer)
90 (const :tag "None "nil)))
91 (mode-line-format mode-line sexp) ;Hard to do right.
92 (major-mode internal function)
93 (case-fold-search matching boolean)
94 (fill-column fill integer)
95 (left-margin fill integer)
96 (tab-width editing-basics integer)
97 (ctl-arrow display boolean)
98 (truncate-lines display boolean)
99 (word-wrap display boolean)
100 (selective-display-ellipses display boolean)
101 (indicate-empty-lines fringe boolean)
102 (indicate-buffer-boundaries
103 fringe
104 (choice
105 (const :tag "No indicators" nil)
106 (const :tag "On left, with arrows" left)
107 (const :tag "On right, with arrows" right)
108 (set :tag "Pick your own design"
109 :value ((t . nil))
110 :format "%{%t%}:\n%v\n%d"
111 :doc "You can specify a default and then override it \
112 for individual indicators.
113 Leaving \"Default\" unchecked is equivalent with specifying a default of
114 \"Do not show\"."
115 (choice :tag "Default"
116 :value (t . nil)
117 (const :tag "Do not show" (t . nil))
118 (const :tag "On the left" (t . left))
119 (const :tag "On the right" (t . right)))
120 (choice :tag "Top"
121 :value (top . left)
122 (const :tag "Do not show" (top . nil))
123 (const :tag "On the left" (top . left))
124 (const :tag "On the right" (top . right)))
125 (choice :tag "Bottom"
126 :value (bottom . left)
127 (const :tag "Do not show" (bottom . nil))
128 (const :tag "On the left" (bottom . left))
129 (const :tag "On the right" (bottom . right)))
130 (choice :tag "Up arrow"
131 :value (up . left)
132 (const :tag "Do not show" (up . nil))
133 (const :tag "On the left" (up . left))
134 (const :tag "On the right" (up . right)))
135 (choice :tag "Down arrow"
136 :value (down . left)
137 (const :tag "Do not show" (down . nil))
138 (const :tag "On the left" (down . left))
139 (const :tag "On the right" (down . right))))
140 (other :tag "On left, no arrows" t)))
141 (scroll-up-aggressively windows
142 (choice (const :tag "off" nil) float)
143 "21.1")
144 (scroll-down-aggressively windows
145 (choice (const :tag "off" nil) float)
146 "21.1")
147 (line-spacing display (choice (const :tag "none" nil) number)
148 "22.1")
149 (cursor-in-non-selected-windows
150 cursor boolean nil
151 :tag "Cursor In Non-selected Windows"
152 :set (lambda (symbol value)
153 (set-default symbol value)
154 (force-mode-line-update t)))
155 (transient-mark-mode editing-basics boolean nil
156 :standard (not noninteractive)
157 :initialize custom-initialize-delay
158 :set custom-set-minor-mode)
159 (bidi-paragraph-direction
160 paragraphs
161 (choice
162 (const :tag "Left to Right" left-to-right)
163 (const :tag "Right to Left" right-to-left)
164 (const :tag "Dynamic, according to paragraph text" nil))
165 "24.1")
166 ;; callint.c
167 (mark-even-if-inactive editing-basics boolean)
168 ;; callproc.c
169 (shell-file-name execute file)
170 (exec-path execute
171 (repeat (choice (const :tag "default directory" nil)
172 (directory :format "%v")))
174 :standard
175 (mapcar 'directory-file-name
176 (append (parse-colon-path (getenv "PATH"))
177 (list exec-directory))))
178 (exec-suffixes execute (repeat string))
179 ;; charset.c
180 (charset-map-path installation
181 (repeat (directory :format "%v")))
182 ;; coding.c
183 (inhibit-eol-conversion mule boolean)
184 (eol-mnemonic-undecided mule string)
185 ;; startup.el fiddles with the values. IMO, would be
186 ;; simpler to just use #ifdefs in coding.c.
187 (eol-mnemonic-unix mule string nil
188 :standard
189 (if (memq system-type '(ms-dos windows-nt))
190 "(Unix)" ":"))
191 (eol-mnemonic-dos mule string nil
192 :standard
193 (if (memq system-type '(ms-dos windows-nt))
194 "\\" "(DOS)"))
195 (eol-mnemonic-mac mule string nil
196 :standard "(Mac)")
197 (file-coding-system-alist
198 mule
199 (alist
200 :key-type (regexp :tag "File regexp")
201 :value-type (choice
202 :value (undecided . undecided)
203 (cons :tag "Encoding/decoding pair"
204 :value (undecided . undecided)
205 (coding-system :tag "Decoding")
206 (coding-system :tag "Encoding"))
207 (coding-system
208 :tag "Single coding system"
209 :value undecided
210 :match (lambda (widget value)
211 (and value (not (functionp value)))))
212 (function :value ignore))))
213 ;; dired.c
214 (completion-ignored-extensions dired
215 (repeat (string :format "%v")))
216 ;; dispnew.c
217 (baud-rate display integer)
218 (inverse-video display boolean)
219 (visible-bell display boolean)
220 (no-redraw-on-reenter display boolean)
222 ;; dosfns.c
223 (dos-display-scancodes display boolean)
224 (dos-hyper-key keyboard integer)
225 (dos-super-key keyboard integer)
226 (dos-keypad-mode keyboard integer)
228 ;; editfns.c
229 (user-full-name mail string)
230 ;; emacs.c
231 (report-emacs-bug-address emacsbug string)
232 ;; eval.c
233 (max-specpdl-size limits integer)
234 (max-lisp-eval-depth limits integer)
235 (max-mini-window-height limits
236 (choice (const :tag "quarter screen" nil)
237 number) "23.1")
238 (debug-on-error debug
239 (choice (const :tag "off")
240 (repeat :menu-tag "When"
241 :value (nil)
242 (symbol :format "%v"))
243 (const :tag "always" t)))
244 (debug-ignored-errors debug (repeat (choice symbol regexp)))
245 (debug-on-quit debug boolean)
246 (debug-on-signal debug boolean)
247 ;; fileio.c
248 (delete-by-moving-to-trash auto-save boolean "23.1")
249 (auto-save-visited-file-name auto-save boolean)
250 ;; filelock.c
251 (create-lockfiles files boolean "24.3")
252 (temporary-file-directory
253 ;; Darwin section added 24.1, does not seem worth :version bump.
254 files directory nil
255 :standard
256 (file-name-as-directory
257 ;; FIXME ? Should there be Ftemporary_file_directory to do this
258 ;; more robustly (cf set_local_socket in emacsclient.c).
259 ;; It could be used elsewhere, eg Fcall_process_region,
260 ;; server-socket-dir. See bug#7135.
261 (cond ((memq system-type '(ms-dos windows-nt))
262 (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
263 "c:/temp"))
264 ((eq system-type 'darwin)
265 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
266 ;; See bug#7135.
267 (let ((tmp (ignore-errors
268 (shell-command-to-string
269 "getconf DARWIN_USER_TEMP_DIR"))))
270 (and (stringp tmp)
271 (setq tmp (replace-regexp-in-string
272 "\n\\'" "" tmp))
273 ;; Handles "getconf: Unrecognized variable..."
274 (file-directory-p tmp)
275 tmp))
276 "/tmp"))
278 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
279 "/tmp"))))
280 :initialize custom-initialize-delay)
281 ;; fns.c
282 (use-dialog-box menu boolean "21.1")
283 (use-file-dialog menu boolean "22.1")
284 (focus-follows-mouse frames boolean "20.3")
285 ;; fontset.c
286 ;; FIXME nil is the initial value, fontset.el setqs it.
287 (vertical-centering-font-regexp display
288 (choice (const nil) regexp))
289 ;; frame.c
290 (default-frame-alist frames
291 (repeat (cons :format "%v"
292 (symbol :tag "Parameter")
293 (sexp :tag "Value"))))
294 (mouse-highlight mouse (choice (const :tag "disabled" nil)
295 (const :tag "always shown" t)
296 (other :tag "hidden by keypress" 1))
297 "22.1")
298 (make-pointer-invisible mouse boolean "23.2")
299 (menu-bar-mode frames boolean nil
300 ;; FIXME?
301 ;; :initialize custom-initialize-default
302 :set custom-set-minor-mode)
303 (tool-bar-mode (frames mouse) boolean nil
304 ;; :initialize custom-initialize-default
305 :set custom-set-minor-mode)
306 (frame-resize-pixelwise frames boolean "24.4")
307 (frame-inhibit-implied-resize frames
308 (choice
309 (const :tag "Never" nil)
310 (const :tag "Always" t)
311 (repeat (symbol :tag "Parameter")))
312 "25.1")
313 ;; fringe.c
314 (overflow-newline-into-fringe fringe boolean)
315 ;; image.c
316 (imagemagick-render-type image integer "24.1")
317 ;; indent.c
318 (indent-tabs-mode indent boolean)
319 ;; keyboard.c
320 (meta-prefix-char keyboard character)
321 (auto-save-interval auto-save integer)
322 (auto-save-timeout auto-save (choice (const :tag "off" nil)
323 (integer :format "%v")))
324 (echo-keystrokes minibuffer number)
325 (polling-period keyboard integer)
326 (double-click-time mouse (restricted-sexp
327 :match-alternatives (integerp 'nil 't)))
328 (double-click-fuzz mouse integer "22.1")
329 (help-char keyboard character)
330 (help-event-list keyboard (repeat (sexp :format "%v")))
331 (menu-prompting menu boolean)
332 (select-active-regions killing
333 (choice (const :tag "always" t)
334 (const :tag "only shift-selection or mouse-drag" only)
335 (const :tag "off" nil))
336 "24.1")
337 (debug-on-event debug
338 (choice (const :tag "None" nil)
339 (const :tag "When sent SIGUSR1" sigusr1)
340 (const :tag "When sent SIGUSR2" sigusr2))
341 "24.1")
343 ;; This is not good news because it will use the wrong
344 ;; version-specific directories when you upgrade. We need
345 ;; customization of the front of the list, maintaining the
346 ;; standard value intact at the back.
347 ;;(load-path environment
348 ;; (repeat (choice :tag "[Current dir?]"
349 ;; :format "%[Current dir?%] %v"
350 ;; (const :tag " current dir" nil)
351 ;; (directory :format "%v"))))
352 (load-prefer-newer lisp boolean "24.4")
353 ;; minibuf.c
354 (enable-recursive-minibuffers minibuffer boolean)
355 (history-length minibuffer
356 (choice (const :tag "Infinite" t) integer)
357 "24.5") ; 30 -> 100
358 (history-delete-duplicates minibuffer boolean "22.1")
359 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
361 (minibuffer-prompt-properties
362 minibuffer
363 (list
364 (checklist :inline t
365 (const :tag "Read-Only"
366 :doc "Prevent prompt from being modified"
367 :format "%t%n%h"
368 :inline t
369 (read-only t))
370 (const :tag "Don't Enter"
371 :doc "Prevent point from ever entering prompt"
372 :format "%t%n%h"
373 :inline t
374 (cursor-intangible t)))
375 (repeat :inline t
376 :tag "Other Properties"
377 (list :inline t
378 :format "%v"
379 (symbol :tag "Property")
380 (sexp :tag "Value"))))
381 "21.1"
382 :set minibuffer-prompt-properties--setter)
383 (minibuffer-auto-raise minibuffer boolean)
384 ;; options property set at end
385 (read-buffer-function minibuffer
386 (choice (const nil)
387 function))
388 ;; msdos.c
389 (dos-unsupported-char-glyph display integer)
390 ;; nsterm.m
391 (ns-control-modifier
393 (choice (const :tag "No modifier" nil)
394 (const control) (const meta)
395 (const alt) (const hyper)
396 (const super)) "23.1")
397 (ns-right-control-modifier
399 (choice (const :tag "No modifier (work as control)" none)
400 (const :tag "Use the value of ns-control-modifier"
401 left)
402 (const control) (const meta)
403 (const alt) (const hyper)
404 (const super)) "24.1")
405 (ns-command-modifier
407 (choice (const :tag "No modifier" nil)
408 (const control) (const meta)
409 (const alt) (const hyper)
410 (const super)) "23.1")
411 (ns-right-command-modifier
413 (choice (const :tag "No modifier (work as command)" none)
414 (const :tag "Use the value of ns-command-modifier"
415 left)
416 (const control) (const meta)
417 (const alt) (const hyper)
418 (const super)) "24.1")
419 (ns-alternate-modifier
421 (choice (const :tag "No modifier (work as alternate/option)" none)
422 (const control) (const meta)
423 (const alt) (const hyper)
424 (const super)) "23.1")
425 (ns-right-alternate-modifier
427 (choice (const :tag "No modifier (work as alternate/option)" none)
428 (const :tag "Use the value of ns-alternate-modifier"
429 left)
430 (const control) (const meta)
431 (const alt) (const hyper)
432 (const super)) "23.3")
433 (ns-function-modifier
435 (choice (const :tag "No modifier (work as function)" none)
436 (const control) (const meta)
437 (const alt) (const hyper)
438 (const super)) "23.1")
439 (ns-antialias-text ns boolean "23.1")
440 (ns-auto-hide-menu-bar ns boolean "24.1")
441 (ns-confirm-quit ns boolean "25.1")
442 (ns-use-native-fullscreen ns boolean "24.4")
443 (ns-use-fullscreen-animation ns boolean "25.1")
444 (ns-use-srgb-colorspace ns boolean "24.4")
445 ;; process.c
446 (delete-exited-processes processes-basics boolean)
447 ;; syntax.c
448 (parse-sexp-ignore-comments editing-basics boolean)
449 (words-include-escapes editing-basics boolean)
450 (open-paren-in-column-0-is-defun-start editing-basics boolean
451 "21.1")
452 ;; term.c
453 (visible-cursor cursor boolean "22.1")
454 ;; terminal.c
455 (ring-bell-function display
456 (choice
457 (const :tag "Default" nil)
458 (const :tag "Silent" ignore)
459 function))
460 ;; undo.c
461 (undo-limit undo integer)
462 (undo-strong-limit undo integer)
463 (undo-outer-limit undo
464 (choice integer
465 (const :tag "No limit"
466 :format "%t\n%d"
467 :doc
468 "With this choice, \
469 the undo info for the current command never gets discarded.
470 This should only be chosen under exceptional circumstances,
471 since it could result in memory overflow and make Emacs crash."
472 nil))
473 "22.1")
474 ;; window.c
475 (temp-buffer-show-function windows (choice (const nil) function))
476 (next-screen-context-lines windows integer)
477 (scroll-preserve-screen-position
478 windows (choice
479 (const :tag "Off (nil)" :value nil)
480 (const :tag "Full screen (t)" :value t)
481 (other :tag "Always" 1)) "22.1")
482 (recenter-redisplay
483 windows (choice
484 (const :tag "Never (nil)" :value nil)
485 (const :tag "Only on ttys" :value tty)
486 (other :tag "Always" t)) "23.1")
487 (window-combination-resize windows boolean "24.1")
488 (window-combination-limit
489 windows (choice
490 (const :tag "Never (nil)" :value nil)
491 (const :tag "For Temp Buffer Resize mode (temp-buffer-resize)"
492 :value temp-buffer-resize)
493 (const :tag "For temporary buffers (temp-buffer)"
494 :value temp-buffer)
495 (const :tag "For buffer display (display-buffer)"
496 :value display-buffer)
497 (other :tag "Always (t)" :value t))
498 "24.3")
499 (fast-but-imprecise-scrolling scrolling boolean "25.1")
500 (window-resize-pixelwise windows boolean "24.4")
501 ;; xdisp.c
502 ;; The whitespace group is for whitespace.el.
503 (show-trailing-whitespace editing-basics boolean nil
504 :safe booleanp)
505 (scroll-step windows integer)
506 (scroll-conservatively windows integer)
507 (scroll-margin windows integer)
508 (hscroll-margin windows integer "22.1")
509 (hscroll-step windows number "22.1")
510 (truncate-partial-width-windows
511 display
512 (choice (integer :tag "Truncate if narrower than")
513 (const :tag "Respect `truncate-lines'" nil)
514 (other :tag "Truncate if not full-width" t))
515 "23.1")
516 (make-cursor-line-fully-visible windows boolean)
517 (mode-line-in-non-selected-windows mode-line boolean "22.1")
518 (line-number-display-limit display
519 (choice integer
520 (const :tag "No limit" nil)))
521 (line-number-display-limit-width display integer "22.1")
522 (highlight-nonselected-windows display boolean)
523 (message-log-max debug (choice (const :tag "Disable" nil)
524 (integer :menu-tag "lines"
525 :format "%v")
526 (other :tag "Unlimited" t))
527 "24.3")
528 (unibyte-display-via-language-environment mule boolean)
529 (blink-cursor-alist cursor alist "22.1")
530 (overline-margin display integer "22.1")
531 (underline-minimum-offset display integer "23.1")
532 (mouse-autoselect-window
533 display (choice
534 (const :tag "Off (nil)" :value nil)
535 (const :tag "Immediate" :value t)
536 (number :tag "Delay by secs" :value 0.5)) "22.1")
537 (tool-bar-style
538 frames (choice
539 (const :tag "Images" :value image)
540 (const :tag "Text" :value text)
541 (const :tag "Both" :value both)
542 (const :tag "Both-horiz" :value both-horiz)
543 (const :tag "Text-image-horiz" :value text-image-horiz)
544 (const :tag "System default" :value nil)) "24.1")
545 (tool-bar-max-label-size frames integer "24.1")
546 (auto-hscroll-mode scrolling boolean "21.1")
547 (void-text-area-pointer cursor
548 (choice
549 (const :tag "Standard (text pointer)" :value nil)
550 (const :tag "Arrow" :value arrow)
551 (const :tag "Text pointer" :value text)
552 (const :tag "Hand" :value hand)
553 (const :tag "Vertical dragger" :value vdrag)
554 (const :tag "Horizontal dragger" :value hdrag)
555 (const :tag "Same as mode line" :value modeline)
556 (const :tag "Hourglass" :value hourglass)))
557 (display-hourglass cursor boolean)
558 (hourglass-delay cursor number)
559 (resize-mini-windows
560 windows (choice
561 (const :tag "Off (nil)" :value nil)
562 (const :tag "Fit (t)" :value t)
563 (const :tag "Grow only" :value grow-only))
564 "25.1")
565 ;; xfaces.c
566 (scalable-fonts-allowed display boolean "22.1")
567 ;; xfns.c
568 (x-bitmap-file-path installation
569 (repeat (directory :format "%v")))
570 (x-gtk-use-old-file-dialog menu boolean "22.1")
571 (x-gtk-show-hidden-files menu boolean "22.1")
572 (x-gtk-file-dialog-help-text menu boolean "22.1")
573 (x-gtk-use-system-tooltips tooltip boolean "23.3")
574 ;; xterm.c
575 (x-use-underline-position-properties display boolean "22.1")
576 (x-underline-at-descent-line display boolean "22.1")
577 (x-stretch-cursor display boolean "21.1")
578 (scroll-bar-adjust-thumb-portion windows boolean "24.4")
579 ;; xselect.c
580 (x-select-enable-clipboard-manager killing boolean "24.1")
581 ;; xsettings.c
582 (font-use-system-font font-selection boolean "23.2")))
583 (setq ;; If we did not specify any standard value expression above,
584 ;; use the current value as the standard value.
585 standard (if (setq prop (memq :standard rest))
586 (cadr prop)
587 (if (default-boundp symbol)
588 (funcall quoter (default-value symbol))))
589 ;; Don't complain about missing variables which are
590 ;; irrelevant to this platform.
591 native-p (save-match-data
592 (cond
593 ((string-match "\\`dos-" (symbol-name symbol))
594 (eq system-type 'ms-dos))
595 ((string-match "\\`w32-" (symbol-name symbol))
596 (eq system-type 'windows-nt))
597 ((string-match "\\`ns-" (symbol-name symbol))
598 (featurep 'ns))
599 ((string-match "\\`x-.*gtk" (symbol-name symbol))
600 (featurep 'gtk))
601 ((string-match "clipboard-manager" (symbol-name symbol))
602 (boundp 'x-select-enable-clipboard-manager))
603 ((string-match "\\`x-" (symbol-name symbol))
604 (fboundp 'x-create-frame))
605 ((string-match "selection" (symbol-name symbol))
606 (fboundp 'x-selection-exists-p))
607 ((string-match "fringe" (symbol-name symbol))
608 (fboundp 'define-fringe-bitmap))
609 ((string-match "\\`imagemagick" (symbol-name symbol))
610 (fboundp 'imagemagick-types))
611 ((equal "font-use-system-font" (symbol-name symbol))
612 (featurep 'system-font-setting))
613 ;; Conditioned on x-create-frame, because that's
614 ;; the condition for loadup.el to preload tool-bar.el.
615 ((string-match "tool-bar-" (symbol-name symbol))
616 (fboundp 'x-create-frame))
617 ((equal "vertical-centering-font-regexp"
618 (symbol-name symbol))
619 ;; Any function from fontset.c will do.
620 (fboundp 'new-fontset))
621 ((equal "scroll-bar-adjust-thumb-portion"
622 (symbol-name symbol))
623 (featurep 'x))
624 (t t))))
625 (if (not (boundp symbol))
626 ;; If variables are removed from C code, give an error here!
627 (and native-p
628 (message "Note, built-in variable `%S' not bound" symbol))
629 ;; Save the standard value, unless we already did.
630 (or (get symbol 'standard-value)
631 (put symbol 'standard-value (list standard)))
632 ;; We need these properties independent of whether cus-start is loaded.
633 (if (setq prop (memq :safe rest))
634 (put symbol 'safe-local-variable (cadr prop)))
635 (if (setq prop (memq :risky rest))
636 (put symbol 'risky-local-variable (cadr prop)))
637 (if (setq prop (memq :set rest))
638 (put symbol 'custom-set (cadr prop)))
639 ;; Note this is the _only_ initialize property we handle.
640 (if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay)
641 ;; These vars are defined early and should hence be initialized
642 ;; early, even if this file happens to be loaded late. so add them
643 ;; to the end of custom-delayed-init-variables. Otherwise,
644 ;; auto-save-file-name-transforms will appear in M-x customize-rogue.
645 (add-to-list 'custom-delayed-init-variables symbol 'append))
646 ;; If this is NOT while dumping Emacs, set up the rest of the
647 ;; customization info. This is the stuff that is not needed
648 ;; until someone does M-x customize etc.
649 (unless purify-flag
650 ;; Add it to the right group(s).
651 (if (listp group)
652 (dolist (g group)
653 (custom-add-to-group g symbol 'custom-variable))
654 (custom-add-to-group group symbol 'custom-variable))
655 ;; Set the type.
656 (put symbol 'custom-type type)
657 (if version (put symbol 'custom-version version))
658 (while rest
659 (setq prop (car rest)
660 propval (cadr rest)
661 rest (nthcdr 2 rest))
662 (cond ((memq prop '(:standard :risky :safe :set))) ; handled above
663 ((eq prop :tag)
664 (put symbol 'custom-tag propval))))))))
666 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
667 'custom-variable)
669 ;; Record cus-start as loaded if we have set up all the info that we can.
670 ;; Don't record it as loaded if we have only set up the standard values
671 ;; and safe/risky properties.
672 (unless purify-flag
673 (provide 'cus-start))
675 ;;; cus-start.el ends here