1 ;;; cus-start.el --- define customization properties of builtins
3 ;; Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc.
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
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/>.
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.
36 ;; Elements of this list have the form:
37 ;; SYMBOL GROUP TYPE VERSION REST...
38 ;; SYMBOL is the name of the variable.
39 ;; GROUP is the custom group to which it belongs (may also be a list
41 ;; TYPE is the defcustom :type.
42 ;; VERSION is the defcustom :version (or nil).
43 ;; REST is a set of :KEYWORD VALUE pairs. Accepted :KEYWORDs are:
44 ;; :standard - standard value for SYMBOL (else use current value)
45 ;; :set - custom-set property
46 ;; :risky - risky-local-variable property
47 ;; :safe - safe-local-variable property
48 ;; :tag - custom-tag property
49 (let ((all '(;; alloc.c
50 (gc-cons-threshold alloc integer
)
51 (gc-cons-percentage alloc float
)
52 (garbage-collection-messages alloc boolean
)
54 (mode-line-format mode-line sexp
) ;Hard to do right.
55 (major-mode internal function
)
56 (case-fold-search matching boolean
)
57 (fill-column fill integer
)
58 (left-margin fill integer
)
59 (tab-width editing-basics integer
)
60 (ctl-arrow display boolean
)
61 (truncate-lines display boolean
)
62 (word-wrap display boolean
)
63 (selective-display-ellipses display boolean
)
64 (indicate-empty-lines fringe boolean
)
65 (indicate-buffer-boundaries
68 (const :tag
"No indicators" nil
)
69 (const :tag
"On left, with arrows" left
)
70 (const :tag
"On right, with arrows" right
)
71 (set :tag
"Pick your own design"
73 :format
"%{%t%}:\n%v\n%d"
74 :doc
"You can specify a default and then override it \
75 for individual indicators.
76 Leaving \"Default\" unchecked is equivalent with specifying a default of
78 (choice :tag
"Default"
80 (const :tag
"Do not show" (t . nil
))
81 (const :tag
"On the left" (t . left
))
82 (const :tag
"On the right" (t . right
)))
85 (const :tag
"Do not show" (top . nil
))
86 (const :tag
"On the left" (top . left
))
87 (const :tag
"On the right" (top . right
)))
89 :value
(bottom . left
)
90 (const :tag
"Do not show" (bottom . nil
))
91 (const :tag
"On the left" (bottom . left
))
92 (const :tag
"On the right" (bottom . right
)))
93 (choice :tag
"Up arrow"
95 (const :tag
"Do not show" (up . nil
))
96 (const :tag
"On the left" (up . left
))
97 (const :tag
"On the right" (up . right
)))
98 (choice :tag
"Down arrow"
100 (const :tag
"Do not show" (down . nil
))
101 (const :tag
"On the left" (down . left
))
102 (const :tag
"On the right" (down . right
))))
103 (other :tag
"On left, no arrows" t
)))
104 (scroll-up-aggressively windows
105 (choice (const :tag
"off" nil
) number
)
107 (scroll-down-aggressively windows
108 (choice (const :tag
"off" nil
) number
)
110 (line-spacing display
(choice (const :tag
"none" nil
) integer
)
112 (cursor-in-non-selected-windows
114 :tag
"Cursor In Non-selected Windows"
115 :set
(lambda (symbol value
)
116 (set-default symbol value
)
117 (force-mode-line-update t
)))
118 (transient-mark-mode editing-basics boolean nil
119 :standard
(not noninteractive
)
120 :initialize custom-initialize-delay
121 :set custom-set-minor-mode
)
122 (bidi-paragraph-direction
125 (const :tag
"Left to Right" left-to-right
)
126 (const :tag
"Right to Left" right-to-left
)
127 (const :tag
"Dynamic, according to paragraph text" nil
))
130 (mark-even-if-inactive editing-basics boolean
)
132 (shell-file-name execute file
)
134 (repeat (choice (const :tag
"default directory" nil
)
135 (directory :format
"%v"))))
136 (exec-suffixes execute
(repeat string
))
138 (charset-map-path installation
139 (repeat (directory :format
"%v")))
141 (inhibit-eol-conversion mule boolean
)
142 (eol-mnemonic-undecided mule string
)
143 ;; startup.el fiddles with the values. IMO, would be
144 ;; simpler to just use #ifdefs in coding.c.
145 (eol-mnemonic-unix mule string nil
147 (if (memq system-type
'(ms-dos windows-nt
))
149 (eol-mnemonic-dos mule string nil
151 (if (memq system-type
'(ms-dos windows-nt
))
153 (eol-mnemonic-mac mule string nil
155 (file-coding-system-alist
158 :key-type
(regexp :tag
"File regexp")
160 :value
(undecided . undecided
)
161 (cons :tag
"Encoding/decoding pair"
162 :value
(undecided . undecided
)
163 (coding-system :tag
"Decoding")
164 (coding-system :tag
"Encoding"))
166 :tag
"Single coding system"
168 :match
(lambda (widget value
)
169 (and value
(not (functionp value
)))))
170 (function :value ignore
))))
172 (completion-ignored-extensions dired
173 (repeat (string :format
"%v")))
175 (baud-rate display integer
)
176 (inverse-video display boolean
)
177 (visible-bell display boolean
)
178 (no-redraw-on-reenter display boolean
)
181 (dos-display-scancodes display boolean
)
182 (dos-hyper-key keyboard integer
)
183 (dos-super-key keyboard integer
)
184 (dos-keypad-mode keyboard integer
)
187 (user-full-name mail string
)
189 (max-specpdl-size limits integer
)
190 (max-lisp-eval-depth limits integer
)
191 (max-mini-window-height limits
192 (choice (const :tag
"quarter screen" nil
)
194 (debug-on-error debug
195 (choice (const :tag
"off")
196 (repeat :menu-tag
"When"
198 (symbol :format
"%v"))
199 (const :tag
"always" t
)))
200 (debug-ignored-errors debug
(repeat (choice symbol regexp
)))
201 (debug-on-quit debug boolean
)
202 (debug-on-signal debug boolean
)
204 (delete-by-moving-to-trash auto-save boolean
"23.1")
205 (auto-save-visited-file-name auto-save boolean
)
207 (create-lockfiles files boolean
"24.2")
208 (temporary-file-directory
209 ;; Darwin section added 24.1, does not seem worth :version bump.
212 (file-name-as-directory
213 ;; FIXME ? Should there be Ftemporary_file_directory to do this
214 ;; more robustly (cf set_local_socket in emacsclient.c).
215 ;; It could be used elsewhere, eg Fcall_process_region,
216 ;; server-socket-dir. See bug#7135.
217 (cond ((memq system-type
'(ms-dos windows-nt
))
218 (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
220 ((eq system-type
'darwin
)
221 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
223 (let ((tmp (ignore-errors
224 (shell-command-to-string
225 "getconf DARWIN_USER_TEMP_DIR"))))
227 (setq tmp
(replace-regexp-in-string
229 ;; Handles "getconf: Unrecognized variable..."
230 (file-directory-p tmp
)
234 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
236 :initialize custom-initialize-delay
)
238 (use-dialog-box menu boolean
"21.1")
239 (use-file-dialog menu boolean
"22.1")
240 (focus-follows-mouse frames boolean
"20.3")
242 (vertical-centering-font-regexp display regexp
)
244 (default-frame-alist frames
245 (repeat (cons :format
"%v"
246 (symbol :tag
"Parameter")
247 (sexp :tag
"Value"))))
248 (mouse-highlight mouse
(choice (const :tag
"disabled" nil
)
249 (const :tag
"always shown" t
)
250 (other :tag
"hidden by keypress" 1))
252 (make-pointer-invisible mouse boolean
"23.2")
253 (menu-bar-mode frames boolean nil
255 ; :initialize custom-initialize-default
256 :set custom-set-minor-mode
)
257 (tool-bar-mode (frames mouse
) boolean nil
258 ; :initialize custom-initialize-default
259 :set custom-set-minor-mode
)
261 (overflow-newline-into-fringe fringe boolean
)
263 (imagemagick-render-type image integer
"24.1")
265 (indent-tabs-mode indent boolean
)
267 (meta-prefix-char keyboard character
)
268 (auto-save-interval auto-save integer
)
269 (auto-save-timeout auto-save
(choice (const :tag
"off" nil
)
270 (integer :format
"%v")))
271 (echo-keystrokes minibuffer number
)
272 (polling-period keyboard integer
)
273 (double-click-time mouse
(restricted-sexp
274 :match-alternatives
(integerp 'nil
't
)))
275 (double-click-fuzz mouse integer
"22.1")
276 (inhibit-local-menu-bar-menus menu boolean
)
277 (help-char keyboard character
)
278 (help-event-list keyboard
(repeat (sexp :format
"%v")))
279 (menu-prompting menu boolean
)
280 (select-active-regions killing
281 (choice (const :tag
"always" t
)
282 (const :tag
"only shift-selection or mouse-drag" only
)
283 (const :tag
"off" nil
))
285 (debug-on-event debug
286 (choice (const :tag
"None" nil
)
287 (const :tag
"When sent SIGUSR1" sigusr1
)
288 (const :tag
"When sent SIGUSR2" sigusr2
))
291 ;; This is not good news because it will use the wrong
292 ;; version-specific directories when you upgrade. We need
293 ;; customization of the front of the list, maintaining the standard
294 ;; value intact at the back.
295 ;;; (load-path environment
296 ;;; (repeat (choice :tag "[Current dir?]"
297 ;;; :format "%[Current dir?%] %v"
298 ;;; (const :tag " current dir" nil)
299 ;;; (directory :format "%v"))))
301 (enable-recursive-minibuffers minibuffer boolean
)
302 (history-length minibuffer
303 (choice (const :tag
"Infinite" t
) integer
)
305 (history-delete-duplicates minibuffer boolean
"22.1")
306 (read-buffer-completion-ignore-case minibuffer boolean
"23.1")
308 (minibuffer-prompt-properties
312 (const :tag
"Read-Only"
313 :doc
"Prevent prompt from being modified"
317 (const :tag
"Don't Enter"
318 :doc
"Prevent point from ever entering prompt"
321 (point-entered minibuffer-avoid-prompt
)))
323 :tag
"Other Properties"
326 (symbol :tag
"Property")
327 (sexp :tag
"Value"))))
329 (minibuffer-auto-raise minibuffer boolean
)
330 ;; options property set at end
331 (read-buffer-function minibuffer
333 (function-item iswitchb-read-buffer
)
336 (dos-unsupported-char-glyph display integer
)
340 (choice (const :tag
"No modifier" nil
)
341 (const control
) (const meta
)
342 (const alt
) (const hyper
)
343 (const super
)) "23.1")
344 (ns-right-control-modifier
346 (choice (const :tag
"No modifier (work as control)" none
)
347 (const :tag
"Use the value of ns-control-modifier"
349 (const control
) (const meta
)
350 (const alt
) (const hyper
)
351 (const super
)) "24.0")
354 (choice (const :tag
"No modifier" nil
)
355 (const control
) (const meta
)
356 (const alt
) (const hyper
)
357 (const super
)) "23.1")
358 (ns-right-command-modifier
360 (choice (const :tag
"No modifier (work as command)" none
)
361 (const :tag
"Use the value of ns-command-modifier"
363 (const control
) (const meta
)
364 (const alt
) (const hyper
)
365 (const super
)) "24.0")
366 (ns-alternate-modifier
368 (choice (const :tag
"No modifier (work as alternate/option)" none
)
369 (const control
) (const meta
)
370 (const alt
) (const hyper
)
371 (const super
)) "23.1")
372 (ns-right-alternate-modifier
374 (choice (const :tag
"No modifier (work as alternate/option)" none
)
375 (const :tag
"Use the value of ns-alternate-modifier"
377 (const control
) (const meta
)
378 (const alt
) (const hyper
)
379 (const super
)) "23.3")
380 (ns-function-modifier
382 (choice (const :tag
"No modifier (work as function)" none
)
383 (const control
) (const meta
)
384 (const alt
) (const hyper
)
385 (const super
)) "23.1")
386 (ns-antialias-text ns boolean
"23.1")
387 (ns-auto-hide-menu-bar ns boolean
"24.0")
389 (delete-exited-processes processes-basics boolean
)
391 (parse-sexp-ignore-comments editing-basics boolean
)
392 (words-include-escapes editing-basics boolean
)
393 (open-paren-in-column-0-is-defun-start editing-basics boolean
396 (visible-cursor cursor boolean
"22.1")
398 (undo-limit undo integer
)
399 (undo-strong-limit undo integer
)
400 (undo-outer-limit undo
402 (const :tag
"No limit"
406 the undo info for the current command never gets discarded.
407 This should only be chosen under exceptional circumstances,
408 since it could result in memory overflow and make Emacs crash."
412 (temp-buffer-show-function windows
(choice (const nil
) function
))
413 (next-screen-context-lines windows integer
)
414 (scroll-preserve-screen-position
416 (const :tag
"Off (nil)" :value nil
)
417 (const :tag
"Full screen (t)" :value t
)
418 (other :tag
"Always" 1)) "22.1")
421 (const :tag
"Never (nil)" :value nil
)
422 (const :tag
"Only on ttys" :value tty
)
423 (other :tag
"Always" t
)) "23.1")
424 (window-combination-resize windows boolean
"24.1")
425 (window-combination-limit windows boolean
"24.1")
427 (show-trailing-whitespace whitespace-faces boolean nil
429 (scroll-step windows integer
)
430 (scroll-conservatively windows integer
)
431 (scroll-margin windows integer
)
432 (hscroll-margin windows integer
"22.1")
433 (hscroll-step windows number
"22.1")
434 (truncate-partial-width-windows display boolean
"23.1")
435 (make-cursor-line-fully-visible windows boolean
)
436 (mode-line-inverse-video mode-line boolean
)
437 (mode-line-in-non-selected-windows mode-line boolean
"22.1")
438 (line-number-display-limit display
440 (const :tag
"No limit" nil
)))
441 (line-number-display-limit-width display integer
"22.1")
442 (highlight-nonselected-windows display boolean
)
443 (message-log-max debug
(choice (const :tag
"Disable" nil
)
444 (integer :menu-tag
"lines"
446 (other :tag
"Unlimited" t
)))
447 (unibyte-display-via-language-environment mule boolean
)
448 (blink-cursor-alist cursor alist
"22.1")
449 (overline-margin display integer
"22.1")
450 (underline-minimum-offset display integer
"23.1")
451 (mouse-autoselect-window
453 (const :tag
"Off (nil)" :value nil
)
454 (const :tag
"Immediate" :value t
)
455 (number :tag
"Delay by secs" :value
0.5)) "22.1")
458 (const :tag
"Images" :value image
)
459 (const :tag
"Text" :value text
)
460 (const :tag
"Both" :value both
)
461 (const :tag
"Both-horiz" :value both-horiz
)
462 (const :tag
"Text-image-horiz" :value text-image-horiz
)
463 (const :tag
"System default" :value nil
)) "23.3")
464 (tool-bar-max-label-size frames integer
"23.3")
465 (auto-hscroll-mode scrolling boolean
"21.1")
466 (void-text-area-pointer cursor
468 (const :tag
"Standard (text pointer)" :value nil
)
469 (const :tag
"Arrow" :value arrow
)
470 (const :tag
"Text pointer" :value text
)
471 (const :tag
"Hand" :value hand
)
472 (const :tag
"Vertical dragger" :value vdrag
)
473 (const :tag
"Horizontal dragger" :value hdrag
)
474 (const :tag
"Same as mode line" :value modeline
)
475 (const :tag
"Hourglass" :value hourglass
)))
476 (display-hourglass cursor boolean
)
477 (hourglass-delay cursor number
)
480 (font-list-limit display integer
)
481 (scalable-fonts-allowed display boolean
"22.1")
483 (x-bitmap-file-path installation
484 (repeat (directory :format
"%v")))
485 (x-gtk-use-old-file-dialog menu boolean
"22.1")
486 (x-gtk-show-hidden-files menu boolean
"22.1")
487 (x-gtk-file-dialog-help-text menu boolean
"22.1")
488 (x-gtk-whole-detached-tool-bar x boolean
"22.1")
489 (x-gtk-use-system-tooltips tooltip boolean
"23.3")
491 (x-use-underline-position-properties display boolean
"22.1")
492 (x-underline-at-descent-line display boolean
"22.1")
493 (x-stretch-cursor display boolean
"21.1")
495 (x-select-enable-clipboard-manager killing boolean
"24.1")
497 (font-use-system-font font-selection boolean
"23.2")))
498 this symbol group type standard version native-p rest prop propval
499 ;; This function turns a value
500 ;; into an expression which produces that value.
501 (quoter (lambda (sexp)
502 (if (or (memq sexp
'(t nil
))
505 (memq (car sexp
) '(lambda)))
509 (list 'quote sexp
)))))
518 ;; If we did not specify any standard value expression above,
519 ;; use the current value as the standard value.
520 standard
(if (setq prop
(memq :standard rest
))
522 (if (default-boundp symbol
)
523 (funcall quoter
(default-value symbol
))))
524 ;; Don't complain about missing variables which are
525 ;; irrelevant to this platform.
526 native-p
(save-match-data
528 ((string-match "\\`dos-" (symbol-name symbol
))
529 (eq system-type
'ms-dos
))
530 ((string-match "\\`w32-" (symbol-name symbol
))
531 (eq system-type
'windows-nt
))
532 ((string-match "\\`ns-" (symbol-name symbol
))
534 ((string-match "\\`x-.*gtk" (symbol-name symbol
))
536 ((string-match "clipboard-manager" (symbol-name symbol
))
537 (boundp 'x-select-enable-clipboard-manager
))
538 ((string-match "\\`x-" (symbol-name symbol
))
539 (fboundp 'x-create-frame
))
540 ((string-match "selection" (symbol-name symbol
))
541 (fboundp 'x-selection-exists-p
))
542 ((string-match "fringe" (symbol-name symbol
))
543 (fboundp 'define-fringe-bitmap
))
544 ((string-match "\\`imagemagick" (symbol-name symbol
))
545 (fboundp 'imagemagick-types
))
546 ((equal "font-use-system-font" (symbol-name symbol
))
547 (featurep 'system-font-setting
))
548 ;; Conditioned on x-create-frame, because that's
549 ;; the condition for loadup.el to preload tool-bar.el.
550 ((string-match "tool-bar-" (symbol-name symbol
))
551 (fboundp 'x-create-frame
))
552 ((equal "vertical-centering-font-regexp"
553 (symbol-name symbol
))
554 ;; Any function from fontset.c will do.
555 (fboundp 'new-fontset
))
557 (if (not (boundp symbol
))
558 ;; If variables are removed from C code, give an error here!
560 (message "Note, built-in variable `%S' not bound" symbol
))
561 ;; Save the standard value, unless we already did.
562 (or (get symbol
'standard-value
)
563 (put symbol
'standard-value
(list standard
)))
564 ;; We need these properties independent of whether cus-start is loaded.
565 (if (setq prop
(memq :safe rest
))
566 (put symbol
'safe-local-variable
(cadr prop
)))
567 (if (setq prop
(memq :risky rest
))
568 (put symbol
'risky-local-variable
(cadr prop
)))
569 (if (setq prop
(memq :set rest
))
570 (put symbol
'custom-set
(cadr prop
)))
571 ;; Note this is the _only_ initialize property we handle.
572 (if (eq (cadr (memq :initialize rest
)) 'custom-initialize-delay
)
573 (push symbol custom-delayed-init-variables
))
574 ;; If this is NOT while dumping Emacs, set up the rest of the
575 ;; customization info. This is the stuff that is not needed
576 ;; until someone does M-x customize etc.
578 ;; Add it to the right group(s).
581 (custom-add-to-group g symbol
'custom-variable
))
582 (custom-add-to-group group symbol
'custom-variable
))
584 (put symbol
'custom-type type
)
585 (if version
(put symbol
'custom-version version
))
587 (setq prop
(car rest
)
589 rest
(nthcdr 2 rest
))
590 (cond ((memq prop
'(:standard
:risky
:safe
:set
))) ; handled above
592 (put symbol
'custom-tag propval
))))))))
594 (custom-add-to-group 'iswitchb
'read-buffer-function
'custom-variable
)
595 (custom-add-to-group 'font-lock
'open-paren-in-column-0-is-defun-start
598 ;; Record cus-start as loaded if we have set up all the info that we can.
599 ;; Don't record it as loaded if we have only set up the standard values
600 ;; and safe/risky properties.
602 (provide 'cus-start
))
604 ;;; cus-start.el ends here