New function `locate-user-emacs-file'.
[emacs.git] / lisp / cus-start.el
bloba137743514795805dacabd1327322a795bb97615
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: internal
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 (let ((all '(;; alloc.c
37 (gc-cons-threshold alloc integer)
38 (garbage-collection-messages alloc boolean)
39 ;; buffer.c
40 (mode-line-format mode-line sexp) ;Hard to do right.
41 (default-major-mode internal function)
42 (enable-multibyte-characters mule boolean)
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
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)
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))))
90 (other :tag "On left, no arrows" t)))
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")
97 (line-spacing display (choice (const :tag "none" nil) integer)
98 "22.1")
99 ;; callint.c
100 (mark-even-if-inactive editing-basics boolean)
101 (shift-select-mode editing-basics boolean)
102 ;; callproc.c
103 (shell-file-name execute file)
104 (exec-path execute
105 (repeat (choice (const :tag "default directory" nil)
106 (directory :format "%v"))))
107 ;; charset.c
108 (charset-map-path installation
109 (repeat (directory :format "%v")))
110 ;; coding.c
111 (inhibit-eol-conversion mule boolean)
112 (eol-mnemonic-undecided mule string)
113 (eol-mnemonic-unix mule string)
114 (eol-mnemonic-dos mule string)
115 (eol-mnemonic-mac mule string)
116 (file-coding-system-alist
117 mule
118 (alist
119 :key-type (regexp :tag "File regexp")
120 :value-type (choice
121 :value (undecided . undecided)
122 (cons :tag "Encoding/decoding pair"
123 :value (undecided . undecided)
124 (coding-system :tag "Decoding")
125 (coding-system :tag "Encoding"))
126 (coding-system
127 :tag "Single coding system"
128 :value undecided
129 :match (lambda (widget value)
130 (and value (not (functionp value)))))
131 (function :value ignore))))
132 ;; dired.c
133 (completion-ignored-extensions dired
134 (repeat (string :format "%v")))
135 ;; dispnew.c
136 (baud-rate display integer)
137 (inverse-video display boolean)
138 (visible-bell display boolean)
139 (no-redraw-on-reenter display boolean)
140 ;; editfns.c
141 (user-full-name mail string)
142 ;; eval.c
143 (max-specpdl-size limits integer)
144 (max-lisp-eval-depth limits integer)
145 (max-mini-window-height limits
146 (choice (const :tag "quarter screen" nil)
147 number) "23.1")
148 (stack-trace-on-error debug
149 (choice (const :tag "off")
150 (repeat :menu-tag "When"
151 :value (nil)
152 (symbol :format "%v"))
153 (const :tag "always" t)))
154 (debug-on-error debug
155 (choice (const :tag "off")
156 (repeat :menu-tag "When"
157 :value (nil)
158 (symbol :format "%v"))
159 (const :tag "always" t)))
160 (debug-ignored-errors debug (repeat (choice symbol regexp)))
161 (debug-on-quit debug
162 (choice (const :tag "off")
163 (repeat :menu-tag "When"
164 :value (nil)
165 (symbol :format "%v"))
166 (const :tag "always" t)))
167 ;; fileio.c
168 (delete-by-moving-to-trash auto-save boolean "23.1")
169 (auto-save-visited-file-name auto-save boolean)
170 ;; fns.c
171 (use-dialog-box menu boolean "21.1")
172 (use-file-dialog menu boolean "22.1")
173 (focus-follows-mouse frames boolean "20.3")
174 ;; frame.c
175 (default-frame-alist frames
176 (repeat (cons :format "%v"
177 (symbol :tag "Parameter")
178 (sexp :tag "Value"))))
179 (mouse-highlight mouse (choice (const :tag "disabled" nil)
180 (const :tag "always shown" t)
181 (other :tag "hidden by keypress" 1))
182 "22.1")
183 ;; fringe.c
184 (overflow-newline-into-fringe fringe boolean)
185 ;; indent.c
186 (indent-tabs-mode indent boolean)
187 ;; keyboard.c
188 (meta-prefix-char keyboard character)
189 (auto-save-interval auto-save integer)
190 (auto-save-timeout auto-save (choice (const :tag "off" nil)
191 (integer :format "%v")))
192 (echo-keystrokes minibuffer number)
193 (polling-period keyboard integer)
194 (double-click-time mouse (restricted-sexp
195 :match-alternatives (integerp 'nil 't)))
196 (double-click-fuzz mouse integer "22.1")
197 (inhibit-local-menu-bar-menus menu boolean)
198 (help-char keyboard character)
199 (help-event-list keyboard (repeat (sexp :format "%v")))
200 (menu-prompting menu boolean)
201 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
202 (integer :tag "time" 2)
203 (other :tag "on")))
205 ;; This is not good news because it will use the wrong
206 ;; version-specific directories when you upgrade. We need
207 ;; customization of the front of the list, maintaining the standard
208 ;; value intact at the back.
209 ;;; (load-path environment
210 ;;; (repeat (choice :tag "[Current dir?]"
211 ;;; :format "%[Current dir?%] %v"
212 ;;; (const :tag " current dir" nil)
213 ;;; (directory :format "%v"))))
214 ;; minibuf.c
215 (enable-recursive-minibuffers minibuffer boolean)
216 (history-length minibuffer
217 (choice (const :tag "Infinite" t) integer)
218 "22.1")
219 (history-delete-duplicates minibuffer boolean "22.1")
220 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
222 (minibuffer-prompt-properties
223 minibuffer
224 (list
225 (checklist :inline t
226 (const :tag "Read-Only"
227 :doc "Prevent prompt from being modified"
228 :format "%t%n%h"
229 :inline t
230 (read-only t))
231 (const :tag "Don't Enter"
232 :doc "Prevent point from ever entering prompt"
233 :format "%t%n%h"
234 :inline t
235 (point-entered minibuffer-avoid-prompt)))
236 (repeat :inline t
237 :tag "Other Properties"
238 (list :inline t
239 :format "%v"
240 (symbol :tag "Property")
241 (sexp :tag "Value"))))
242 "21.1")
243 (minibuffer-auto-raise minibuffer boolean)
244 ;; options property set at end
245 (read-buffer-function minibuffer
246 (choice (const nil)
247 (function-item iswitchb-read-buffer)
248 function))
249 ;; msdos.c
250 (dos-unsupported-char-glyph display integer)
251 ;; process.c
252 (delete-exited-processes processes-basics boolean)
253 ;; syntax.c
254 (parse-sexp-ignore-comments editing-basics boolean)
255 (words-include-escapes editing-basics boolean)
256 (open-paren-in-column-0-is-defun-start editing-basics boolean
257 "21.1")
258 ;; term.c
259 (visible-cursor cursor boolean "22.1")
260 ;; undo.c
261 (undo-limit undo integer)
262 (undo-strong-limit undo integer)
263 (undo-outer-limit undo
264 (choice integer
265 (const :tag "No limit"
266 :format "%t\n%d"
267 :doc
268 "With this choice, \
269 the undo info for the current command never gets discarded.
270 This should only be chosen under exceptional circumstances,
271 since it could result in memory overflow and make Emacs crash."
272 nil))
273 "22.1")
274 ;; window.c
275 (temp-buffer-show-function windows (choice (const nil) function))
276 (next-screen-context-lines windows integer)
277 (window-min-height windows integer)
278 (window-min-width windows integer)
279 (scroll-preserve-screen-position
280 windows (choice
281 (const :tag "Off (nil)" :value nil)
282 (const :tag "Full screen (t)" :value t)
283 (other :tag "Always" 1)) "22.1")
284 ;; xdisp.c
285 (scroll-step windows integer)
286 (scroll-conservatively windows integer)
287 (scroll-margin windows integer)
288 (hscroll-margin windows integer "22.1")
289 (hscroll-step windows number "22.1")
290 (truncate-partial-width-windows display boolean "23.1")
291 (mode-line-inverse-video mode-line boolean)
292 (mode-line-in-non-selected-windows mode-line boolean "22.1")
293 (line-number-display-limit display
294 (choice integer
295 (const :tag "No limit" nil)))
296 (line-number-display-limit-width display integer "22.1")
297 (highlight-nonselected-windows display boolean)
298 (message-log-max debug (choice (const :tag "Disable" nil)
299 (integer :menu-tag "lines"
300 :format "%v")
301 (other :tag "Unlimited" t)))
302 (unibyte-display-via-language-environment mule boolean)
303 (blink-cursor-alist cursor alist "22.1")
304 (overline-margin display integer "22.1")
305 (underline-minimum-offset display integer "23.1")
306 (mouse-autoselect-window
307 display (choice
308 (const :tag "Off (nil)" :value nil)
309 (const :tag "Immediate" :value t)
310 (number :tag "Delay by secs" :value 0.5)) "22.1")
311 ;; xfaces.c
312 (scalable-fonts-allowed display boolean "22.1")
313 ;; xfns.c
314 (x-bitmap-file-path installation
315 (repeat (directory :format "%v")))
316 (x-gtk-use-old-file-dialog menu boolean "22.1")
317 (x-gtk-show-hidden-files menu boolean "22.1")
318 (x-gtk-file-dialog-help-text menu boolean "22.1")
319 (x-gtk-whole-detached-tool-bar x boolean "22.1")
320 ;; xterm.c
321 (x-use-underline-position-properties display boolean "22.1")
322 (x-underline-at-descent-line display boolean "22.1")
323 (x-stretch-cursor display boolean "21.1")))
324 this symbol group type standard version native-p
325 ;; This function turns a value
326 ;; into an expression which produces that value.
327 (quoter (lambda (sexp)
328 (if (or (memq sexp '(t nil))
329 (keywordp sexp)
330 (and (listp sexp)
331 (memq (car sexp) '(lambda)))
332 (stringp sexp)
333 (numberp sexp))
334 sexp
335 (list 'quote sexp)))))
336 (while all
337 (setq this (car all)
338 all (cdr all)
339 symbol (nth 0 this)
340 group (nth 1 this)
341 type (nth 2 this)
342 version (nth 3 this)
343 ;; If we did not specify any standard value expression above,
344 ;; use the current value as the standard value.
345 standard (if (nthcdr 4 this)
346 (nth 4 this)
347 (when (default-boundp symbol)
348 (funcall quoter (default-value symbol))))
349 ;; Don't complain about missing variables which are
350 ;; irrelevant to this platform.
351 native-p (save-match-data
352 (cond
353 ((string-match "\\`dos-" (symbol-name symbol))
354 (eq system-type 'ms-dos))
355 ((string-match "\\`w32-" (symbol-name symbol))
356 (eq system-type 'windows-nt))
357 ((string-match "\\`x-.*gtk" (symbol-name symbol))
358 (featurep 'gtk))
359 ((string-match "\\`x-" (symbol-name symbol))
360 (fboundp 'x-create-frame))
361 ((string-match "selection" (symbol-name symbol))
362 (fboundp 'x-selection-exists-p))
363 ((string-match "fringe" (symbol-name symbol))
364 (fboundp 'define-fringe-bitmap))
365 (t t))))
366 (if (not (boundp symbol))
367 ;; If variables are removed from C code, give an error here!
368 (and native-p
369 (message "Note, built-in variable `%S' not bound" symbol))
370 ;; Save the standard value, unless we already did.
371 (or (get symbol 'standard-value)
372 (put symbol 'standard-value (list standard)))
373 ;; If this is NOT while dumping Emacs,
374 ;; set up the rest of the customization info.
375 (unless purify-flag
376 ;; Add it to the right group.
377 (custom-add-to-group group symbol 'custom-variable)
378 ;; Set the type.
379 (put symbol 'custom-type type)
380 (put symbol 'custom-version version)))))
382 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
383 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
384 'custom-variable)
386 ;; Record cus-start as loaded
387 ;; if we have set up all the info that we can set up.
388 ;; Don't record cus-start as loaded
389 ;; if we have set up only the standard values.
390 (unless purify-flag
391 (provide 'cus-start))
393 ;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
394 ;;; cus-start.el ends here