(Funibyte_char_to_multibyte): Export.
[emacs.git] / lisp / cus-start.el
blobc09662ff60b3473d7f74ee25dc8de8d1495891c5
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002 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 (enable-multibyte-characters mule boolean)
49 (case-fold-search matching boolean)
50 (fill-column fill integer)
51 (left-margin fill integer)
52 (tab-width editing-basics integer)
53 (ctl-arrow display boolean)
54 (truncate-lines display boolean)
55 (selective-display-ellipses display boolean)
56 (indicate-empty-lines display boolean "21.1")
57 (scroll-up-aggressively windows
58 (choice (const :tag "off" nil) number)
59 "21.1")
60 (scroll-down-aggressively windows
61 (choice (const :tag "off" nil) number)
62 "21.1")
63 ;; callint.c
64 (mark-even-if-inactive editing-basics boolean)
65 ;; callproc.c
66 (shell-file-name execute file)
67 (exec-path execute
68 (repeat (choice (const :tag "default" nil)
69 (file :format "%v"))))
70 ;; coding.c
71 (inhibit-eol-conversion mule boolean)
72 (eol-mnemonic-undecided mule string)
73 (eol-mnemonic-unix mule string)
74 (eol-mnemonic-dos mule string)
75 (eol-mnemonic-mac mule string)
76 (file-coding-system-alist
77 mule
78 (alist
79 :key-type (regexp :tag "File regexp")
80 :value-type (choice
81 :value (undecided . undecided)
82 (cons :tag "Encoding/decoding pair"
83 :value (undecided . undecided)
84 (coding-system :tag "Decoding")
85 (coding-system :tag "Encoding"))
86 (coding-system :tag "Single coding system"
87 :value undecided)
88 (function :value ignore))))
89 (selection-coding-system mule coding-system)
90 ;; dired.c
91 (completion-ignored-extensions dired
92 (repeat (string :format "%v")))
93 ;; dispnew.c
94 (baud-rate display integer)
95 (inverse-video display boolean)
96 (visible-bell display boolean)
97 (no-redraw-on-reenter display boolean)
98 ;; editfns.c
99 (user-full-name mail string)
100 ;; eval.c
101 (max-specpdl-size limits integer)
102 (max-lisp-eval-depth limits integer)
103 (stack-trace-on-error debug
104 (choice (const :tag "off")
105 (repeat :menu-tag "When"
106 :value (nil)
107 (symbol :format "%v"))
108 (const :tag "always" t)))
109 (debug-on-error debug
110 (choice (const :tag "off")
111 (repeat :menu-tag "When"
112 :value (nil)
113 (symbol :format "%v"))
114 (const :tag "always" t)))
115 (debug-ignored-errors debug (repeat (choice symbol regexp)))
116 (debug-on-quit debug
117 (choice (const :tag "off")
118 (repeat :menu-tag "When"
119 :value (nil)
120 (symbol :format "%v"))
121 (const :tag "always" t)))
122 ;; fileio.c
123 (insert-default-directory minibuffer boolean)
124 ;; fns.c
125 (use-dialog-box menu boolean "21.1")
126 ;; frame.c
127 (default-frame-alist frames
128 (repeat (cons :format "%v"
129 (symbol :tag "Parameter")
130 (sexp :tag "Value"))))
131 (mouse-highlight mouse (choice (const :tag "disabled" nil)
132 (const :tag "always shown" t)
133 (other :tag "hidden by keypress" 1)))
134 ;; indent.c
135 (indent-tabs-mode fill boolean)
136 ;; keyboard.c
137 (meta-prefix-char keyboard character)
138 (auto-save-interval auto-save integer)
139 (auto-save-timeout auto-save (choice (const :tag "off" nil)
140 (integer :format "%v")))
141 (echo-keystrokes minibuffer number)
142 (polling-period keyboard integer)
143 (double-click-time mouse (restricted-sexp
144 :match-alternatives (integerp 'nil 't)))
145 (double-click-fuzz mouse integer)
146 (inhibit-local-menu-bar-menus menu boolean)
147 (help-char keyboard character)
148 (help-event-list keyboard (repeat (sexp :format "%v")))
149 (menu-prompting menu boolean)
150 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
151 (integer :tag "time" 2)
152 (other :tag "on")))
154 ;; This is not good news because it will use the wrong
155 ;; version-specific directories when you upgrade. We need
156 ;; customization of the front of the list, maintaining the standard
157 ;; value intact at the back.
158 ;;; (load-path environment
159 ;;; (repeat (choice :tag "[Current dir?]"
160 ;;; :format "%[Current dir?%] %v"
161 ;;; (const :tag " current dir" nil)
162 ;;; (directory :format "%v"))))
163 ;; minibuf.c
164 (completion-auto-help minibuffer boolean)
165 (enable-recursive-minibuffers minibuffer boolean)
166 (history-length minibuffer
167 (choice (const :tag "Infinite" t)
168 integer))
169 (minibuffer-prompt-properties
170 minibuffer
171 (list
172 (checklist :inline t
173 (const :tag "Read-Only"
174 :doc "Prevent prompt from being modified"
175 :format "%t%n%h"
176 :inline t
177 (read-only t))
178 (const :tag "Inviolable"
179 :doc "Prevent point from ever entering prompt"
180 :format "%t%n%h"
181 :inline t
182 (point-entered minibuffer-avoid-prompt)))
183 (repeat :inline t
184 :tag "Other Properties"
185 (list :inline t
186 :format "%v"
187 (symbol :tag "Property")
188 (sexp :tag "Value"))))
189 "21.1")
190 (minibuffer-auto-raise minibuffer boolean)
191 ;; options property set at end
192 (read-buffer-function minibuffer
193 (choice (const nil)
194 (function-item iswitchb-read-buffer)
195 function))
196 ;; msdos.c
197 (dos-unsupported-char-glyph display integer)
198 ;; process.c
199 (delete-exited-processes processes-basics boolean)
200 ;; syntax.c
201 (parse-sexp-ignore-comments editing-basics boolean)
202 (words-include-escapes editing-basics boolean)
203 ;; window.c
204 (temp-buffer-show-function windows (choice (const nil) function))
205 (display-buffer-function windows (choice (const nil) function))
206 (pop-up-frames frames boolean)
207 (pop-up-frame-function frames function)
208 (special-display-buffer-names
209 frames
210 (repeat (choice :tag "Buffer"
211 :value ""
212 (string :format "%v")
213 (cons :tag "With attributes"
214 :format "%v"
215 :value ("" . nil)
216 (string :format "%v")
217 (repeat :tag "Attributes"
218 (cons :format "%v"
219 (symbol :tag "Parameter")
220 (sexp :tag "Value")))))))
221 (special-display-regexps
222 frames
223 (repeat (choice :tag "Buffer"
224 :value ""
225 (regexp :format "%v")
226 (cons :tag "With attributes"
227 :format "%v"
228 :value ("" . nil)
229 (regexp :format "%v")
230 (repeat :tag "Attributes"
231 (cons :format "%v"
232 (symbol :tag "Parameter")
233 (sexp :tag "Value")))))))
234 (special-display-function frames function)
235 (same-window-buffer-names windows (repeat (string :format "%v")))
236 (same-window-regexps windows (repeat (regexp :format "%v")))
237 (pop-up-windows windows boolean)
238 (even-window-heights windows boolean)
239 (next-screen-context-lines windows integer)
240 (split-height-threshold windows integer)
241 (window-min-height windows integer)
242 (window-min-width windows integer)
243 (scroll-preserve-screen-position windows boolean)
244 (display-buffer-reuse-frames windows boolean "21.1")
245 ;; xdisp.c
246 (scroll-step windows integer)
247 (scroll-conservatively windows integer)
248 (scroll-margin windows integer)
249 (hscroll-margin windows integer "21.3")
250 (hscroll-step windows number "21.3")
251 (truncate-partial-width-windows display boolean)
252 (mode-line-inverse-video modeline boolean)
253 (mode-line-in-non-selected-windows modeline boolean "21.3")
254 (line-number-display-limit display
255 (choice integer
256 (const :tag "No limit" nil)))
257 (highlight-nonselected-windows display boolean)
258 (message-log-max debug (choice (const :tag "Disable" nil)
259 (integer :menu-tag "lines"
260 :format "%v")
261 (other :tag "Unlimited" t)))
262 (unibyte-display-via-language-environment mule boolean)
263 ;; xfaces.c
264 (scalable-fonts-allowed display boolean)
265 ;; xfns.c
266 (x-bitmap-file-path installation
267 (repeat (directory :format "%v")))
268 ;; xterm.c
269 (mouse-autoselect-window display boolean "21.3")
270 (x-use-underline-position-properties display boolean "21.3")
271 (x-stretch-cursor display boolean "21.1")))
272 this symbol group type native-p version
273 ;; This function turns a value
274 ;; into an expression which produces that value.
275 (quoter (lambda (sexp)
276 (if (or (memq sexp '(t nil))
277 (keywordp sexp)
278 (and (listp sexp)
279 (memq (car sexp) '(lambda)))
280 (stringp sexp)
281 ;; (and (fboundp 'characterp)
282 ;; (characterp sexp))
283 (numberp sexp))
284 sexp
285 (list 'quote sexp)))))
286 (while all
287 (setq this (car all)
288 all (cdr all)
289 symbol (nth 0 this)
290 group (nth 1 this)
291 type (nth 2 this)
292 version (nth 3 this)
293 ;; Don't complain about missing variables which are
294 ;; irrelevant to this platform.
295 native-p (save-match-data
296 (cond
297 ((string-match "\\`dos-" (symbol-name symbol))
298 (eq system-type 'ms-dos))
299 ((string-match "\\`w32-" (symbol-name symbol))
300 (eq system-type 'windows-nt))
301 ((string-match "\\`x-" (symbol-name symbol))
302 (fboundp 'x-create-frame))
303 (t t))))
304 (if (not (boundp symbol))
305 ;; If variables are removed from C code, give an error here!
306 (and native-p
307 (message "Note, built-in variable `%S' not bound" symbol))
308 ;; Save the standard value, unless we already did.
309 (or (get symbol 'standard-value)
310 (put symbol 'standard-value
311 (list (funcall quoter (default-value symbol)))))
312 ;; If this is NOT while dumping Emacs,
313 ;; set up the rest of the customization info.
314 (unless purify-flag
315 ;; Add it to the right group.
316 (custom-add-to-group group symbol 'custom-variable)
317 ;; Set the type.
318 (put symbol 'custom-type type)
319 (put symbol 'custom-version version)))))
321 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
322 (put 'selection-coding-system 'custom-set
323 (lambda (symbol value)
324 (set-selection-coding-system value)
325 (set symbol value)))
327 ;; Record cus-start as loaded
328 ;; if we have set up all the info that we can set up.
329 ;; Don't record cus-start as loaded
330 ;; if we have set up only the standard values.
331 (unless purify-flag
332 (provide 'cus-start))
334 ;;; cus-start.el ends here