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