new version
[emacs.git] / lisp / cus-start.el
blobc94e155052018b9b4fd2c9176d333018b0bc7b35
1 ;;; cus-start.el --- define customization properties of builtins.
2 ;;
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: internal
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
25 ;;; Commentary:
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.
35 ;;; Code:
37 (let ((all '(;; abbrev.c
38 (abbrev-all-caps abbrev-mode boolean)
39 (pre-abbrev-expand-hook abbrev-mode hook)
40 ;; alloc.c
41 (gc-cons-threshold alloc integer)
42 (undo-limit undo integer)
43 (undo-strong-limit undo integer)
44 (garbage-collection-messages alloc boolean)
45 ;; buffer.c
46 (mode-line-format modeline sexp) ;Hard to do right.
47 (default-major-mode internal function)
48 (case-fold-search matching boolean)
49 (fill-column fill integer)
50 (left-margin fill integer)
51 (tab-width editing-basics integer)
52 (ctl-arrow display boolean)
53 (truncate-lines display boolean)
54 (selective-display display
55 (choice (const :tag "off" nil)
56 (integer :tag "space"
57 :format "%v"
59 (const :tag "on" t)))
60 (selective-display-ellipses display boolean)
61 (transient-mark-mode editing-basics boolean)
62 ;; callint.c
63 (mark-even-if-inactive editing-basics boolean)
64 ;; callproc.c
65 (shell-file-name execute file)
66 (exec-path execute
67 (repeat (choice (const :tag "default" nil)
68 (file :format "%v"))))
69 ;; dired.c
70 (completion-ignored-extensions dired
71 (repeat (string :format "%v")))
72 ;; dispnew.el
73 (baud-rate display integer)
74 (inverse-video display boolean)
75 (visible-bell display boolean)
76 (no-redraw-on-reenter display boolean)
77 ;; editfns.c
78 (user-full-name mail string)
79 ;; eval.c
80 (max-specpdl-size limits integer)
81 (max-lisp-eval-depth limits integer)
82 (stack-trace-on-error debug
83 (choice (const :tag "off")
84 (repeat :menu-tag "When"
85 :value (nil)
86 (symbol :format "%v"))
87 (const :tag "always" t)))
88 (debug-on-error debug
89 (choice (const :tag "off")
90 (repeat :menu-tag "When"
91 :value (nil)
92 (symbol :format "%v"))
93 (const :tag "always" t)))
94 (debug-ignored-errors debug (repeat (choice symbol regexp)))
95 (debug-on-quit debug choice)
96 ;; fileio.c
97 (insert-default-directory minibuffer boolean)
98 ;; frame.c
99 (default-frame-alist frames
100 (repeat (cons :format "%v"
101 (symbol :tag "Parameter")
102 (sexp :tag "Value"))))
103 ;; indent.c
104 (indent-tabs-mode fill boolean)
105 ;; keyboard.c
106 (meta-prefix-char keyboard character)
107 (auto-save-interval auto-save integer)
108 (auto-save-timeout auto-save (choice (const :tag "off" nil)
109 (integer :format "%v")))
110 (echo-keystrokes minibuffer boolean)
111 (polling-period keyboard integer)
112 (double-click-time mouse integer)
113 (inhibit-local-menu-bar-menus menu boolean)
114 (help-char keyboard character)
115 (help-event-list keyboard (repeat (sexp :format "%v")))
116 (menu-prompting menu boolean)
117 (track-mouse mouse boolean)
118 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
119 (integer :tag "time" 2)
120 (sexp :tag "on"
121 :format "%t")))
122 ;; lread.c
123 (load-path environment
124 (repeat (choice :tag "[Current dir?]"
125 (const :tag " current dir" nil)
126 (directory :format "%v"))))
127 ;; minibuf.c
128 (completion-auto-help minibuffer boolean)
129 (enable-recursive-minibuffers minibuffer boolean)
130 (minibuffer-auto-raise minibuffer boolean)
131 ;; process.c
132 (delete-exited-processes processes-basics boolean)
133 ;; syntax.c
134 (parse-sexp-ignore-comments editing-basics boolean)
135 (words-include-escapes editing-basics boolean)
136 ;; window.c
137 (temp-buffer-show-function windows function)
138 (display-buffer-function windows function)
139 (pop-up-frames frames boolean)
140 (pop-up-frame-function frames function)
141 (special-display-buffer-names
142 frames
143 (repeat (choice :tag "Buffer"
144 :value ""
145 (string :format "%v")
146 (cons :tag "With attributes"
147 :format "%v"
148 :value ("" . nil)
149 (string :format "%v")
150 (repeat :tag "Attributes"
151 (cons :format "%v"
152 (symbol :tag "Parameter")
153 (sexp :tag "Value")))))))
154 (special-display-regexps
155 frames
156 (repeat (choice :tag "Buffer"
157 :value ""
158 (regexp :format "%v")
159 (cons :tag "With attributes"
160 :format "%v"
161 :value ("" . nil)
162 (regexp :format "%v")
163 (repeat :tag "Attributes"
164 (cons :format "%v"
165 (symbol :tag "Parameter")
166 (sexp :tag "Value")))))))
167 (special-display-function frames function)
168 (same-window-buffer-names windows (repeat (string :format "%v")))
169 (same-window-regexps windows (repeat (regexp :format "%v")))
170 (pop-up-windows windows boolean)
171 (next-screen-context-lines windows boolean)
172 (split-height-threshold windows integer)
173 (window-min-height windows integer)
174 (window-min-width windows integer)
175 ;; xdisp.c
176 (scroll-step windows integer)
177 (truncate-partial-width-windows display boolean)
178 (mode-line-inverse-video modeline boolean)
179 (line-number-display-limit display integer)
180 (highlight-nonselected-windows display boolean)
181 (message-log-max debug (choice (const :tag "Disable" nil)
182 (integer :menu-tag "lines"
183 :format "%v")
184 (const :tag "Unlimited" t)))
185 ;; xfns.c
186 (x-bitmap-file-path installation
187 (repeat (directory :format "%v")))))
188 this symbol group type
189 ;; This function turns a value
190 ;; into an expression which produces that value.
191 (quoter (lambda (sexp)
192 (if (or (memq sexp '(t nil))
193 (and (symbolp sexp)
194 (eq (aref (symbol-name sexp) 0) ?:))
195 (and (listp sexp)
196 (memq (car sexp) '(lambda)))
197 (stringp sexp)
198 (numberp sexp)
199 (and (fboundp 'characterp)
200 (characterp sexp)))
201 sexp
202 (list 'quote sexp)))))
203 (while all
204 (setq this (car all)
205 all (cdr all)
206 symbol (nth 0 this)
207 group (nth 1 this)
208 type (nth 2 this))
209 (if (not (boundp symbol))
210 ;; If variables are removed from C code, give an error here!
211 (message "Built-in variable `%S' not bound" symbol)
212 ;; Save the standard value, unless we already did.
213 (or (get symbol 'standard-value)
214 (put symbol 'standard-value
215 (list (funcall quoter (default-value symbol)))))
216 ;; If this is NOT while dumping Emacs,
217 ;; set up the rest of the customization info.
218 (unless purify-flag
219 ;; Add it to the right group.
220 (custom-add-to-group group symbol 'custom-variable)
221 ;; Set the type.
222 (put symbol 'custom-type type)))))
224 ;; Record cus-start as loaded
225 ;; if we have set up all the info that we can set up.
226 ;; Don't record cus-start as loaded
227 ;; if we have set up only the standard values.
228 (unless purify-flag
229 (provide 'cus-start))
231 ;;; cus-start.el ends here.