(intern): Don't make a pure string here, since Fintern does that.
[bpt/emacs.git] / lisp / cus-start.el
CommitLineData
1444b0c0
PA
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
7
c2383d2d
RS
8;; This file is part of GNU Emacs.
9
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.
14
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.
19
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.
24
1444b0c0
PA
25;;; Commentary:
26;;
27;; Must be run before the user has changed the value of any options!
28
29;;; Code:
30
31(defun custom-start-quote (sexp)
32 ;; This is copied from `cus-edit.el'.
33 "Quote SEXP iff it is not self quoting."
34 (if (or (memq sexp '(t nil))
35 (and (symbolp sexp)
36 (eq (aref (symbol-name sexp) 0) ?:))
37 (and (listp sexp)
38 (memq (car sexp) '(lambda)))
39 (stringp sexp)
40 (numberp sexp)
41 (and (fboundp 'characterp)
42 (characterp sexp)))
43 sexp
44 (list 'quote sexp)))
45
f24bcac4 46;; Add support for build in variables.
1444b0c0
PA
47(let ((all '(;; abbrev.c
48 (abbrev-all-caps abbrev-mode boolean)
49 (pre-abbrev-expand-hook abbrev-mode hook)
50 ;; alloc.c
51 (gc-cons-threshold alloc integer)
52 (undo-limit undo integer)
53 (undo-strong-limit undo integer)
54 (garbage-collection-messages alloc boolean)
55 ;; buffer.c
56 (mode-line-format modeline sexp) ;Hard to do right.
57 (default-major-mode internal function)
58 (case-fold-search matching boolean)
59 (fill-column fill integer)
60 (left-margin fill integer)
61 (tab-width editing-basics integer)
62 (ctl-arrow display boolean)
63 (truncate-lines display boolean)
64 (selective-display display
65 (choice (const :tag "off" nil)
66 (integer :tag "space"
67 :format "%v"
68 1)
69 (const :tag "on" t)))
70 (selective-display-ellipses display boolean)
71 (transient-mark-mode editing-basics boolean)
72 ;; callint.c
73 (mark-even-if-inactive editing-basics boolean)
74 ;; callproc.c
75 (shell-file-name execute file)
76 (exec-path execute
77 (repeat (choice (const :tag "default" nil)
78 (file :format "%v"))))
79 ;; dired.c
80 (completion-ignored-extensions dired
81 (repeat (string :format "%v")))
82 ;; dispnew.el
83 (baud-rate display integer)
84 (inverse-video display boolean)
85 (visible-bell display boolean)
86 (no-redraw-on-reenter display boolean)
87 ;; editfns.c
88 (user-full-name mail string)
89 ;; eval.c
90 (max-specpdl-size limits integer)
91 (max-lisp-eval-depth limits integer)
92 (stack-trace-on-error debug
93 (choice (const :tag "off")
94 (repeat :menu-tag "When"
95 :value (nil)
96 (symbol :format "%v"))
97 (const :tag "always" t)))
98 (debug-on-error debug
99 (choice (const :tag "off")
100 (repeat :menu-tag "When"
101 :value (nil)
102 (symbol :format "%v"))
103 (const :tag "always" t)))
104 (debug-ignored-errors debug (repeat (choice symbol regexp)))
105 (debug-on-quit debug choice)
106 ;; fileio.c
107 (insert-default-directory minibuffer boolean)
108 ;; frame.c
109 (default-frame-alist frames
110 (repeat (cons :format "%v"
111 (symbol :tag "Parameter")
112 (sexp :tag "Value"))))
113 ;; indent.c
114 (indent-tabs-mode fill boolean)
115 ;; keyboard.c
116 (meta-prefix-char keyboard character)
117 (auto-save-interval auto-save integer)
118 (auto-save-timeout auto-save (choice (const :tag "off" nil)
119 (integer :format "%v")))
120 (echo-keystrokes minibuffer boolean)
121 (polling-period keyboard integer)
122 (double-click-time mouse integer)
123 (inhibit-local-menu-bar-menus menu boolean)
124 (help-char keyboard character)
125 (help-event-list keyboard (repeat (sexp :format "%v")))
126 (menu-prompting menu boolean)
127 (track-mouse mouse boolean)
128 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
129 (integer :tag "time" 2)
130 (sexp :tag "on"
131 :format "%t")))
132 ;; lread.c
133 (load-path environment
939c9c52 134 (repeat (choice :tag "Current or Specific Dir"
016863e6 135 (const :tag "use current" nil)
939c9c52 136 (directory :tag "Specific"))))
1444b0c0
PA
137 ;; minibuf.c
138 (completion-auto-help minibuffer boolean)
139 (enable-recursive-minibuffers minibuffer boolean)
140 (minibuffer-auto-raise minibuffer boolean)
141 ;; process.c
142 (delete-exited-processes proces-basics boolean)
143 ;; syntax.c
144 (parse-sexp-ignore-comments editing-basics boolean)
145 (words-include-escapes editing-basics boolean)
146 ;; window.c
147 (temp-buffer-show-function windows function)
148 (display-buffer-function windows function)
149 (pop-up-frames frames boolean)
150 (pop-up-frame-function frames function)
151 (special-display-buffer-names
152 frames
153 (repeat (choice :tag "Buffer"
154 :value ""
155 (string :format "%v")
156 (cons :tag "With attributes"
157 :format "%v"
158 :value ("" . nil)
159 (string :format "%v")
160 (repeat :tag "Attributes"
161 (cons :format "%v"
162 (symbol :tag "Parameter")
163 (sexp :tag "Value")))))))
164 (special-display-regexps
165 frames
166 (repeat (choice :tag "Buffer"
167 :value ""
168 (regexp :format "%v")
169 (cons :tag "With attributes"
170 :format "%v"
171 :value ("" . nil)
172 (regexp :format "%v")
173 (repeat :tag "Attributes"
174 (cons :format "%v"
175 (symbol :tag "Parameter")
176 (sexp :tag "Value")))))))
177 (special-display-function frames function)
178 (same-window-buffer-names windows (repeat (string :format "%v")))
179 (same-window-regexps windows (repeat (regexp :format "%v")))
180 (pop-up-windows windows boolean)
181 (next-screen-context-lines windows boolean)
182 (split-height-threshold windows integer)
183 (window-min-height windows integer)
184 (window-min-width windows integer)
185 ;; xdisp.c
186 (scroll-step windows integer)
187 (truncate-partial-width-windows display boolean)
188 (mode-line-inverse-video modeline boolean)
189 (line-number-display-limit display integer)
190 (highlight-nonselected-windows display boolean)
191 (message-log-max debug (choice (const :tag "Disable" nil)
192 (integer :menu-tag "lines"
193 :format "%v")
194 (const :tag "Unlimited" t)))
195 ;; xfns.c
196 (x-bitmap-file-path installation
197 (repeat (directory :format "%v")))))
198 this symbol group type)
199 (while all
200 (setq this (car all)
201 all (cdr all)
202 symbol (nth 0 this)
203 group (nth 1 this)
204 type (nth 2 this))
205 (if (not (boundp symbol))
206 ;; If variables are removed from C code, give an error here!
207 (message "Intrinsic `%S' not bound" symbol)
208 ;; This is called before any user can have changed the value.
209 (put symbol 'factory-value
210 (list (custom-start-quote (default-value symbol))))
211 ;; Add it to the right group.
212 (custom-add-to-group group symbol 'custom-variable)
213 ;; Set the type.
214 (put symbol 'custom-type type))))
215
216;;; cus-start.el ends here.