Commit | Line | Data |
---|---|---|
1cd7adc6 | 1 | ;;; cus-start.el --- define customization properties of builtins |
1444b0c0 | 2 | ;; |
88f43c67 GM |
3 | ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
4 | ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | |
1444b0c0 PA |
5 | ;; |
6 | ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | |
7 | ;; Keywords: internal | |
bd78fa1d | 8 | ;; Package: emacs |
1444b0c0 | 9 | |
c2383d2d RS |
10 | ;; This file is part of GNU Emacs. |
11 | ||
eb3fa2cf | 12 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
c2383d2d | 13 | ;; it under the terms of the GNU General Public License as published by |
eb3fa2cf GM |
14 | ;; the Free Software Foundation, either version 3 of the License, or |
15 | ;; (at your option) any later version. | |
c2383d2d RS |
16 | |
17 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;; GNU General Public License for more details. | |
21 | ||
22 | ;; You should have received a copy of the GNU General Public License | |
eb3fa2cf | 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
c2383d2d | 24 | |
1444b0c0 PA |
25 | ;;; Commentary: |
26 | ;; | |
4883633e | 27 | ;; This file adds customize support for built-in variables. |
1444b0c0 | 28 | |
4883633e RS |
29 | ;; While dumping Emacs, this file is loaded, but it only records |
30 | ;; the standard values; it does not do the rest of the job. | |
31 | ;; Later on, if the user makes a customization buffer, | |
32 | ;; this file is loaded again with (require 'cus-start); | |
33 | ;; then it does the whole job. | |
1444b0c0 | 34 | |
4883633e | 35 | ;;; Code: |
1444b0c0 | 36 | |
e047f448 | 37 | (let ((all '(;; alloc.c |
1444b0c0 | 38 | (gc-cons-threshold alloc integer) |
0f014aa1 | 39 | (garbage-collection-messages alloc boolean) |
1444b0c0 | 40 | ;; buffer.c |
e45db0fb | 41 | (mode-line-format mode-line sexp) ;Hard to do right. |
4e3b4528 | 42 | (major-mode internal function) |
1444b0c0 PA |
43 | (case-fold-search matching boolean) |
44 | (fill-column fill integer) | |
45 | (left-margin fill integer) | |
46 | (tab-width editing-basics integer) | |
47 | (ctl-arrow display boolean) | |
48 | (truncate-lines display boolean) | |
84975bbe | 49 | (word-wrap display boolean) |
1444b0c0 | 50 | (selective-display-ellipses display boolean) |
516b77a3 | 51 | (indicate-empty-lines fringe boolean) |
eb94dac6 LT |
52 | (indicate-buffer-boundaries |
53 | fringe | |
54 | (choice | |
55 | (const :tag "No indicators" nil) | |
56 | (const :tag "On left, with arrows" left) | |
57 | (const :tag "On right, with arrows" right) | |
a4fbb790 LT |
58 | (set :tag "Pick your own design" |
59 | :value ((t . nil)) | |
60 | :format "%{%t%}:\n%v\n%d" | |
61 | :doc "You can specify a default and then override it \ | |
62 | for individual indicators. | |
63 | Leaving \"Default\" unchecked is equivalent with specifying a default of | |
64 | \"Do not show\"." | |
65 | (choice :tag "Default" | |
66 | :value (t . nil) | |
67 | (const :tag "Do not show" (t . nil)) | |
68 | (const :tag "On the left" (t . left)) | |
69 | (const :tag "On the right" (t . right))) | |
70 | (choice :tag "Top" | |
71 | :value (top . left) | |
72 | (const :tag "Do not show" (top . nil)) | |
73 | (const :tag "On the left" (top . left)) | |
74 | (const :tag "On the right" (top . right))) | |
75 | (choice :tag "Bottom" | |
76 | :value (bottom . left) | |
77 | (const :tag "Do not show" (bottom . nil)) | |
78 | (const :tag "On the left" (bottom . left)) | |
79 | (const :tag "On the right" (bottom . right))) | |
80 | (choice :tag "Up arrow" | |
81 | :value (up . left) | |
82 | (const :tag "Do not show" (up . nil)) | |
83 | (const :tag "On the left" (up . left)) | |
84 | (const :tag "On the right" (up . right))) | |
85 | (choice :tag "Down arrow" | |
86 | :value (down . left) | |
87 | (const :tag "Do not show" (down . nil)) | |
88 | (const :tag "On the left" (down . left)) | |
89 | (const :tag "On the right" (down . right)))) | |
516b77a3 | 90 | (other :tag "On left, no arrows" t))) |
c6d57325 RS |
91 | (scroll-up-aggressively windows |
92 | (choice (const :tag "off" nil) number) | |
93 | "21.1") | |
94 | (scroll-down-aggressively windows | |
95 | (choice (const :tag "off" nil) number) | |
96 | "21.1") | |
6671cab3 MR |
97 | (line-spacing display (choice (const :tag "none" nil) integer) |
98 | "22.1") | |
ec514007 | 99 | (cursor-in-non-selected-windows |
c8c59954 GM |
100 | cursor boolean nil |
101 | :tag "Cursor In Non-selected Windows" | |
ec514007 GM |
102 | :set #'(lambda (symbol value) |
103 | (set-default symbol value) | |
104 | (force-mode-line-update t))) | |
9d794026 | 105 | (transient-mark-mode editing-basics boolean nil |
c8c59954 | 106 | :standard (not noninteractive) |
88f43c67 GM |
107 | :initialize custom-initialize-delay |
108 | :set custom-set-minor-mode) | |
1444b0c0 PA |
109 | ;; callint.c |
110 | (mark-even-if-inactive editing-basics boolean) | |
111 | ;; callproc.c | |
112 | (shell-file-name execute file) | |
113 | (exec-path execute | |
f747a488 | 114 | (repeat (choice (const :tag "default directory" nil) |
72e869ba | 115 | (directory :format "%v")))) |
5e3097cd | 116 | ;; charset.c |
c11f69e1 KH |
117 | (charset-map-path installation |
118 | (repeat (directory :format "%v"))) | |
5fc9eb7c DL |
119 | ;; coding.c |
120 | (inhibit-eol-conversion mule boolean) | |
de0d1fc5 EZ |
121 | (eol-mnemonic-undecided mule string) |
122 | (eol-mnemonic-unix mule string) | |
123 | (eol-mnemonic-dos mule string) | |
124 | (eol-mnemonic-mac mule string) | |
13eb63ff DL |
125 | (file-coding-system-alist |
126 | mule | |
127 | (alist | |
128 | :key-type (regexp :tag "File regexp") | |
129 | :value-type (choice | |
130 | :value (undecided . undecided) | |
131 | (cons :tag "Encoding/decoding pair" | |
132 | :value (undecided . undecided) | |
133 | (coding-system :tag "Decoding") | |
134 | (coding-system :tag "Encoding")) | |
70c2811c KY |
135 | (coding-system |
136 | :tag "Single coding system" | |
137 | :value undecided | |
138 | :match (lambda (widget value) | |
139 | (and value (not (functionp value))))) | |
13eb63ff | 140 | (function :value ignore)))) |
1444b0c0 | 141 | ;; dired.c |
71296446 | 142 | (completion-ignored-extensions dired |
1444b0c0 | 143 | (repeat (string :format "%v"))) |
0849a37e | 144 | ;; dispnew.c |
1444b0c0 PA |
145 | (baud-rate display integer) |
146 | (inverse-video display boolean) | |
147 | (visible-bell display boolean) | |
148 | (no-redraw-on-reenter display boolean) | |
149 | ;; editfns.c | |
150 | (user-full-name mail string) | |
151 | ;; eval.c | |
152 | (max-specpdl-size limits integer) | |
153 | (max-lisp-eval-depth limits integer) | |
f8add097 RS |
154 | (max-mini-window-height limits |
155 | (choice (const :tag "quarter screen" nil) | |
6671cab3 | 156 | number) "23.1") |
1444b0c0 PA |
157 | (stack-trace-on-error debug |
158 | (choice (const :tag "off") | |
159 | (repeat :menu-tag "When" | |
160 | :value (nil) | |
161 | (symbol :format "%v")) | |
162 | (const :tag "always" t))) | |
71296446 | 163 | (debug-on-error debug |
1444b0c0 PA |
164 | (choice (const :tag "off") |
165 | (repeat :menu-tag "When" | |
166 | :value (nil) | |
167 | (symbol :format "%v")) | |
168 | (const :tag "always" t))) | |
169 | (debug-ignored-errors debug (repeat (choice symbol regexp))) | |
507c9247 RS |
170 | (debug-on-quit debug |
171 | (choice (const :tag "off") | |
172 | (repeat :menu-tag "When" | |
173 | :value (nil) | |
174 | (symbol :format "%v")) | |
175 | (const :tag "always" t))) | |
6cf29fe8 JR |
176 | ;; fileio.c |
177 | (delete-by-moving-to-trash auto-save boolean "23.1") | |
6ba7a6f0 | 178 | (auto-save-visited-file-name auto-save boolean) |
e088c02a GM |
179 | ;; filelock.c |
180 | (temporary-file-directory | |
181 | ;; Darwin section added 24.1, does not seem worth :version bump. | |
182 | files directory nil | |
c8c59954 | 183 | :standard |
e088c02a GM |
184 | (file-name-as-directory |
185 | ;; FIXME ? Should there be Ftemporary_file_directory to do this | |
186 | ;; more robustly (cf set_local_socket in emacsclient.c). | |
187 | ;; It could be used elsewhere, eg Fcall_process_region, | |
188 | ;; server-socket-dir. See bug#7135. | |
189 | (cond ((memq system-type '(ms-dos windows-nt)) | |
190 | (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") | |
191 | "c:/temp")) | |
192 | ((eq system-type 'darwin) | |
193 | (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") | |
194 | ;; See bug#7135. | |
195 | (let ((tmp (ignore-errors | |
196 | (shell-command-to-string | |
197 | "getconf DARWIN_USER_TEMP_DIR")))) | |
198 | (and (stringp tmp) | |
199 | (setq tmp (replace-regexp-in-string | |
200 | "\n\\'" "" tmp)) | |
201 | ;; Handles "getconf: Unrecognized variable..." | |
202 | (file-directory-p tmp) | |
203 | tmp)) | |
204 | "/tmp")) | |
205 | (t | |
206 | (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") | |
207 | "/tmp")))) | |
208 | :initialize custom-initialize-delay) | |
78976e0a | 209 | ;; fns.c |
37328bcd | 210 | (use-dialog-box menu boolean "21.1") |
bf247b6e | 211 | (use-file-dialog menu boolean "22.1") |
f4c307a5 | 212 | (focus-follows-mouse frames boolean "20.3") |
1444b0c0 PA |
213 | ;; frame.c |
214 | (default-frame-alist frames | |
215 | (repeat (cons :format "%v" | |
216 | (symbol :tag "Parameter") | |
217 | (sexp :tag "Value")))) | |
140fb7ff KS |
218 | (mouse-highlight mouse (choice (const :tag "disabled" nil) |
219 | (const :tag "always shown" t) | |
6671cab3 MR |
220 | (other :tag "hidden by keypress" 1)) |
221 | "22.1") | |
e044e4fc | 222 | (make-pointer-invisible mouse boolean "23.2") |
c8c59954 | 223 | (menu-bar-mode frames boolean nil |
88f43c67 GM |
224 | ;; FIXME? |
225 | ; :initialize custom-initialize-default | |
226 | :set custom-set-minor-mode) | |
c8c59954 | 227 | (tool-bar-mode (frames mouse) boolean nil |
88f43c67 GM |
228 | ; :initialize custom-initialize-default |
229 | :set custom-set-minor-mode) | |
48d707c5 | 230 | ;; fringe.c |
516b77a3 | 231 | (overflow-newline-into-fringe fringe boolean) |
1444b0c0 | 232 | ;; indent.c |
01892a52 | 233 | (indent-tabs-mode indent boolean) |
1444b0c0 PA |
234 | ;; keyboard.c |
235 | (meta-prefix-char keyboard character) | |
236 | (auto-save-interval auto-save integer) | |
237 | (auto-save-timeout auto-save (choice (const :tag "off" nil) | |
238 | (integer :format "%v"))) | |
ac1b1728 | 239 | (echo-keystrokes minibuffer number) |
1444b0c0 | 240 | (polling-period keyboard integer) |
4db2b1c7 RS |
241 | (double-click-time mouse (restricted-sexp |
242 | :match-alternatives (integerp 'nil 't))) | |
6671cab3 | 243 | (double-click-fuzz mouse integer "22.1") |
1444b0c0 PA |
244 | (inhibit-local-menu-bar-menus menu boolean) |
245 | (help-char keyboard character) | |
246 | (help-event-list keyboard (repeat (sexp :format "%v"))) | |
247 | (menu-prompting menu boolean) | |
9852377f | 248 | (select-active-regions killing |
7c23dd44 CY |
249 | (choice (const :tag "always" t) |
250 | (const :tag "only shift-selection or mouse-drag" only) | |
9852377f CY |
251 | (const :tag "off" nil)) |
252 | "24.1") | |
1444b0c0 PA |
253 | (suggest-key-bindings keyboard (choice (const :tag "off" nil) |
254 | (integer :tag "time" 2) | |
79221864 | 255 | (other :tag "on"))) |
5f537e54 | 256 | |
37328bcd DL |
257 | ;; This is not good news because it will use the wrong |
258 | ;; version-specific directories when you upgrade. We need | |
259 | ;; customization of the front of the list, maintaining the standard | |
260 | ;; value intact at the back. | |
71296446 | 261 | ;;; (load-path environment |
37328bcd DL |
262 | ;;; (repeat (choice :tag "[Current dir?]" |
263 | ;;; :format "%[Current dir?%] %v" | |
264 | ;;; (const :tag " current dir" nil) | |
265 | ;;; (directory :format "%v")))) | |
1444b0c0 | 266 | ;; minibuf.c |
1444b0c0 | 267 | (enable-recursive-minibuffers minibuffer boolean) |
408f56b2 | 268 | (history-length minibuffer |
6671cab3 MR |
269 | (choice (const :tag "Infinite" t) integer) |
270 | "22.1") | |
271 | (history-delete-duplicates minibuffer boolean "22.1") | |
ed278e5d CY |
272 | (read-buffer-completion-ignore-case minibuffer boolean "23.1") |
273 | ||
8f62f2b8 MB |
274 | (minibuffer-prompt-properties |
275 | minibuffer | |
276 | (list | |
277 | (checklist :inline t | |
278 | (const :tag "Read-Only" | |
279 | :doc "Prevent prompt from being modified" | |
280 | :format "%t%n%h" | |
281 | :inline t | |
282 | (read-only t)) | |
c9133fa6 | 283 | (const :tag "Don't Enter" |
8f62f2b8 MB |
284 | :doc "Prevent point from ever entering prompt" |
285 | :format "%t%n%h" | |
286 | :inline t | |
287 | (point-entered minibuffer-avoid-prompt))) | |
288 | (repeat :inline t | |
289 | :tag "Other Properties" | |
290 | (list :inline t | |
291 | :format "%v" | |
292 | (symbol :tag "Property") | |
ecf5279a DL |
293 | (sexp :tag "Value")))) |
294 | "21.1") | |
1444b0c0 | 295 | (minibuffer-auto-raise minibuffer boolean) |
ecf5279a | 296 | ;; options property set at end |
a8a1b05d DL |
297 | (read-buffer-function minibuffer |
298 | (choice (const nil) | |
299 | (function-item iswitchb-read-buffer) | |
300 | function)) | |
b78fba02 EZ |
301 | ;; msdos.c |
302 | (dos-unsupported-char-glyph display integer) | |
bc9ebf41 | 303 | ;; nsterm.m |
77346ecd | 304 | (ns-control-modifier |
ae2349fe | 305 | ns |
bc9ebf41 DR |
306 | (choice (const :tag "No modifier" nil) |
307 | (const control) (const meta) | |
308 | (const alt) (const hyper) | |
309 | (const super)) "23.1") | |
77346ecd | 310 | (ns-command-modifier |
ae2349fe | 311 | ns |
bc9ebf41 DR |
312 | (choice (const :tag "No modifier" nil) |
313 | (const control) (const meta) | |
314 | (const alt) (const hyper) | |
315 | (const super)) "23.1") | |
77346ecd | 316 | (ns-alternate-modifier |
ae2349fe | 317 | ns |
bc9ebf41 DR |
318 | (choice (const :tag "No modifier (work as alternate/option)" none) |
319 | (const control) (const meta) | |
320 | (const alt) (const hyper) | |
321 | (const super)) "23.1") | |
a2e35ef5 JD |
322 | (ns-right-alternate-modifier |
323 | ns | |
324 | (choice (const :tag "No modifier (work as alternate/option)" none) | |
325 | (const :tag "Use the value of ns-alternate-modifier" | |
326 | left) | |
327 | (const control) (const meta) | |
328 | (const alt) (const hyper) | |
329 | (const super)) "23.3") | |
77346ecd | 330 | (ns-function-modifier |
ae2349fe | 331 | ns |
bc9ebf41 DR |
332 | (choice (const :tag "No modifier (work as function)" none) |
333 | (const control) (const meta) | |
334 | (const alt) (const hyper) | |
335 | (const super)) "23.1") | |
336 | (ns-antialias-text ns boolean "23.1") | |
1444b0c0 | 337 | ;; process.c |
4883633e | 338 | (delete-exited-processes processes-basics boolean) |
1444b0c0 PA |
339 | ;; syntax.c |
340 | (parse-sexp-ignore-comments editing-basics boolean) | |
341 | (words-include-escapes editing-basics boolean) | |
6b61353c KH |
342 | (open-paren-in-column-0-is-defun-start editing-basics boolean |
343 | "21.1") | |
98e071b5 SM |
344 | ;; term.c |
345 | (visible-cursor cursor boolean "22.1") | |
0f08b956 LT |
346 | ;; undo.c |
347 | (undo-limit undo integer) | |
348 | (undo-strong-limit undo integer) | |
349 | (undo-outer-limit undo | |
350 | (choice integer | |
351 | (const :tag "No limit" | |
352 | :format "%t\n%d" | |
353 | :doc | |
354 | "With this choice, \ | |
355 | the undo info for the current command never gets discarded. | |
356 | This should only be chosen under exceptional circumstances, | |
357 | since it could result in memory overflow and make Emacs crash." | |
358 | nil)) | |
359 | "22.1") | |
1444b0c0 | 360 | ;; window.c |
4cb464b7 | 361 | (temp-buffer-show-function windows (choice (const nil) function)) |
74f54b54 | 362 | (next-screen-context-lines windows integer) |
1444b0c0 PA |
363 | (window-min-height windows integer) |
364 | (window-min-width windows integer) | |
7704b6b1 KS |
365 | (scroll-preserve-screen-position |
366 | windows (choice | |
367 | (const :tag "Off (nil)" :value nil) | |
368 | (const :tag "Full screen (t)" :value t) | |
6671cab3 | 369 | (other :tag "Always" 1)) "22.1") |
666e158e MB |
370 | (recenter-redisplay windows |
371 | (choice | |
372 | (const :tag "Never (nil)" :value nil) | |
373 | (const :tag "Only on ttys" :value tty) | |
374 | (other :tag "Always" t)) | |
375 | "23.1") | |
1444b0c0 | 376 | ;; xdisp.c |
c8c59954 | 377 | (show-trailing-whitespace whitespace-faces boolean nil |
ec514007 | 378 | :safe booleanp) |
1444b0c0 | 379 | (scroll-step windows integer) |
ccbb360e RS |
380 | (scroll-conservatively windows integer) |
381 | (scroll-margin windows integer) | |
4e371ce8 EZ |
382 | (hscroll-margin windows integer "22.1") |
383 | (hscroll-step windows number "22.1") | |
3a66cc91 | 384 | (truncate-partial-width-windows display boolean "23.1") |
e45db0fb MR |
385 | (mode-line-inverse-video mode-line boolean) |
386 | (mode-line-in-non-selected-windows mode-line boolean "22.1") | |
37328bcd DL |
387 | (line-number-display-limit display |
388 | (choice integer | |
389 | (const :tag "No limit" nil))) | |
6671cab3 | 390 | (line-number-display-limit-width display integer "22.1") |
1444b0c0 PA |
391 | (highlight-nonselected-windows display boolean) |
392 | (message-log-max debug (choice (const :tag "Disable" nil) | |
393 | (integer :menu-tag "lines" | |
394 | :format "%v") | |
79221864 | 395 | (other :tag "Unlimited" t))) |
daba3e25 | 396 | (unibyte-display-via-language-environment mule boolean) |
bf247b6e | 397 | (blink-cursor-alist cursor alist "22.1") |
03c25271 | 398 | (overline-margin display integer "22.1") |
2a3bd2e1 | 399 | (underline-minimum-offset display integer "23.1") |
612c16f1 CY |
400 | (mouse-autoselect-window |
401 | display (choice | |
402 | (const :tag "Off (nil)" :value nil) | |
403 | (const :tag "Immediate" :value t) | |
404 | (number :tag "Delay by secs" :value 0.5)) "22.1") | |
f904c0f9 JD |
405 | (tool-bar-style |
406 | frames (choice | |
407 | (const :tag "Images" :value image) | |
408 | (const :tag "Text" :value text) | |
409 | (const :tag "Both" :value both) | |
410 | (const :tag "Both-horiz" :value both-horiz) | |
8a52f00a | 411 | (const :tag "Text-image-horiz" :value text-image-horiz) |
f904c0f9 JD |
412 | (const :tag "System default" :value nil)) "23.3") |
413 | (tool-bar-max-label-size frames integer "23.3") | |
ec514007 GM |
414 | (auto-hscroll-mode scrolling boolean "21.1") |
415 | (display-hourglass cursor boolean) | |
416 | (hourglass-delay cursor number) | |
f904c0f9 | 417 | |
e5f51929 | 418 | ;; xfaces.c |
6671cab3 | 419 | (scalable-fonts-allowed display boolean "22.1") |
1444b0c0 PA |
420 | ;; xfns.c |
421 | (x-bitmap-file-path installation | |
0849a37e | 422 | (repeat (directory :format "%v"))) |
c4823934 | 423 | (x-gtk-use-old-file-dialog menu boolean "22.1") |
91b5a204 | 424 | (x-gtk-show-hidden-files menu boolean "22.1") |
c4823934 | 425 | (x-gtk-file-dialog-help-text menu boolean "22.1") |
0dd95b49 | 426 | (x-gtk-whole-detached-tool-bar x boolean "22.1") |
aa1859f5 | 427 | (x-gtk-use-system-tooltips tooltip boolean "23.3") |
0849a37e | 428 | ;; xterm.c |
4e371ce8 | 429 | (x-use-underline-position-properties display boolean "22.1") |
03c25271 | 430 | (x-underline-at-descent-line display boolean "22.1") |
dfb3c4c6 JD |
431 | (x-stretch-cursor display boolean "21.1") |
432 | ;; xsettings.c | |
433 | (font-use-system-font font-selection boolean "23.2"))) | |
ec514007 | 434 | this symbol group type standard version native-p rest prop propval |
4883633e RS |
435 | ;; This function turns a value |
436 | ;; into an expression which produces that value. | |
437 | (quoter (lambda (sexp) | |
438 | (if (or (memq sexp '(t nil)) | |
017266f8 | 439 | (keywordp sexp) |
4883633e RS |
440 | (and (listp sexp) |
441 | (memq (car sexp) '(lambda))) | |
442 | (stringp sexp) | |
37328bcd | 443 | (numberp sexp)) |
4883633e RS |
444 | sexp |
445 | (list 'quote sexp))))) | |
71296446 | 446 | (while all |
1444b0c0 PA |
447 | (setq this (car all) |
448 | all (cdr all) | |
449 | symbol (nth 0 this) | |
450 | group (nth 1 this) | |
00377857 | 451 | type (nth 2 this) |
37328bcd | 452 | version (nth 3 this) |
c8c59954 | 453 | rest (nthcdr 4 this) |
a200d998 RS |
454 | ;; If we did not specify any standard value expression above, |
455 | ;; use the current value as the standard value. | |
c8c59954 GM |
456 | standard (if (setq prop (memq :standard rest)) |
457 | (cadr prop) | |
458 | (if (default-boundp symbol) | |
459 | (funcall quoter (default-value symbol)))) | |
00377857 EZ |
460 | ;; Don't complain about missing variables which are |
461 | ;; irrelevant to this platform. | |
462 | native-p (save-match-data | |
463 | (cond | |
464 | ((string-match "\\`dos-" (symbol-name symbol)) | |
465 | (eq system-type 'ms-dos)) | |
466 | ((string-match "\\`w32-" (symbol-name symbol)) | |
467 | (eq system-type 'windows-nt)) | |
77346ecd EZ |
468 | ((string-match "\\`ns-" (symbol-name symbol)) |
469 | (featurep 'ns)) | |
2702394e | 470 | ((string-match "\\`x-.*gtk" (symbol-name symbol)) |
79cf2123 | 471 | (featurep 'gtk)) |
197a09bf EZ |
472 | ((string-match "\\`x-" (symbol-name symbol)) |
473 | (fboundp 'x-create-frame)) | |
6eb33acb EZ |
474 | ((string-match "selection" (symbol-name symbol)) |
475 | (fboundp 'x-selection-exists-p)) | |
476 | ((string-match "fringe" (symbol-name symbol)) | |
477 | (fboundp 'define-fringe-bitmap)) | |
8b571bf3 JD |
478 | ((equal "font-use-system-font" (symbol-name symbol)) |
479 | (featurep 'system-font-setting)) | |
c0162ade EZ |
480 | ;; Conditioned on x-create-frame, because that's |
481 | ;; the condition for loadup.el to preload tool-bar.el. | |
482 | ((string-match "tool-bar-" (symbol-name symbol)) | |
483 | (fboundp 'x-create-frame)) | |
00377857 | 484 | (t t)))) |
1444b0c0 PA |
485 | (if (not (boundp symbol)) |
486 | ;; If variables are removed from C code, give an error here! | |
00377857 EZ |
487 | (and native-p |
488 | (message "Note, built-in variable `%S' not bound" symbol)) | |
4883633e RS |
489 | ;; Save the standard value, unless we already did. |
490 | (or (get symbol 'standard-value) | |
a200d998 | 491 | (put symbol 'standard-value (list standard))) |
ec514007 GM |
492 | ;; We need these properties independent of whether cus-start is loaded. |
493 | (if (setq prop (memq :safe rest)) | |
494 | (put symbol 'safe-local-variable (cadr prop))) | |
495 | (if (setq prop (memq :risky rest)) | |
496 | (put symbol 'risky-local-variable (cadr prop))) | |
88f43c67 GM |
497 | (if (setq prop (memq :set rest)) |
498 | (put symbol 'custom-set (cadr prop))) | |
9d794026 GM |
499 | ;; Note this is the _only_ initialize property we handle. |
500 | (if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay) | |
501 | (push symbol custom-delayed-init-variables)) | |
88f43c67 GM |
502 | ;; If this is NOT while dumping Emacs, set up the rest of the |
503 | ;; customization info. This is the stuff that is not needed | |
504 | ;; until someone does M-x customize etc. | |
4883633e | 505 | (unless purify-flag |
9d794026 GM |
506 | ;; Add it to the right group(s). |
507 | (if (listp group) | |
508 | (dolist (g group) | |
509 | (custom-add-to-group g symbol 'custom-variable)) | |
510 | (custom-add-to-group group symbol 'custom-variable)) | |
4883633e | 511 | ;; Set the type. |
37328bcd | 512 | (put symbol 'custom-type type) |
c8c59954 | 513 | (if version (put symbol 'custom-version version)) |
ec514007 GM |
514 | (while rest |
515 | (setq prop (car rest) | |
516 | propval (cadr rest) | |
517 | rest (nthcdr 2 rest)) | |
c8c59954 | 518 | (cond ((memq prop '(:standard :risky :safe :set))) ; handled above |
ec514007 GM |
519 | ((eq prop :tag) |
520 | (put symbol 'custom-tag propval)))))))) | |
4883633e | 521 | |
ecf5279a | 522 | (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable) |
6b61353c KH |
523 | (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start |
524 | 'custom-variable) | |
ecf5279a | 525 | |
ec514007 GM |
526 | ;; Record cus-start as loaded if we have set up all the info that we can. |
527 | ;; Don't record it as loaded if we have only set up the standard values | |
528 | ;; and safe/risky properties. | |
4883633e RS |
529 | (unless purify-flag |
530 | (provide 'cus-start)) | |
1444b0c0 | 531 | |
1cd7adc6 | 532 | ;;; cus-start.el ends here |