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