1 ;;; cus-start.el --- define customization properties of builtins
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
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.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27 ;; This file adds customize support for built-in variables.
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.
37 (let ((all '(;; alloc.c
38 (gc-cons-threshold alloc integer
)
39 (garbage-collection-messages alloc boolean
)
41 (mode-line-format mode-line sexp
) ;Hard to do right.
42 (major-mode internal function
)
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
)
49 (word-wrap display boolean
)
50 (selective-display-ellipses display boolean
)
51 (indicate-empty-lines fringe boolean
)
52 (indicate-buffer-boundaries
55 (const :tag
"No indicators" nil
)
56 (const :tag
"On left, with arrows" left
)
57 (const :tag
"On right, with arrows" right
)
58 (set :tag
"Pick your own design"
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
65 (choice :tag
"Default"
67 (const :tag
"Do not show" (t . nil
))
68 (const :tag
"On the left" (t . left
))
69 (const :tag
"On the right" (t . right
)))
72 (const :tag
"Do not show" (top . nil
))
73 (const :tag
"On the left" (top . left
))
74 (const :tag
"On the right" (top . right
)))
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"
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"
87 (const :tag
"Do not show" (down . nil
))
88 (const :tag
"On the left" (down . left
))
89 (const :tag
"On the right" (down . right
))))
90 (other :tag
"On left, no arrows" t
)))
91 (scroll-up-aggressively windows
92 (choice (const :tag
"off" nil
) number
)
94 (scroll-down-aggressively windows
95 (choice (const :tag
"off" nil
) number
)
97 (line-spacing display
(choice (const :tag
"none" nil
) integer
)
99 (cursor-in-non-selected-windows
100 cursor boolean nil t
:tag
"Cursor In Non-selected Windows"
101 :set
#'(lambda (symbol value
)
102 (set-default symbol value
)
103 (force-mode-line-update t
)))
104 (transient-mark-mode editing-basics boolean nil
106 :initialize custom-initialize-delay
107 :set custom-set-minor-mode
)
109 (mark-even-if-inactive editing-basics boolean
)
111 (shell-file-name execute file
)
113 (repeat (choice (const :tag
"default directory" nil
)
114 (directory :format
"%v"))))
116 (charset-map-path installation
117 (repeat (directory :format
"%v")))
119 (inhibit-eol-conversion mule boolean
)
120 (eol-mnemonic-undecided mule string
)
121 (eol-mnemonic-unix mule string
)
122 (eol-mnemonic-dos mule string
)
123 (eol-mnemonic-mac mule string
)
124 (file-coding-system-alist
127 :key-type
(regexp :tag
"File regexp")
129 :value
(undecided . undecided
)
130 (cons :tag
"Encoding/decoding pair"
131 :value
(undecided . undecided
)
132 (coding-system :tag
"Decoding")
133 (coding-system :tag
"Encoding"))
135 :tag
"Single coding system"
137 :match
(lambda (widget value
)
138 (and value
(not (functionp value
)))))
139 (function :value ignore
))))
141 (completion-ignored-extensions dired
142 (repeat (string :format
"%v")))
144 (baud-rate display integer
)
145 (inverse-video display boolean
)
146 (visible-bell display boolean
)
147 (no-redraw-on-reenter display boolean
)
149 (user-full-name mail string
)
151 (max-specpdl-size limits integer
)
152 (max-lisp-eval-depth limits integer
)
153 (max-mini-window-height limits
154 (choice (const :tag
"quarter screen" nil
)
156 (stack-trace-on-error debug
157 (choice (const :tag
"off")
158 (repeat :menu-tag
"When"
160 (symbol :format
"%v"))
161 (const :tag
"always" t
)))
162 (debug-on-error debug
163 (choice (const :tag
"off")
164 (repeat :menu-tag
"When"
166 (symbol :format
"%v"))
167 (const :tag
"always" t
)))
168 (debug-ignored-errors debug
(repeat (choice symbol regexp
)))
170 (choice (const :tag
"off")
171 (repeat :menu-tag
"When"
173 (symbol :format
"%v"))
174 (const :tag
"always" t
)))
176 (delete-by-moving-to-trash auto-save boolean
"23.1")
177 (auto-save-visited-file-name auto-save boolean
)
179 (temporary-file-directory
180 ;; Darwin section added 24.1, does not seem worth :version bump.
182 (file-name-as-directory
183 ;; FIXME ? Should there be Ftemporary_file_directory to do this
184 ;; more robustly (cf set_local_socket in emacsclient.c).
185 ;; It could be used elsewhere, eg Fcall_process_region,
186 ;; server-socket-dir. See bug#7135.
187 (cond ((memq system-type
'(ms-dos windows-nt
))
188 (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
190 ((eq system-type
'darwin
)
191 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
193 (let ((tmp (ignore-errors
194 (shell-command-to-string
195 "getconf DARWIN_USER_TEMP_DIR"))))
197 (setq tmp
(replace-regexp-in-string
199 ;; Handles "getconf: Unrecognized variable..."
200 (file-directory-p tmp
)
204 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
206 :initialize custom-initialize-delay
)
208 (use-dialog-box menu boolean
"21.1")
209 (use-file-dialog menu boolean
"22.1")
210 (focus-follows-mouse frames boolean
"20.3")
212 (default-frame-alist frames
213 (repeat (cons :format
"%v"
214 (symbol :tag
"Parameter")
215 (sexp :tag
"Value"))))
216 (mouse-highlight mouse
(choice (const :tag
"disabled" nil
)
217 (const :tag
"always shown" t
)
218 (other :tag
"hidden by keypress" 1))
220 (make-pointer-invisible mouse boolean
"23.2")
221 (menu-bar-mode frames boolean nil t
223 ; :initialize custom-initialize-default
224 :set custom-set-minor-mode
)
225 (tool-bar-mode (frames mouse
) boolean nil t
226 ; :initialize custom-initialize-default
227 :set custom-set-minor-mode
)
229 (overflow-newline-into-fringe fringe boolean
)
231 (indent-tabs-mode indent boolean
)
233 (meta-prefix-char keyboard character
)
234 (auto-save-interval auto-save integer
)
235 (auto-save-timeout auto-save
(choice (const :tag
"off" nil
)
236 (integer :format
"%v")))
237 (echo-keystrokes minibuffer number
)
238 (polling-period keyboard integer
)
239 (double-click-time mouse
(restricted-sexp
240 :match-alternatives
(integerp 'nil
't
)))
241 (double-click-fuzz mouse integer
"22.1")
242 (inhibit-local-menu-bar-menus menu boolean
)
243 (help-char keyboard character
)
244 (help-event-list keyboard
(repeat (sexp :format
"%v")))
245 (menu-prompting menu boolean
)
246 (select-active-regions killing
247 (choice (const :tag
"always" t
)
248 (const :tag
"only shift-selection or mouse-drag" only
)
249 (const :tag
"off" nil
))
251 (suggest-key-bindings keyboard
(choice (const :tag
"off" nil
)
252 (integer :tag
"time" 2)
255 ;; This is not good news because it will use the wrong
256 ;; version-specific directories when you upgrade. We need
257 ;; customization of the front of the list, maintaining the standard
258 ;; value intact at the back.
259 ;;; (load-path environment
260 ;;; (repeat (choice :tag "[Current dir?]"
261 ;;; :format "%[Current dir?%] %v"
262 ;;; (const :tag " current dir" nil)
263 ;;; (directory :format "%v"))))
265 (enable-recursive-minibuffers minibuffer boolean
)
266 (history-length minibuffer
267 (choice (const :tag
"Infinite" t
) integer
)
269 (history-delete-duplicates minibuffer boolean
"22.1")
270 (read-buffer-completion-ignore-case minibuffer boolean
"23.1")
272 (minibuffer-prompt-properties
276 (const :tag
"Read-Only"
277 :doc
"Prevent prompt from being modified"
281 (const :tag
"Don't Enter"
282 :doc
"Prevent point from ever entering prompt"
285 (point-entered minibuffer-avoid-prompt
)))
287 :tag
"Other Properties"
290 (symbol :tag
"Property")
291 (sexp :tag
"Value"))))
293 (minibuffer-auto-raise minibuffer boolean
)
294 ;; options property set at end
295 (read-buffer-function minibuffer
297 (function-item iswitchb-read-buffer
)
300 (dos-unsupported-char-glyph display integer
)
304 (choice (const :tag
"No modifier" nil
)
305 (const control
) (const meta
)
306 (const alt
) (const hyper
)
307 (const super
)) "23.1")
310 (choice (const :tag
"No modifier" nil
)
311 (const control
) (const meta
)
312 (const alt
) (const hyper
)
313 (const super
)) "23.1")
314 (ns-alternate-modifier
316 (choice (const :tag
"No modifier (work as alternate/option)" none
)
317 (const control
) (const meta
)
318 (const alt
) (const hyper
)
319 (const super
)) "23.1")
320 (ns-right-alternate-modifier
322 (choice (const :tag
"No modifier (work as alternate/option)" none
)
323 (const :tag
"Use the value of ns-alternate-modifier"
325 (const control
) (const meta
)
326 (const alt
) (const hyper
)
327 (const super
)) "23.3")
328 (ns-function-modifier
330 (choice (const :tag
"No modifier (work as function)" none
)
331 (const control
) (const meta
)
332 (const alt
) (const hyper
)
333 (const super
)) "23.1")
334 (ns-antialias-text ns boolean
"23.1")
336 (delete-exited-processes processes-basics boolean
)
338 (parse-sexp-ignore-comments editing-basics boolean
)
339 (words-include-escapes editing-basics boolean
)
340 (open-paren-in-column-0-is-defun-start editing-basics boolean
343 (visible-cursor cursor boolean
"22.1")
345 (undo-limit undo integer
)
346 (undo-strong-limit undo integer
)
347 (undo-outer-limit undo
349 (const :tag
"No limit"
353 the undo info for the current command never gets discarded.
354 This should only be chosen under exceptional circumstances,
355 since it could result in memory overflow and make Emacs crash."
359 (temp-buffer-show-function windows
(choice (const nil
) function
))
360 (next-screen-context-lines windows integer
)
361 (window-min-height windows integer
)
362 (window-min-width windows integer
)
363 (scroll-preserve-screen-position
365 (const :tag
"Off (nil)" :value nil
)
366 (const :tag
"Full screen (t)" :value t
)
367 (other :tag
"Always" 1)) "22.1")
368 (recenter-redisplay windows
370 (const :tag
"Never (nil)" :value nil
)
371 (const :tag
"Only on ttys" :value tty
)
372 (other :tag
"Always" t
))
375 (show-trailing-whitespace whitespace-faces boolean nil nil
377 (scroll-step windows integer
)
378 (scroll-conservatively windows integer
)
379 (scroll-margin windows integer
)
380 (hscroll-margin windows integer
"22.1")
381 (hscroll-step windows number
"22.1")
382 (truncate-partial-width-windows display boolean
"23.1")
383 (mode-line-inverse-video mode-line boolean
)
384 (mode-line-in-non-selected-windows mode-line boolean
"22.1")
385 (line-number-display-limit display
387 (const :tag
"No limit" nil
)))
388 (line-number-display-limit-width display integer
"22.1")
389 (highlight-nonselected-windows display boolean
)
390 (message-log-max debug
(choice (const :tag
"Disable" nil
)
391 (integer :menu-tag
"lines"
393 (other :tag
"Unlimited" t
)))
394 (unibyte-display-via-language-environment mule boolean
)
395 (blink-cursor-alist cursor alist
"22.1")
396 (overline-margin display integer
"22.1")
397 (underline-minimum-offset display integer
"23.1")
398 (mouse-autoselect-window
400 (const :tag
"Off (nil)" :value nil
)
401 (const :tag
"Immediate" :value t
)
402 (number :tag
"Delay by secs" :value
0.5)) "22.1")
405 (const :tag
"Images" :value image
)
406 (const :tag
"Text" :value text
)
407 (const :tag
"Both" :value both
)
408 (const :tag
"Both-horiz" :value both-horiz
)
409 (const :tag
"Text-image-horiz" :value text-image-horiz
)
410 (const :tag
"System default" :value nil
)) "23.3")
411 (tool-bar-max-label-size frames integer
"23.3")
412 (auto-hscroll-mode scrolling boolean
"21.1")
413 (display-hourglass cursor boolean
)
414 (hourglass-delay cursor number
)
417 (scalable-fonts-allowed display boolean
"22.1")
419 (x-bitmap-file-path installation
420 (repeat (directory :format
"%v")))
421 (x-gtk-use-old-file-dialog menu boolean
"22.1")
422 (x-gtk-show-hidden-files menu boolean
"22.1")
423 (x-gtk-file-dialog-help-text menu boolean
"22.1")
424 (x-gtk-whole-detached-tool-bar x boolean
"22.1")
425 (x-gtk-use-system-tooltips tooltip boolean
"23.3")
427 (x-use-underline-position-properties display boolean
"22.1")
428 (x-underline-at-descent-line display boolean
"22.1")
429 (x-stretch-cursor display boolean
"21.1")
431 (font-use-system-font font-selection boolean
"23.2")))
432 this symbol group type standard version native-p rest prop propval
433 ;; This function turns a value
434 ;; into an expression which produces that value.
435 (quoter (lambda (sexp)
436 (if (or (memq sexp
'(t nil
))
439 (memq (car sexp
) '(lambda)))
443 (list 'quote sexp
)))))
451 ;; If we did not specify any standard value expression above,
452 ;; use the current value as the standard value.
453 standard
(if (nthcdr 4 this
)
455 (when (default-boundp symbol
)
456 (funcall quoter
(default-value symbol
))))
458 ;; Don't complain about missing variables which are
459 ;; irrelevant to this platform.
460 native-p
(save-match-data
462 ((string-match "\\`dos-" (symbol-name symbol
))
463 (eq system-type
'ms-dos
))
464 ((string-match "\\`w32-" (symbol-name symbol
))
465 (eq system-type
'windows-nt
))
466 ((string-match "\\`ns-" (symbol-name symbol
))
468 ((string-match "\\`x-.*gtk" (symbol-name symbol
))
470 ((string-match "\\`x-" (symbol-name symbol
))
471 (fboundp 'x-create-frame
))
472 ((string-match "selection" (symbol-name symbol
))
473 (fboundp 'x-selection-exists-p
))
474 ((string-match "fringe" (symbol-name symbol
))
475 (fboundp 'define-fringe-bitmap
))
476 ((equal "font-use-system-font" (symbol-name symbol
))
477 (featurep 'system-font-setting
))
478 ;; Conditioned on x-create-frame, because that's
479 ;; the condition for loadup.el to preload tool-bar.el.
480 ((string-match "tool-bar-" (symbol-name symbol
))
481 (fboundp 'x-create-frame
))
483 (if (not (boundp symbol
))
484 ;; If variables are removed from C code, give an error here!
486 (message "Note, built-in variable `%S' not bound" symbol
))
487 ;; Save the standard value, unless we already did.
488 (or (get symbol
'standard-value
)
489 (put symbol
'standard-value
(list standard
)))
490 ;; We need these properties independent of whether cus-start is loaded.
491 (if (setq prop
(memq :safe rest
))
492 (put symbol
'safe-local-variable
(cadr prop
)))
493 (if (setq prop
(memq :risky rest
))
494 (put symbol
'risky-local-variable
(cadr prop
)))
495 (if (setq prop
(memq :set rest
))
496 (put symbol
'custom-set
(cadr prop
)))
497 ;; Note this is the _only_ initialize property we handle.
498 (if (eq (cadr (memq :initialize rest
)) 'custom-initialize-delay
)
499 (push symbol custom-delayed-init-variables
))
500 ;; If this is NOT while dumping Emacs, set up the rest of the
501 ;; customization info. This is the stuff that is not needed
502 ;; until someone does M-x customize etc.
504 ;; Add it to the right group(s).
507 (custom-add-to-group g symbol
'custom-variable
))
508 (custom-add-to-group group symbol
'custom-variable
))
510 (put symbol
'custom-type type
)
511 (put symbol
'custom-version version
)
513 (setq prop
(car rest
)
515 rest
(nthcdr 2 rest
))
516 (cond ((memq prop
'(:risky
:safe
:set
))) ; handled above
518 (put symbol
'custom-tag propval
))))))))
520 (custom-add-to-group 'iswitchb
'read-buffer-function
'custom-variable
)
521 (custom-add-to-group 'font-lock
'open-paren-in-column-0-is-defun-start
524 ;; Record cus-start as loaded if we have set up all the info that we can.
525 ;; Don't record it as loaded if we have only set up the standard values
526 ;; and safe/risky properties.
528 (provide 'cus-start
))
530 ;;; cus-start.el ends here