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