gnus-start.el (gnus-find-new-newsgroups): Remove gnus-check-first-time-used.
[emacs.git] / lisp / cus-start.el
blobaf5338b0bcd8e9bdfe1d9b6a1cb121ecfbd14020
1 ;;; cus-start.el --- define customization properties of builtins
2 ;;
3 ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: internal
8 ;; Package: emacs
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
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 '(;; alloc.c
38 (gc-cons-threshold alloc integer)
39 (garbage-collection-messages alloc boolean)
40 ;; buffer.c
41 (mode-line-format mode-line sexp) ;Hard to do right.
42 (major-mode internal function)
43 (case-fold-search matching boolean)
44 (fill-column fill integer)
45 (left-margin fill integer)
46 (tab-width editing-basics integer)
47 (ctl-arrow display boolean)
48 (truncate-lines display boolean)
49 (word-wrap display boolean)
50 (selective-display-ellipses display boolean)
51 (indicate-empty-lines fringe boolean)
52 (indicate-buffer-boundaries
53 fringe
54 (choice
55 (const :tag "No indicators" nil)
56 (const :tag "On left, with arrows" left)
57 (const :tag "On right, with arrows" right)
58 (set :tag "Pick your own design"
59 :value ((t . nil))
60 :format "%{%t%}:\n%v\n%d"
61 :doc "You can specify a default and then override it \
62 for individual indicators.
63 Leaving \"Default\" unchecked is equivalent with specifying a default of
64 \"Do not show\"."
65 (choice :tag "Default"
66 :value (t . nil)
67 (const :tag "Do not show" (t . nil))
68 (const :tag "On the left" (t . left))
69 (const :tag "On the right" (t . right)))
70 (choice :tag "Top"
71 :value (top . left)
72 (const :tag "Do not show" (top . nil))
73 (const :tag "On the left" (top . left))
74 (const :tag "On the right" (top . right)))
75 (choice :tag "Bottom"
76 :value (bottom . left)
77 (const :tag "Do not show" (bottom . nil))
78 (const :tag "On the left" (bottom . left))
79 (const :tag "On the right" (bottom . right)))
80 (choice :tag "Up arrow"
81 :value (up . left)
82 (const :tag "Do not show" (up . nil))
83 (const :tag "On the left" (up . left))
84 (const :tag "On the right" (up . right)))
85 (choice :tag "Down arrow"
86 :value (down . left)
87 (const :tag "Do not show" (down . nil))
88 (const :tag "On the left" (down . left))
89 (const :tag "On the right" (down . right))))
90 (other :tag "On left, no arrows" t)))
91 (scroll-up-aggressively windows
92 (choice (const :tag "off" nil) number)
93 "21.1")
94 (scroll-down-aggressively windows
95 (choice (const :tag "off" nil) number)
96 "21.1")
97 (line-spacing display (choice (const :tag "none" nil) integer)
98 "22.1")
99 (cursor-in-non-selected-windows
100 cursor boolean nil t :tag "Cursor In Non-selected Windows"
101 :set #'(lambda (symbol value)
102 (set-default symbol value)
103 (force-mode-line-update t)))
104 (transient-mark-mode editing-basics boolean nil
105 (not noninteractive)
106 :initialize custom-initialize-delay
107 :set custom-set-minor-mode)
108 ;; callint.c
109 (mark-even-if-inactive editing-basics boolean)
110 ;; callproc.c
111 (shell-file-name execute file)
112 (exec-path execute
113 (repeat (choice (const :tag "default directory" nil)
114 (directory :format "%v"))))
115 ;; charset.c
116 (charset-map-path installation
117 (repeat (directory :format "%v")))
118 ;; coding.c
119 (inhibit-eol-conversion mule boolean)
120 (eol-mnemonic-undecided mule string)
121 (eol-mnemonic-unix mule string)
122 (eol-mnemonic-dos mule string)
123 (eol-mnemonic-mac mule string)
124 (file-coding-system-alist
125 mule
126 (alist
127 :key-type (regexp :tag "File regexp")
128 :value-type (choice
129 :value (undecided . undecided)
130 (cons :tag "Encoding/decoding pair"
131 :value (undecided . undecided)
132 (coding-system :tag "Decoding")
133 (coding-system :tag "Encoding"))
134 (coding-system
135 :tag "Single coding system"
136 :value undecided
137 :match (lambda (widget value)
138 (and value (not (functionp value)))))
139 (function :value ignore))))
140 ;; dired.c
141 (completion-ignored-extensions dired
142 (repeat (string :format "%v")))
143 ;; dispnew.c
144 (baud-rate display integer)
145 (inverse-video display boolean)
146 (visible-bell display boolean)
147 (no-redraw-on-reenter display boolean)
148 ;; editfns.c
149 (user-full-name mail string)
150 ;; eval.c
151 (max-specpdl-size limits integer)
152 (max-lisp-eval-depth limits integer)
153 (max-mini-window-height limits
154 (choice (const :tag "quarter screen" nil)
155 number) "23.1")
156 (stack-trace-on-error debug
157 (choice (const :tag "off")
158 (repeat :menu-tag "When"
159 :value (nil)
160 (symbol :format "%v"))
161 (const :tag "always" t)))
162 (debug-on-error debug
163 (choice (const :tag "off")
164 (repeat :menu-tag "When"
165 :value (nil)
166 (symbol :format "%v"))
167 (const :tag "always" t)))
168 (debug-ignored-errors debug (repeat (choice symbol regexp)))
169 (debug-on-quit debug
170 (choice (const :tag "off")
171 (repeat :menu-tag "When"
172 :value (nil)
173 (symbol :format "%v"))
174 (const :tag "always" t)))
175 ;; fileio.c
176 (delete-by-moving-to-trash auto-save boolean "23.1")
177 (auto-save-visited-file-name auto-save boolean)
178 ;; filelock.c
179 (temporary-file-directory
180 ;; Darwin section added 24.1, does not seem worth :version bump.
181 files directory nil
182 (file-name-as-directory
183 ;; FIXME ? Should there be Ftemporary_file_directory to do this
184 ;; more robustly (cf set_local_socket in emacsclient.c).
185 ;; It could be used elsewhere, eg Fcall_process_region,
186 ;; server-socket-dir. See bug#7135.
187 (cond ((memq system-type '(ms-dos windows-nt))
188 (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
189 "c:/temp"))
190 ((eq system-type 'darwin)
191 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
192 ;; See bug#7135.
193 (let ((tmp (ignore-errors
194 (shell-command-to-string
195 "getconf DARWIN_USER_TEMP_DIR"))))
196 (and (stringp tmp)
197 (setq tmp (replace-regexp-in-string
198 "\n\\'" "" tmp))
199 ;; Handles "getconf: Unrecognized variable..."
200 (file-directory-p tmp)
201 tmp))
202 "/tmp"))
204 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
205 "/tmp"))))
206 :initialize custom-initialize-delay)
207 ;; fns.c
208 (use-dialog-box menu boolean "21.1")
209 (use-file-dialog menu boolean "22.1")
210 (focus-follows-mouse frames boolean "20.3")
211 ;; frame.c
212 (default-frame-alist frames
213 (repeat (cons :format "%v"
214 (symbol :tag "Parameter")
215 (sexp :tag "Value"))))
216 (mouse-highlight mouse (choice (const :tag "disabled" nil)
217 (const :tag "always shown" t)
218 (other :tag "hidden by keypress" 1))
219 "22.1")
220 (make-pointer-invisible mouse boolean "23.2")
221 (menu-bar-mode frames boolean nil t
222 ;; FIXME?
223 ; :initialize custom-initialize-default
224 :set custom-set-minor-mode)
225 (tool-bar-mode (frames mouse) boolean nil t
226 ; :initialize custom-initialize-default
227 :set custom-set-minor-mode)
228 ;; fringe.c
229 (overflow-newline-into-fringe fringe boolean)
230 ;; indent.c
231 (indent-tabs-mode indent boolean)
232 ;; keyboard.c
233 (meta-prefix-char keyboard character)
234 (auto-save-interval auto-save integer)
235 (auto-save-timeout auto-save (choice (const :tag "off" nil)
236 (integer :format "%v")))
237 (echo-keystrokes minibuffer number)
238 (polling-period keyboard integer)
239 (double-click-time mouse (restricted-sexp
240 :match-alternatives (integerp 'nil 't)))
241 (double-click-fuzz mouse integer "22.1")
242 (inhibit-local-menu-bar-menus menu boolean)
243 (help-char keyboard character)
244 (help-event-list keyboard (repeat (sexp :format "%v")))
245 (menu-prompting menu boolean)
246 (select-active-regions killing
247 (choice (const :tag "always" t)
248 (const :tag "only shift-selection or mouse-drag" only)
249 (const :tag "off" nil))
250 "24.1")
251 (suggest-key-bindings keyboard (choice (const :tag "off" nil)
252 (integer :tag "time" 2)
253 (other :tag "on")))
255 ;; This is not good news because it will use the wrong
256 ;; version-specific directories when you upgrade. We need
257 ;; customization of the front of the list, maintaining the standard
258 ;; value intact at the back.
259 ;;; (load-path environment
260 ;;; (repeat (choice :tag "[Current dir?]"
261 ;;; :format "%[Current dir?%] %v"
262 ;;; (const :tag " current dir" nil)
263 ;;; (directory :format "%v"))))
264 ;; minibuf.c
265 (enable-recursive-minibuffers minibuffer boolean)
266 (history-length minibuffer
267 (choice (const :tag "Infinite" t) integer)
268 "22.1")
269 (history-delete-duplicates minibuffer boolean "22.1")
270 (read-buffer-completion-ignore-case minibuffer boolean "23.1")
272 (minibuffer-prompt-properties
273 minibuffer
274 (list
275 (checklist :inline t
276 (const :tag "Read-Only"
277 :doc "Prevent prompt from being modified"
278 :format "%t%n%h"
279 :inline t
280 (read-only t))
281 (const :tag "Don't Enter"
282 :doc "Prevent point from ever entering prompt"
283 :format "%t%n%h"
284 :inline t
285 (point-entered minibuffer-avoid-prompt)))
286 (repeat :inline t
287 :tag "Other Properties"
288 (list :inline t
289 :format "%v"
290 (symbol :tag "Property")
291 (sexp :tag "Value"))))
292 "21.1")
293 (minibuffer-auto-raise minibuffer boolean)
294 ;; options property set at end
295 (read-buffer-function minibuffer
296 (choice (const nil)
297 (function-item iswitchb-read-buffer)
298 function))
299 ;; msdos.c
300 (dos-unsupported-char-glyph display integer)
301 ;; nsterm.m
302 (ns-control-modifier
304 (choice (const :tag "No modifier" nil)
305 (const control) (const meta)
306 (const alt) (const hyper)
307 (const super)) "23.1")
308 (ns-command-modifier
310 (choice (const :tag "No modifier" nil)
311 (const control) (const meta)
312 (const alt) (const hyper)
313 (const super)) "23.1")
314 (ns-alternate-modifier
316 (choice (const :tag "No modifier (work as alternate/option)" none)
317 (const control) (const meta)
318 (const alt) (const hyper)
319 (const super)) "23.1")
320 (ns-right-alternate-modifier
322 (choice (const :tag "No modifier (work as alternate/option)" none)
323 (const :tag "Use the value of ns-alternate-modifier"
324 left)
325 (const control) (const meta)
326 (const alt) (const hyper)
327 (const super)) "23.3")
328 (ns-function-modifier
330 (choice (const :tag "No modifier (work as function)" none)
331 (const control) (const meta)
332 (const alt) (const hyper)
333 (const super)) "23.1")
334 (ns-antialias-text ns boolean "23.1")
335 ;; process.c
336 (delete-exited-processes processes-basics boolean)
337 ;; syntax.c
338 (parse-sexp-ignore-comments editing-basics boolean)
339 (words-include-escapes editing-basics boolean)
340 (open-paren-in-column-0-is-defun-start editing-basics boolean
341 "21.1")
342 ;; term.c
343 (visible-cursor cursor boolean "22.1")
344 ;; undo.c
345 (undo-limit undo integer)
346 (undo-strong-limit undo integer)
347 (undo-outer-limit undo
348 (choice integer
349 (const :tag "No limit"
350 :format "%t\n%d"
351 :doc
352 "With this choice, \
353 the undo info for the current command never gets discarded.
354 This should only be chosen under exceptional circumstances,
355 since it could result in memory overflow and make Emacs crash."
356 nil))
357 "22.1")
358 ;; window.c
359 (temp-buffer-show-function windows (choice (const nil) function))
360 (next-screen-context-lines windows integer)
361 (window-min-height windows integer)
362 (window-min-width windows integer)
363 (scroll-preserve-screen-position
364 windows (choice
365 (const :tag "Off (nil)" :value nil)
366 (const :tag "Full screen (t)" :value t)
367 (other :tag "Always" 1)) "22.1")
368 (recenter-redisplay windows
369 (choice
370 (const :tag "Never (nil)" :value nil)
371 (const :tag "Only on ttys" :value tty)
372 (other :tag "Always" t))
373 "23.1")
374 ;; xdisp.c
375 (show-trailing-whitespace whitespace-faces boolean nil nil
376 :safe booleanp)
377 (scroll-step windows integer)
378 (scroll-conservatively windows integer)
379 (scroll-margin windows integer)
380 (hscroll-margin windows integer "22.1")
381 (hscroll-step windows number "22.1")
382 (truncate-partial-width-windows display boolean "23.1")
383 (mode-line-inverse-video mode-line boolean)
384 (mode-line-in-non-selected-windows mode-line boolean "22.1")
385 (line-number-display-limit display
386 (choice integer
387 (const :tag "No limit" nil)))
388 (line-number-display-limit-width display integer "22.1")
389 (highlight-nonselected-windows display boolean)
390 (message-log-max debug (choice (const :tag "Disable" nil)
391 (integer :menu-tag "lines"
392 :format "%v")
393 (other :tag "Unlimited" t)))
394 (unibyte-display-via-language-environment mule boolean)
395 (blink-cursor-alist cursor alist "22.1")
396 (overline-margin display integer "22.1")
397 (underline-minimum-offset display integer "23.1")
398 (mouse-autoselect-window
399 display (choice
400 (const :tag "Off (nil)" :value nil)
401 (const :tag "Immediate" :value t)
402 (number :tag "Delay by secs" :value 0.5)) "22.1")
403 (tool-bar-style
404 frames (choice
405 (const :tag "Images" :value image)
406 (const :tag "Text" :value text)
407 (const :tag "Both" :value both)
408 (const :tag "Both-horiz" :value both-horiz)
409 (const :tag "Text-image-horiz" :value text-image-horiz)
410 (const :tag "System default" :value nil)) "23.3")
411 (tool-bar-max-label-size frames integer "23.3")
412 (auto-hscroll-mode scrolling boolean "21.1")
413 (display-hourglass cursor boolean)
414 (hourglass-delay cursor number)
416 ;; xfaces.c
417 (scalable-fonts-allowed display boolean "22.1")
418 ;; xfns.c
419 (x-bitmap-file-path installation
420 (repeat (directory :format "%v")))
421 (x-gtk-use-old-file-dialog menu boolean "22.1")
422 (x-gtk-show-hidden-files menu boolean "22.1")
423 (x-gtk-file-dialog-help-text menu boolean "22.1")
424 (x-gtk-whole-detached-tool-bar x boolean "22.1")
425 (x-gtk-use-system-tooltips tooltip boolean "23.3")
426 ;; xterm.c
427 (x-use-underline-position-properties display boolean "22.1")
428 (x-underline-at-descent-line display boolean "22.1")
429 (x-stretch-cursor display boolean "21.1")
430 ;; xsettings.c
431 (font-use-system-font font-selection boolean "23.2")))
432 this symbol group type standard version native-p rest prop propval
433 ;; This function turns a value
434 ;; into an expression which produces that value.
435 (quoter (lambda (sexp)
436 (if (or (memq sexp '(t nil))
437 (keywordp sexp)
438 (and (listp sexp)
439 (memq (car sexp) '(lambda)))
440 (stringp sexp)
441 (numberp sexp))
442 sexp
443 (list 'quote sexp)))))
444 (while all
445 (setq this (car all)
446 all (cdr all)
447 symbol (nth 0 this)
448 group (nth 1 this)
449 type (nth 2 this)
450 version (nth 3 this)
451 ;; If we did not specify any standard value expression above,
452 ;; use the current value as the standard value.
453 standard (if (nthcdr 4 this)
454 (nth 4 this)
455 (when (default-boundp symbol)
456 (funcall quoter (default-value symbol))))
457 rest (nthcdr 5 this)
458 ;; Don't complain about missing variables which are
459 ;; irrelevant to this platform.
460 native-p (save-match-data
461 (cond
462 ((string-match "\\`dos-" (symbol-name symbol))
463 (eq system-type 'ms-dos))
464 ((string-match "\\`w32-" (symbol-name symbol))
465 (eq system-type 'windows-nt))
466 ((string-match "\\`ns-" (symbol-name symbol))
467 (featurep 'ns))
468 ((string-match "\\`x-.*gtk" (symbol-name symbol))
469 (featurep 'gtk))
470 ((string-match "\\`x-" (symbol-name symbol))
471 (fboundp 'x-create-frame))
472 ((string-match "selection" (symbol-name symbol))
473 (fboundp 'x-selection-exists-p))
474 ((string-match "fringe" (symbol-name symbol))
475 (fboundp 'define-fringe-bitmap))
476 ((equal "font-use-system-font" (symbol-name symbol))
477 (featurep 'system-font-setting))
478 ;; Conditioned on x-create-frame, because that's
479 ;; the condition for loadup.el to preload tool-bar.el.
480 ((string-match "tool-bar-" (symbol-name symbol))
481 (fboundp 'x-create-frame))
482 (t t))))
483 (if (not (boundp symbol))
484 ;; If variables are removed from C code, give an error here!
485 (and native-p
486 (message "Note, built-in variable `%S' not bound" symbol))
487 ;; Save the standard value, unless we already did.
488 (or (get symbol 'standard-value)
489 (put symbol 'standard-value (list standard)))
490 ;; We need these properties independent of whether cus-start is loaded.
491 (if (setq prop (memq :safe rest))
492 (put symbol 'safe-local-variable (cadr prop)))
493 (if (setq prop (memq :risky rest))
494 (put symbol 'risky-local-variable (cadr prop)))
495 (if (setq prop (memq :set rest))
496 (put symbol 'custom-set (cadr prop)))
497 ;; Note this is the _only_ initialize property we handle.
498 (if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay)
499 (push symbol custom-delayed-init-variables))
500 ;; If this is NOT while dumping Emacs, set up the rest of the
501 ;; customization info. This is the stuff that is not needed
502 ;; until someone does M-x customize etc.
503 (unless purify-flag
504 ;; Add it to the right group(s).
505 (if (listp group)
506 (dolist (g group)
507 (custom-add-to-group g symbol 'custom-variable))
508 (custom-add-to-group group symbol 'custom-variable))
509 ;; Set the type.
510 (put symbol 'custom-type type)
511 (put symbol 'custom-version version)
512 (while rest
513 (setq prop (car rest)
514 propval (cadr rest)
515 rest (nthcdr 2 rest))
516 (cond ((memq prop '(:risky :safe :set))) ; handled above
517 ((eq prop :tag)
518 (put symbol 'custom-tag propval))))))))
520 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
521 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
522 'custom-variable)
524 ;; Record cus-start as loaded if we have set up all the info that we can.
525 ;; Don't record it as loaded if we have only set up the standard values
526 ;; and safe/risky properties.
527 (unless purify-flag
528 (provide 'cus-start))
530 ;;; cus-start.el ends here