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