1 ;;; cus-start.el --- define customization properties of builtins
3 ;; Copyright (C) 1997, 1999-2014 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
)
57 (const :tag
"Frame default" t
)
58 (const :tag
"Filled box" box
)
59 (const :tag
"Hollow cursor" hollow
)
60 (const :tag
"Vertical bar" bar
)
61 (cons :tag
"Vertical bar with specified width"
63 (const :tag
"Horizontal bar" hbar
)
64 (cons :tag
"Horizontal bar with specified width"
66 (const :tag
"None "nil
)))
67 (mode-line-format mode-line sexp
) ;Hard to do right.
68 (major-mode internal function
)
69 (case-fold-search matching boolean
)
70 (fill-column fill integer
)
71 (left-margin fill integer
)
72 (tab-width editing-basics integer
)
73 (ctl-arrow display boolean
)
74 (truncate-lines display boolean
)
75 (word-wrap display boolean
)
76 (selective-display-ellipses display boolean
)
77 (indicate-empty-lines fringe boolean
)
78 (indicate-buffer-boundaries
81 (const :tag
"No indicators" nil
)
82 (const :tag
"On left, with arrows" left
)
83 (const :tag
"On right, with arrows" right
)
84 (set :tag
"Pick your own design"
86 :format
"%{%t%}:\n%v\n%d"
87 :doc
"You can specify a default and then override it \
88 for individual indicators.
89 Leaving \"Default\" unchecked is equivalent with specifying a default of
91 (choice :tag
"Default"
93 (const :tag
"Do not show" (t . nil
))
94 (const :tag
"On the left" (t . left
))
95 (const :tag
"On the right" (t . right
)))
98 (const :tag
"Do not show" (top . nil
))
99 (const :tag
"On the left" (top . left
))
100 (const :tag
"On the right" (top . right
)))
101 (choice :tag
"Bottom"
102 :value
(bottom . left
)
103 (const :tag
"Do not show" (bottom . nil
))
104 (const :tag
"On the left" (bottom . left
))
105 (const :tag
"On the right" (bottom . right
)))
106 (choice :tag
"Up arrow"
108 (const :tag
"Do not show" (up . nil
))
109 (const :tag
"On the left" (up . left
))
110 (const :tag
"On the right" (up . right
)))
111 (choice :tag
"Down arrow"
113 (const :tag
"Do not show" (down . nil
))
114 (const :tag
"On the left" (down . left
))
115 (const :tag
"On the right" (down . right
))))
116 (other :tag
"On left, no arrows" t
)))
117 (scroll-up-aggressively windows
118 (choice (const :tag
"off" nil
) float
)
120 (scroll-down-aggressively windows
121 (choice (const :tag
"off" nil
) float
)
123 (line-spacing display
(choice (const :tag
"none" nil
) number
)
125 (cursor-in-non-selected-windows
127 :tag
"Cursor In Non-selected Windows"
128 :set
(lambda (symbol value
)
129 (set-default symbol value
)
130 (force-mode-line-update t
)))
131 (transient-mark-mode editing-basics boolean nil
132 :standard
(not noninteractive
)
133 :initialize custom-initialize-delay
134 :set custom-set-minor-mode
)
135 (bidi-paragraph-direction
138 (const :tag
"Left to Right" left-to-right
)
139 (const :tag
"Right to Left" right-to-left
)
140 (const :tag
"Dynamic, according to paragraph text" nil
))
143 (mark-even-if-inactive editing-basics boolean
)
145 (shell-file-name execute file
)
147 (repeat (choice (const :tag
"default directory" nil
)
148 (directory :format
"%v"))))
149 (exec-suffixes execute
(repeat string
))
151 (charset-map-path installation
152 (repeat (directory :format
"%v")))
154 (inhibit-eol-conversion mule boolean
)
155 (eol-mnemonic-undecided mule string
)
156 ;; startup.el fiddles with the values. IMO, would be
157 ;; simpler to just use #ifdefs in coding.c.
158 (eol-mnemonic-unix mule string nil
160 (if (memq system-type
'(ms-dos windows-nt
))
162 (eol-mnemonic-dos mule string nil
164 (if (memq system-type
'(ms-dos windows-nt
))
166 (eol-mnemonic-mac mule string nil
168 (file-coding-system-alist
171 :key-type
(regexp :tag
"File regexp")
173 :value
(undecided . undecided
)
174 (cons :tag
"Encoding/decoding pair"
175 :value
(undecided . undecided
)
176 (coding-system :tag
"Decoding")
177 (coding-system :tag
"Encoding"))
179 :tag
"Single coding system"
181 :match
(lambda (widget value
)
182 (and value
(not (functionp value
)))))
183 (function :value ignore
))))
185 (completion-ignored-extensions dired
186 (repeat (string :format
"%v")))
188 (baud-rate display integer
)
189 (inverse-video display boolean
)
190 (visible-bell display boolean
)
191 (no-redraw-on-reenter display boolean
)
194 (dos-display-scancodes display boolean
)
195 (dos-hyper-key keyboard integer
)
196 (dos-super-key keyboard integer
)
197 (dos-keypad-mode keyboard integer
)
200 (user-full-name mail string
)
202 (report-emacs-bug-address emacsbug string
)
204 (max-specpdl-size limits integer
)
205 (max-lisp-eval-depth limits integer
)
206 (max-mini-window-height limits
207 (choice (const :tag
"quarter screen" nil
)
209 (debug-on-error debug
210 (choice (const :tag
"off")
211 (repeat :menu-tag
"When"
213 (symbol :format
"%v"))
214 (const :tag
"always" t
)))
215 (debug-ignored-errors debug
(repeat (choice symbol regexp
)))
216 (debug-on-quit debug boolean
)
217 (debug-on-signal debug boolean
)
219 (delete-by-moving-to-trash auto-save boolean
"23.1")
220 (auto-save-visited-file-name auto-save boolean
)
222 (create-lockfiles files boolean
"24.3")
223 (temporary-file-directory
224 ;; Darwin section added 24.1, does not seem worth :version bump.
227 (file-name-as-directory
228 ;; FIXME ? Should there be Ftemporary_file_directory to do this
229 ;; more robustly (cf set_local_socket in emacsclient.c).
230 ;; It could be used elsewhere, eg Fcall_process_region,
231 ;; server-socket-dir. See bug#7135.
232 (cond ((memq system-type
'(ms-dos windows-nt
))
233 (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
235 ((eq system-type
'darwin
)
236 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
238 (let ((tmp (ignore-errors
239 (shell-command-to-string
240 "getconf DARWIN_USER_TEMP_DIR"))))
242 (setq tmp
(replace-regexp-in-string
244 ;; Handles "getconf: Unrecognized variable..."
245 (file-directory-p tmp
)
249 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
251 :initialize custom-initialize-delay
)
253 (use-dialog-box menu boolean
"21.1")
254 (use-file-dialog menu boolean
"22.1")
255 (focus-follows-mouse frames boolean
"20.3")
257 ;; FIXME nil is the initial value, fontset.el setqs it.
258 (vertical-centering-font-regexp display
259 (choice (const nil
) regexp
))
261 (default-frame-alist frames
262 (repeat (cons :format
"%v"
263 (symbol :tag
"Parameter")
264 (sexp :tag
"Value"))))
265 (mouse-highlight mouse
(choice (const :tag
"disabled" nil
)
266 (const :tag
"always shown" t
)
267 (other :tag
"hidden by keypress" 1))
269 (make-pointer-invisible mouse boolean
"23.2")
270 (menu-bar-mode frames boolean nil
272 ; :initialize custom-initialize-default
273 :set custom-set-minor-mode
)
274 (tool-bar-mode (frames mouse
) boolean nil
275 ; :initialize custom-initialize-default
276 :set custom-set-minor-mode
)
277 (frame-resize-pixelwise windows boolean
"24.4")
279 (overflow-newline-into-fringe fringe boolean
)
281 (imagemagick-render-type image integer
"24.1")
283 (indent-tabs-mode indent boolean
)
285 (meta-prefix-char keyboard character
)
286 (auto-save-interval auto-save integer
)
287 (auto-save-timeout auto-save
(choice (const :tag
"off" nil
)
288 (integer :format
"%v")))
289 (echo-keystrokes minibuffer number
)
290 (polling-period keyboard integer
)
291 (double-click-time mouse
(restricted-sexp
292 :match-alternatives
(integerp 'nil
't
)))
293 (double-click-fuzz mouse integer
"22.1")
294 (help-char keyboard character
)
295 (help-event-list keyboard
(repeat (sexp :format
"%v")))
296 (menu-prompting menu boolean
)
297 (select-active-regions killing
298 (choice (const :tag
"always" t
)
299 (const :tag
"only shift-selection or mouse-drag" only
)
300 (const :tag
"off" nil
))
302 (debug-on-event debug
303 (choice (const :tag
"None" nil
)
304 (const :tag
"When sent SIGUSR1" sigusr1
)
305 (const :tag
"When sent SIGUSR2" sigusr2
))
308 ;; This is not good news because it will use the wrong
309 ;; version-specific directories when you upgrade. We need
310 ;; customization of the front of the list, maintaining the
311 ;; standard value intact at the back.
312 ;;(load-path environment
313 ;; (repeat (choice :tag "[Current dir?]"
314 ;; :format "%[Current dir?%] %v"
315 ;; (const :tag " current dir" nil)
316 ;; (directory :format "%v"))))
317 (load-prefer-newer lisp boolean
"24.4")
319 (enable-recursive-minibuffers minibuffer boolean
)
320 (history-length minibuffer
321 (choice (const :tag
"Infinite" t
) integer
)
323 (history-delete-duplicates minibuffer boolean
"22.1")
324 (read-buffer-completion-ignore-case minibuffer boolean
"23.1")
326 (minibuffer-prompt-properties
330 (const :tag
"Read-Only"
331 :doc
"Prevent prompt from being modified"
335 (const :tag
"Don't Enter"
336 :doc
"Prevent point from ever entering prompt"
339 (point-entered minibuffer-avoid-prompt
)))
341 :tag
"Other Properties"
344 (symbol :tag
"Property")
345 (sexp :tag
"Value"))))
347 (minibuffer-auto-raise minibuffer boolean
)
348 ;; options property set at end
349 (read-buffer-function minibuffer
351 (function-item iswitchb-read-buffer
)
354 (dos-unsupported-char-glyph display integer
)
358 (choice (const :tag
"No modifier" nil
)
359 (const control
) (const meta
)
360 (const alt
) (const hyper
)
361 (const super
)) "23.1")
362 (ns-right-control-modifier
364 (choice (const :tag
"No modifier (work as control)" none
)
365 (const :tag
"Use the value of ns-control-modifier"
367 (const control
) (const meta
)
368 (const alt
) (const hyper
)
369 (const super
)) "24.0")
372 (choice (const :tag
"No modifier" nil
)
373 (const control
) (const meta
)
374 (const alt
) (const hyper
)
375 (const super
)) "23.1")
376 (ns-right-command-modifier
378 (choice (const :tag
"No modifier (work as command)" none
)
379 (const :tag
"Use the value of ns-command-modifier"
381 (const control
) (const meta
)
382 (const alt
) (const hyper
)
383 (const super
)) "24.0")
384 (ns-alternate-modifier
386 (choice (const :tag
"No modifier (work as alternate/option)" none
)
387 (const control
) (const meta
)
388 (const alt
) (const hyper
)
389 (const super
)) "23.1")
390 (ns-right-alternate-modifier
392 (choice (const :tag
"No modifier (work as alternate/option)" none
)
393 (const :tag
"Use the value of ns-alternate-modifier"
395 (const control
) (const meta
)
396 (const alt
) (const hyper
)
397 (const super
)) "23.3")
398 (ns-function-modifier
400 (choice (const :tag
"No modifier (work as function)" none
)
401 (const control
) (const meta
)
402 (const alt
) (const hyper
)
403 (const super
)) "23.1")
404 (ns-antialias-text ns boolean
"23.1")
405 (ns-auto-hide-menu-bar ns boolean
"24.0")
406 (ns-use-native-fullscreen ns boolean
"24.4")
407 (ns-use-srgb-colorspace ns boolean
"24.4")
409 (delete-exited-processes processes-basics boolean
)
411 (parse-sexp-ignore-comments editing-basics boolean
)
412 (words-include-escapes editing-basics boolean
)
413 (open-paren-in-column-0-is-defun-start editing-basics boolean
416 (visible-cursor cursor boolean
"22.1")
418 (undo-limit undo integer
)
419 (undo-strong-limit undo integer
)
420 (undo-outer-limit undo
422 (const :tag
"No limit"
426 the undo info for the current command never gets discarded.
427 This should only be chosen under exceptional circumstances,
428 since it could result in memory overflow and make Emacs crash."
432 (temp-buffer-show-function windows
(choice (const nil
) function
))
433 (next-screen-context-lines windows integer
)
434 (scroll-preserve-screen-position
436 (const :tag
"Off (nil)" :value nil
)
437 (const :tag
"Full screen (t)" :value t
)
438 (other :tag
"Always" 1)) "22.1")
441 (const :tag
"Never (nil)" :value nil
)
442 (const :tag
"Only on ttys" :value tty
)
443 (other :tag
"Always" t
)) "23.1")
444 (window-combination-resize windows boolean
"24.1")
445 (window-combination-limit
447 (const :tag
"Never (nil)" :value nil
)
448 (const :tag
"For Temp Buffer Resize mode (temp-buffer-resize)"
449 :value temp-buffer-resize
)
450 (const :tag
"For temporary buffers (temp-buffer)"
452 (const :tag
"For buffer display (display-buffer)"
453 :value display-buffer
)
454 (other :tag
"Always (t)" :value t
))
456 (window-resize-pixelwise windows boolean
"24.4")
458 ;; The whitespace group is for whitespace.el.
459 (show-trailing-whitespace editing-basics boolean nil
461 (scroll-step windows integer
)
462 (scroll-conservatively windows integer
)
463 (scroll-margin windows integer
)
464 (hscroll-margin windows integer
"22.1")
465 (hscroll-step windows number
"22.1")
466 (truncate-partial-width-windows
468 (choice (integer :tag
"Truncate if narrower than")
469 (const :tag
"Respect `truncate-lines'" nil
)
470 (other :tag
"Truncate if not full-width" t
))
472 (make-cursor-line-fully-visible windows boolean
)
473 (mode-line-in-non-selected-windows mode-line boolean
"22.1")
474 (line-number-display-limit display
476 (const :tag
"No limit" nil
)))
477 (line-number-display-limit-width display integer
"22.1")
478 (highlight-nonselected-windows display boolean
)
479 (message-log-max debug
(choice (const :tag
"Disable" nil
)
480 (integer :menu-tag
"lines"
482 (other :tag
"Unlimited" t
))
484 (unibyte-display-via-language-environment mule boolean
)
485 (blink-cursor-alist cursor alist
"22.1")
486 (overline-margin display integer
"22.1")
487 (underline-minimum-offset display integer
"23.1")
488 (mouse-autoselect-window
490 (const :tag
"Off (nil)" :value nil
)
491 (const :tag
"Immediate" :value t
)
492 (number :tag
"Delay by secs" :value
0.5)) "22.1")
495 (const :tag
"Images" :value image
)
496 (const :tag
"Text" :value text
)
497 (const :tag
"Both" :value both
)
498 (const :tag
"Both-horiz" :value both-horiz
)
499 (const :tag
"Text-image-horiz" :value text-image-horiz
)
500 (const :tag
"System default" :value nil
)) "24.1")
501 (tool-bar-max-label-size frames integer
"24.1")
502 (auto-hscroll-mode scrolling boolean
"21.1")
503 (void-text-area-pointer cursor
505 (const :tag
"Standard (text pointer)" :value nil
)
506 (const :tag
"Arrow" :value arrow
)
507 (const :tag
"Text pointer" :value text
)
508 (const :tag
"Hand" :value hand
)
509 (const :tag
"Vertical dragger" :value vdrag
)
510 (const :tag
"Horizontal dragger" :value hdrag
)
511 (const :tag
"Same as mode line" :value modeline
)
512 (const :tag
"Hourglass" :value hourglass
)))
513 (display-hourglass cursor boolean
)
514 (hourglass-delay cursor number
)
517 (scalable-fonts-allowed display boolean
"22.1")
519 (x-bitmap-file-path installation
520 (repeat (directory :format
"%v")))
521 (x-gtk-use-old-file-dialog menu boolean
"22.1")
522 (x-gtk-show-hidden-files menu boolean
"22.1")
523 (x-gtk-file-dialog-help-text menu boolean
"22.1")
524 (x-gtk-whole-detached-tool-bar x boolean
"22.1")
525 (x-gtk-use-system-tooltips tooltip boolean
"23.3")
527 (x-use-underline-position-properties display boolean
"22.1")
528 (x-underline-at-descent-line display boolean
"22.1")
529 (x-stretch-cursor display boolean
"21.1")
530 (scroll-bar-adjust-thumb-portion windows boolean
"24.4")
532 (x-select-enable-clipboard-manager killing boolean
"24.1")
534 (font-use-system-font font-selection boolean
"23.2")))
535 this symbol group type standard version native-p rest prop propval
536 ;; This function turns a value
537 ;; into an expression which produces that value.
538 (quoter (lambda (sexp)
539 (if (or (memq sexp
'(t nil
))
542 (memq (car sexp
) '(lambda)))
546 (list 'quote sexp
)))))
555 ;; If we did not specify any standard value expression above,
556 ;; use the current value as the standard value.
557 standard
(if (setq prop
(memq :standard rest
))
559 (if (default-boundp symbol
)
560 (funcall quoter
(default-value symbol
))))
561 ;; Don't complain about missing variables which are
562 ;; irrelevant to this platform.
563 native-p
(save-match-data
565 ((string-match "\\`dos-" (symbol-name symbol
))
566 (eq system-type
'ms-dos
))
567 ((string-match "\\`w32-" (symbol-name symbol
))
568 (eq system-type
'windows-nt
))
569 ((string-match "\\`ns-" (symbol-name symbol
))
571 ((string-match "\\`x-.*gtk" (symbol-name symbol
))
573 ((string-match "clipboard-manager" (symbol-name symbol
))
574 (boundp 'x-select-enable-clipboard-manager
))
575 ((string-match "\\`x-" (symbol-name symbol
))
576 (fboundp 'x-create-frame
))
577 ((string-match "selection" (symbol-name symbol
))
578 (fboundp 'x-selection-exists-p
))
579 ((string-match "fringe" (symbol-name symbol
))
580 (fboundp 'define-fringe-bitmap
))
581 ((string-match "\\`imagemagick" (symbol-name symbol
))
582 (fboundp 'imagemagick-types
))
583 ((equal "font-use-system-font" (symbol-name symbol
))
584 (featurep 'system-font-setting
))
585 ;; Conditioned on x-create-frame, because that's
586 ;; the condition for loadup.el to preload tool-bar.el.
587 ((string-match "tool-bar-" (symbol-name symbol
))
588 (fboundp 'x-create-frame
))
589 ((equal "vertical-centering-font-regexp"
590 (symbol-name symbol
))
591 ;; Any function from fontset.c will do.
592 (fboundp 'new-fontset
))
593 ((equal "scroll-bar-adjust-thumb-portion"
594 (symbol-name symbol
))
597 (if (not (boundp symbol
))
598 ;; If variables are removed from C code, give an error here!
600 (message "Note, built-in variable `%S' not bound" symbol
))
601 ;; Save the standard value, unless we already did.
602 (or (get symbol
'standard-value
)
603 (put symbol
'standard-value
(list standard
)))
604 ;; We need these properties independent of whether cus-start is loaded.
605 (if (setq prop
(memq :safe rest
))
606 (put symbol
'safe-local-variable
(cadr prop
)))
607 (if (setq prop
(memq :risky rest
))
608 (put symbol
'risky-local-variable
(cadr prop
)))
609 (if (setq prop
(memq :set rest
))
610 (put symbol
'custom-set
(cadr prop
)))
611 ;; Note this is the _only_ initialize property we handle.
612 (if (eq (cadr (memq :initialize rest
)) 'custom-initialize-delay
)
613 (push symbol custom-delayed-init-variables
))
614 ;; If this is NOT while dumping Emacs, set up the rest of the
615 ;; customization info. This is the stuff that is not needed
616 ;; until someone does M-x customize etc.
618 ;; Add it to the right group(s).
621 (custom-add-to-group g symbol
'custom-variable
))
622 (custom-add-to-group group symbol
'custom-variable
))
624 (put symbol
'custom-type type
)
625 (if version
(put symbol
'custom-version version
))
627 (setq prop
(car rest
)
629 rest
(nthcdr 2 rest
))
630 (cond ((memq prop
'(:standard
:risky
:safe
:set
))) ; handled above
632 (put symbol
'custom-tag propval
))))))))
634 (custom-add-to-group 'iswitchb
'read-buffer-function
'custom-variable
)
635 (custom-add-to-group 'font-lock
'open-paren-in-column-0-is-defun-start
638 ;; Record cus-start as loaded if we have set up all the info that we can.
639 ;; Don't record it as loaded if we have only set up the standard values
640 ;; and safe/risky properties.
642 (provide 'cus-start
))
644 ;;; cus-start.el ends here