comparison lisp/custom/cus-start.el @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents
children
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
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
8 ;; This file is part of XEmacs.
9
10 ;; XEmacs is free software; you can redistribute it and/or modify it
11 ;; 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 ;; XEmacs is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 ;; 02111-1307, USA.
24
25 ;;; Synched up with: Not synched with FSF.
26
27 ;;; Commentary:
28 ;;
29 ;; The following code is used to define the customization properties
30 ;; for builtin variables, and variables in the packages that are
31 ;; preloaded /very/ early, before custom.el itself (replace.el is such
32 ;; an example). The way it handles custom stuff is dirty, and should
33 ;; be regarded as a last resort. DO NOT add variables here, unless
34 ;; you know what you are doing.
35
36 ;; Must be run before the user has changed the value of any options!
37
38
39 ;;; Code:
40
41 (require 'custom)
42
43 (defun custom-start-quote (sexp)
44 ;; This is copied from `cus-edit.el'.
45 "Quote SEXP iff it is not self quoting."
46 (if (or (memq sexp '(t nil))
47 (and (symbolp sexp)
48 (eq (aref (symbol-name sexp) 0) ?:))
49 (and (listp sexp)
50 (memq (car sexp) '(lambda)))
51 (stringp sexp)
52 (numberp sexp)
53 (and (fboundp 'characterp)
54 (characterp sexp)))
55 sexp
56 (list 'quote sexp)))
57
58 (let ((all '(;; boolean
59 (abbrev-all-caps abbrev boolean)
60 (allow-deletion-of-last-visible-frame frames boolean)
61 (debug-on-quit debug boolean)
62 (delete-auto-save-files auto-save boolean)
63 (delete-exited-processes processes-basics boolean)
64 (indent-tabs-mode editing-basics boolean)
65 (load-ignore-elc-files maint boolean)
66 (load-warn-when-source-newer maint boolean)
67 (load-warn-when-source-only maint boolean)
68 (modifier-keys-are-sticky keyboard boolean)
69 (no-redraw-on-reenter display boolean)
70 (scroll-on-clipped-lines display boolean)
71 (truncate-partial-width-windows display boolean)
72 (visible-bell sound boolean)
73 (x-allow-sendevents x boolean)
74 (zmacs-regions editing-basics boolean)
75 ;; integer
76 (auto-save-interval auto-save integer)
77 (bell-volume sound integer)
78 (echo-keystrokes keyboard integer)
79 (gc-cons-threshold alloc integer)
80 (next-screen-context-lines display integer)
81 (scroll-step windows integer)
82 (window-min-height windows integer)
83 (window-min-width windows integer)
84 ;; object
85 (auto-save-file-format auto-save
86 (choice (const :tag "Normal" t)
87 (repeat (symbol :tag "Format"))))
88 (completion-ignored-extensions minibuffer
89 (repeat
90 (string :format "%v")))
91 (debug-ignored-errors debug (repeat (choice :format "%v"
92 (symbol :tag "Class")
93 regexp)))
94 (debug-on-error debug (choice (const :tag "off" nil)
95 (const :tag "Always" t)
96 (repeat :menu-tag "When"
97 :value (nil)
98 (symbol
99 :tag "Condition"))))
100 (debug-on-signal debug (choice (const :tag "off" nil)
101 (const :tag "Always" t)
102 (repeat :menu-tag "When"
103 :value (nil)
104 (symbol
105 :tag "Condition"))))
106 (exec-path processes-basics (repeat
107 (choice :tag "Directory"
108 (const :tag "Default" nil)
109 (directory :format "%v"))))
110 (file-name-handler-alist data (repeat
111 (cons regexp
112 (function :tag "Handler"))))
113 (shell-file-name execute file)
114 (stack-trace-on-error debug (choice (const :tag "off" nil)
115 (const :tag "Always" t)
116 (repeat :menu-tag "When"
117 :value (nil)
118 (symbol
119 :tag "Condition"))))
120 (stack-trace-on-signal debug (choice (const :tag "off" nil)
121 (const :tag "Always" t)
122 (repeat :menu-tag "When"
123 :value (nil)
124 (symbol
125 :tag "Condition"))))
126 ;; buffer-local
127 (case-fold-search matching boolean)
128 (ctl-arrow display (choice (integer 160)
129 (sexp :tag "160 (default)"
130 :format "%t\n")))
131 (fill-column fill integer)
132 (left-margin fill integer)
133 (tab-width editing-basics integer)
134 (truncate-lines display boolean)
135 ;; not documented as user-options, but should still be
136 ;; customizable:
137 (bar-cursor display (choice (const :tag "Block Cursor" nil)
138 (const :tag "Bar Cursor (1 pixel)" t)
139 (sexp :tag "Bar Cursor (2 pixels)"
140 :format "%t\n" 'other)))
141 (default-frame-plist frames (repeat
142 (list :inline t
143 :format "%v"
144 (symbol :tag "Parameter")
145 (sexp :tag "Value"))))
146 (disable-auto-save-when-buffer-shrinks auto-save boolean)
147 (find-file-use-truenames find-file boolean)
148 (find-file-compare-truenames find-file boolean)
149 (focus-follows-mouse x boolean)
150 (help-char keyboard character)
151 (max-lisp-eval-depth limits integer)
152 (max-specpdl-size limits integer)
153 (meta-prefix-char keyboard character)
154 (parse-sexp-ignore-comments editing-basics boolean)
155 (selective-display display
156 (choice (const :tag "off" nil)
157 (integer :tag "space"
158 :format "%v"
159 1)
160 (const :tag "on" t)))
161 (selective-display-ellipses display boolean)
162 (signal-error-on-buffer-boundary internal boolean)
163 (temp-buffer-show-function
164 windows (radio (function-item :tag "Temp Buffers Always in Same Frame"
165 :format "%t\n"
166 show-temp-buffer-in-current-frame)
167 (const :tag "Temp Buffers Like Other Buffers" nil)
168 (function :tag "Other")))
169 (undo-threshold undo integer)
170 (undo-high-threshold undo integer)
171 (words-include-escapes editing-basics boolean)
172 ;; These are from replace.el, which is loaded too early
173 ;; to be customizable.
174 (case-replace matching boolean)
175 (query-replace-highlight matching boolean)
176 (list-matching-lines-default-context-lines matching integer)))
177 this symbol group type)
178 (while all
179 (setq this (car all)
180 all (cdr all)
181 symbol (nth 0 this)
182 group (nth 1 this)
183 type (nth 2 this))
184 (if (not (boundp symbol))
185 ;; This is loaded so early, there is no message
186 (if (fboundp 'message)
187 ;; If variables are removed from C code, give an error here!
188 (message "Intrinsic `%S' not bound" symbol))
189 ;; This is called before any user can have changed the value.
190 (put symbol 'standard-value
191 (list (custom-start-quote (default-value symbol))))
192 ;; Add it to the right group.
193 (custom-add-to-group group symbol 'custom-variable)
194 ;; Set the type.
195 (put symbol 'custom-type type))))
196
197 ;; This is to prevent it from being reloaded by `cus-load.el'.
198 (provide 'cus-start)
199
200 ;;; cus-start.el ends here.