]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-start.el
* lisp/epa-file.el (epa-file-select-keys): Revert to nil default.
[gnu-emacs] / lisp / cus-start.el
index d56d9d114bcfc3eff4babc91b396c4b697cf3d71..389716b35b95d4905e54d07853e70969c3af14e6 100644 (file)
@@ -1,17 +1,17 @@
 ;;; cus-start.el --- define customization properties of builtins
 ;;
-;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999-2011  Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: internal
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;
 
 ;;; Code:
 
-(let ((all '(;; abbrev.c
-            (abbrev-all-caps abbrev-mode boolean)
-            (pre-abbrev-expand-hook abbrev-mode hook)
-            ;; alloc.c
+;; Elements of this list have the form:
+;; SYMBOL GROUP TYPE VERSION REST...
+;; SYMBOL is the name of the variable.
+;; GROUP is the custom group to which it belongs (may also be a list
+;; of groups)
+;; TYPE is the defcustom :type.
+;; VERSION is the defcustom :version (or nil).
+;; REST is a set of :KEYWORD VALUE pairs.  Accepted :KEYWORDs are:
+;; :standard - standard value for SYMBOL (else use current value)
+;; :set - custom-set property
+;; :risky - risky-local-variable property
+;; :safe - safe-local-variable property
+;; :tag - custom-tag property
+(let ((all '(;; alloc.c
             (gc-cons-threshold alloc integer)
             (garbage-collection-messages alloc boolean)
             ;; buffer.c
             (mode-line-format mode-line sexp) ;Hard to do right.
-            (default-major-mode internal function)
-            (enable-multibyte-characters mule boolean)
+            (major-mode internal function)
             (case-fold-search matching boolean)
             (fill-column fill integer)
             (left-margin fill integer)
             (tab-width editing-basics integer)
             (ctl-arrow display boolean)
             (truncate-lines display boolean)
+            (word-wrap display boolean)
             (selective-display-ellipses display boolean)
             (indicate-empty-lines fringe boolean)
             (indicate-buffer-boundaries
@@ -98,7 +106,18 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (scroll-down-aggressively windows
                                       (choice (const :tag "off" nil) number)
                                       "21.1")
-            (line-spacing display (choice (const :tag "none" nil) integer))
+            (line-spacing display (choice (const :tag "none" nil) integer)
+                          "22.1")
+            (cursor-in-non-selected-windows
+             cursor boolean nil
+             :tag "Cursor In Non-selected Windows"
+             :set (lambda (symbol value)
+                    (set-default symbol value)
+                    (force-mode-line-update t)))
+            (transient-mark-mode editing-basics boolean nil
+                                 :standard (not noninteractive)
+                                 :initialize custom-initialize-delay
+                                 :set custom-set-minor-mode)
             ;; callint.c
             (mark-even-if-inactive editing-basics boolean)
             ;; callproc.c
@@ -106,6 +125,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (exec-path execute
                        (repeat (choice (const :tag "default directory" nil)
                                        (directory :format "%v"))))
+            ;; charset.c
+            (charset-map-path installation
+                              (repeat (directory :format "%v")))
             ;; coding.c
             (inhibit-eol-conversion mule boolean)
             (eol-mnemonic-undecided mule string)
@@ -128,7 +150,6 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
                             :match (lambda (widget value)
                                      (and value (not (functionp value)))))
                            (function :value ignore))))
-            (selection-coding-system mule coding-system)
             ;; dired.c
             (completion-ignored-extensions dired
                                            (repeat (string :format "%v")))
@@ -142,12 +163,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             ;; eval.c
             (max-specpdl-size limits integer)
             (max-lisp-eval-depth limits integer)
-            (stack-trace-on-error debug
-                                  (choice (const :tag "off")
-                                          (repeat :menu-tag "When"
-                                                  :value (nil)
-                                                  (symbol :format "%v"))
-                                          (const :tag "always" t)))
+            (max-mini-window-height limits
+                                    (choice (const :tag "quarter screen" nil)
+                                            number) "23.1")
             (debug-on-error debug
                             (choice (const :tag "off")
                                     (repeat :menu-tag "When"
@@ -161,9 +179,39 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
                                            :value (nil)
                                            (symbol :format "%v"))
                                    (const :tag "always" t)))
-            ;; fileio.c
-            (insert-default-directory minibuffer boolean)
-            (read-file-name-completion-ignore-case minibuffer boolean "22.1")
+             ;; fileio.c
+             (delete-by-moving-to-trash auto-save boolean "23.1")
+            (auto-save-visited-file-name auto-save boolean)
+            ;; filelock.c
+            (temporary-file-directory
+             ;; Darwin section added 24.1, does not seem worth :version bump.
+             files directory nil
+             :standard
+             (file-name-as-directory
+              ;; FIXME ? Should there be Ftemporary_file_directory to do this
+              ;; more robustly (cf set_local_socket in emacsclient.c).
+              ;; It could be used elsewhere, eg Fcall_process_region,
+              ;; server-socket-dir.  See bug#7135.
+              (cond ((memq system-type '(ms-dos windows-nt))
+                     (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
+                         "c:/temp"))
+                    ((eq system-type 'darwin)
+                     (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
+                         ;; See bug#7135.
+                         (let ((tmp (ignore-errors
+                                      (shell-command-to-string
+                                       "getconf DARWIN_USER_TEMP_DIR"))))
+                           (and (stringp tmp)
+                                (setq tmp (replace-regexp-in-string
+                                           "\n\\'" "" tmp))
+                                ;; Handles "getconf: Unrecognized variable..."
+                                (file-directory-p tmp)
+                                tmp))
+                         "/tmp"))
+                    (t
+                     (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
+                         "/tmp"))))
+             :initialize custom-initialize-delay)
             ;; fns.c
             (use-dialog-box menu boolean "21.1")
             (use-file-dialog menu boolean "22.1")
@@ -175,7 +223,16 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
                             (sexp :tag "Value"))))
             (mouse-highlight mouse (choice (const :tag "disabled" nil)
                                            (const :tag "always shown" t)
-                                           (other :tag "hidden by keypress" 1)))
+                                           (other :tag "hidden by keypress" 1))
+                             "22.1")
+            (make-pointer-invisible mouse boolean "23.2")
+            (menu-bar-mode frames boolean nil
+                           ;; FIXME?
+;                          :initialize custom-initialize-default
+                           :set custom-set-minor-mode)
+            (tool-bar-mode (frames mouse) boolean nil
+;                          :initialize custom-initialize-default
+                           :set custom-set-minor-mode)
             ;; fringe.c
             (overflow-newline-into-fringe fringe boolean)
             ;; indent.c
@@ -189,50 +246,24 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (polling-period keyboard integer)
             (double-click-time mouse (restricted-sexp
                                       :match-alternatives (integerp 'nil 't)))
-            (double-click-fuzz mouse integer)
+            (double-click-fuzz mouse integer "22.1")
             (inhibit-local-menu-bar-menus menu boolean)
             (help-char keyboard character)
             (help-event-list keyboard (repeat (sexp :format "%v")))
             (menu-prompting menu boolean)
+            (select-active-regions killing
+                                   (choice (const :tag "always" t)
+                                           (const :tag "only shift-selection or mouse-drag" only)
+                                           (const :tag "off" nil))
+                                   "24.1")
             (suggest-key-bindings keyboard (choice (const :tag "off" nil)
                                                    (integer :tag "time" 2)
                                                    (other :tag "on")))
-            ;; macselect.c
-            (mac-dnd-known-types mac (repeat string) "22.1")
-            ;; macterm.c
-            (mac-control-modifier mac (choice (const :tag "No modifier" nil)
-                                              (const control) (const meta)
-                                              (const alt) (const hyper)
-                                              (const super)) "22.1")
-            (mac-command-modifier mac (choice (const :tag "No modifier" nil)
-                                              (const control) (const meta)
-                                              (const alt) (const hyper)
-                                              (const super)) "22.1")
-            (mac-option-modifier mac (choice (const :tag "No modifier (work as option)" nil)
-                                             (const control) (const meta)
-                                             (const alt) (const hyper)
-                                             (const super)) "22.1")
-            (mac-function-modifier mac
-                                   (choice (const :tag "No modifier (work as function)" nil)
-                                           (const control) (const meta)
-                                           (const alt) (const hyper)
-                                           (const super)) "22.1")
-            (mac-emulate-three-button-mouse mac
-                                            (choice (const :tag "No emulation" nil)
-                                                    (const :tag "Option->2, Command->3" t)
-                                                    (const :tag "Command->2, Option->3" reverse))
-                                   "22.1")
-            (mac-wheel-button-is-mouse-2 mac boolean "22.1")
-            (mac-pass-command-to-system mac boolean "22.1")
-            (mac-pass-control-to-system mac boolean "22.1")
-            (mac-allow-anti-aliasing mac boolean "22.1")
-            (mac-ts-script-language-on-focus mac
-                                             (choice (const :tag "System default behavior" nil)
-                                                     (const :tag "Restore to script/language used in the last focus frame" t)
-                                                     (cons :tag "Specify script/language"
-                                                           (integer :tag "Script code")
-                                                           (integer :tag "Language code")))
-                                             "22.1")
+             (debug-on-event debug
+                             (choice (const :tag "None" nil)
+                                     (const :tag "When sent SIGUSR1" sigusr1)
+                                     (const :tag "When sent SIGUSR2" sigusr2))
+                             "24.1")
 
 ;; This is not good news because it will use the wrong
 ;; version-specific directories when you upgrade.  We need
@@ -244,12 +275,13 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
 ;;;                                    (const :tag " current dir" nil)
 ;;;                                    (directory :format "%v"))))
             ;; minibuf.c
-            (completion-auto-help minibuffer boolean)
             (enable-recursive-minibuffers minibuffer boolean)
             (history-length minibuffer
-                            (choice (const :tag "Infinite" t)
-                                    integer))
-            (history-delete-duplicates minibuffer boolean)
+                            (choice (const :tag "Infinite" t) integer)
+                            "22.1")
+            (history-delete-duplicates minibuffer boolean "22.1")
+            (read-buffer-completion-ignore-case minibuffer boolean "23.1")
+
             (minibuffer-prompt-properties
              minibuffer
              (list
@@ -279,6 +311,57 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
                                           function))
             ;; msdos.c
             (dos-unsupported-char-glyph display integer)
+            ;; nsterm.m
+            (ns-control-modifier
+             ns
+             (choice (const :tag "No modifier" nil)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "23.1")
+            (ns-right-control-modifier
+             ns
+             (choice (const :tag "No modifier (work as control)" none)
+                     (const :tag "Use the value of ns-control-modifier"
+                            left)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "24.0")
+            (ns-command-modifier
+             ns
+             (choice (const :tag "No modifier" nil)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "23.1")
+            (ns-right-command-modifier
+             ns
+             (choice (const :tag "No modifier (work as command)" none)
+                     (const :tag "Use the value of ns-command-modifier"
+                            left)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "24.0")
+            (ns-alternate-modifier
+             ns
+             (choice (const :tag "No modifier (work as alternate/option)" none)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "23.1")
+            (ns-right-alternate-modifier
+             ns
+             (choice (const :tag "No modifier (work as alternate/option)" none)
+                     (const :tag "Use the value of ns-alternate-modifier"
+                            left)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "23.3")
+            (ns-function-modifier
+             ns
+             (choice (const :tag "No modifier (work as function)" none)
+                     (const control) (const meta)
+                     (const alt) (const hyper)
+                     (const super)) "23.1")
+            (ns-antialias-text ns boolean "23.1")
+            (ns-auto-hide-menu-bar ns boolean "24.0")
             ;; process.c
             (delete-exited-processes processes-basics boolean)
             ;; syntax.c
@@ -304,63 +387,34 @@ since it could result in memory overflow and make Emacs crash."
                               "22.1")
             ;; window.c
             (temp-buffer-show-function windows (choice (const nil) function))
-            (display-buffer-function windows (choice (const nil) function))
-            (pop-up-frames frames boolean)
-            (pop-up-frame-function frames function)
-            (special-display-buffer-names
-             frames
-             (repeat (choice :tag "Buffer"
-                             :value ""
-                             (string :format "%v")
-                             (cons :tag "With attributes"
-                                   :format "%v"
-                                   :value ("" . nil)
-                                   (string :format "%v")
-                                   (repeat :tag "Attributes"
-                                           (cons :format "%v"
-                                                 (symbol :tag "Parameter")
-                                                 (sexp :tag "Value")))))))
-            (special-display-regexps
-             frames
-             (repeat (choice :tag "Buffer"
-                             :value ""
-                             (regexp :format "%v")
-                             (cons :tag "With attributes"
-                                   :format "%v"
-                                   :value ("" . nil)
-                                   (regexp :format "%v")
-                                   (repeat :tag "Attributes"
-                                           (cons :format "%v"
-                                                 (symbol :tag "Parameter")
-                                                 (sexp :tag "Value")))))))
-            (special-display-function frames function)
-            (same-window-buffer-names windows (repeat (string :format "%v")))
-            (same-window-regexps windows (repeat (regexp :format "%v")))
-            (pop-up-windows windows boolean)
-            (even-window-heights windows boolean)
             (next-screen-context-lines windows integer)
-            (split-height-threshold windows integer)
-            (window-min-height windows integer)
-            (window-min-width windows integer)
             (scroll-preserve-screen-position
              windows (choice
                       (const :tag "Off (nil)" :value nil)
                       (const :tag "Full screen (t)" :value t)
-                      (other :tag "Always" 1)))
-            (display-buffer-reuse-frames windows boolean "21.1")
+                      (other :tag "Always" 1)) "22.1")
+            (recenter-redisplay
+             windows (choice
+                      (const :tag "Never (nil)" :value nil)
+                      (const :tag "Only on ttys" :value tty)
+                      (other :tag "Always" t)) "23.1")
+            (window-splits windows boolean "24.1")
+            (window-nest windows boolean "24.1")
             ;; xdisp.c
+            (show-trailing-whitespace whitespace-faces boolean nil
+                                      :safe booleanp)
             (scroll-step windows integer)
             (scroll-conservatively windows integer)
             (scroll-margin windows integer)
             (hscroll-margin windows integer "22.1")
             (hscroll-step windows number "22.1")
-            (truncate-partial-width-windows display boolean)
+            (truncate-partial-width-windows display boolean "23.1")
             (mode-line-inverse-video mode-line boolean)
             (mode-line-in-non-selected-windows mode-line boolean "22.1")
             (line-number-display-limit display
                                        (choice integer
                                                (const :tag "No limit" nil)))
-            (line-number-display-limit-width display integer)
+            (line-number-display-limit-width display integer "22.1")
             (highlight-nonselected-windows display boolean)
             (message-log-max debug (choice (const :tag "Disable" nil)
                                            (integer :menu-tag "lines"
@@ -369,13 +423,27 @@ since it could result in memory overflow and make Emacs crash."
             (unibyte-display-via-language-environment mule boolean)
             (blink-cursor-alist cursor alist "22.1")
             (overline-margin display integer "22.1")
+            (underline-minimum-offset display integer "23.1")
              (mouse-autoselect-window
              display (choice
                       (const :tag "Off (nil)" :value nil)
                       (const :tag "Immediate" :value t)
                       (number :tag "Delay by secs" :value 0.5)) "22.1")
+             (tool-bar-style
+             frames (choice
+                     (const :tag "Images" :value image)
+                     (const :tag "Text" :value text)
+                     (const :tag "Both" :value both)
+                     (const :tag "Both-horiz" :value both-horiz)
+                     (const :tag "Text-image-horiz" :value text-image-horiz)
+                     (const :tag "System default" :value nil)) "23.3")
+             (tool-bar-max-label-size frames integer "23.3")
+            (auto-hscroll-mode scrolling boolean "21.1")
+            (display-hourglass cursor boolean)
+            (hourglass-delay cursor number)
+
             ;; xfaces.c
-            (scalable-fonts-allowed display boolean)
+            (scalable-fonts-allowed display boolean "22.1")
             ;; xfns.c
             (x-bitmap-file-path installation
                                 (repeat (directory :format "%v")))
@@ -383,11 +451,14 @@ since it could result in memory overflow and make Emacs crash."
             (x-gtk-show-hidden-files menu boolean "22.1")
             (x-gtk-file-dialog-help-text menu boolean "22.1")
             (x-gtk-whole-detached-tool-bar x boolean "22.1")
+            (x-gtk-use-system-tooltips tooltip boolean "23.3")
             ;; xterm.c
             (x-use-underline-position-properties display boolean "22.1")
             (x-underline-at-descent-line display boolean "22.1")
-            (x-stretch-cursor display boolean "21.1")))
-      this symbol group type standard version native-p
+            (x-stretch-cursor display boolean "21.1")
+            ;; xsettings.c
+            (font-use-system-font font-selection boolean "23.2")))
+      this symbol group type standard version native-p rest prop propval
       ;; This function turns a value
       ;; into an expression which produces that value.
       (quoter (lambda (sexp)
@@ -406,12 +477,13 @@ since it could result in memory overflow and make Emacs crash."
          group (nth 1 this)
          type (nth 2 this)
          version (nth 3 this)
+         rest (nthcdr 4 this)
          ;; If we did not specify any standard value expression above,
          ;; use the current value as the standard value.
-         standard (if (nthcdr 4 this)
-                      (nth 4 this)
-                    (when (default-boundp symbol)
-                      (funcall quoter (default-value symbol))))
+         standard (if (setq prop (memq :standard rest))
+                      (cadr prop)
+                    (if (default-boundp symbol)
+                        (funcall quoter (default-value symbol))))
          ;; Don't complain about missing variables which are
          ;; irrelevant to this platform.
          native-p (save-match-data
@@ -420,20 +492,22 @@ since it could result in memory overflow and make Emacs crash."
                       (eq system-type 'ms-dos))
                      ((string-match "\\`w32-" (symbol-name symbol))
                       (eq system-type 'windows-nt))
-                     ((string-match "\\`mac-" (symbol-name symbol))
-                      (eq window-system 'mac))
+                     ((string-match "\\`ns-" (symbol-name symbol))
+                      (featurep 'ns))
                      ((string-match "\\`x-.*gtk" (symbol-name symbol))
-                      (or (boundp 'gtk)
-                          (and window-system
-                               (not (eq window-system 'pc))
-                               (not (eq window-system 'mac))
-                               (not (eq system-type 'windows-nt)))))
+                      (featurep 'gtk))
                      ((string-match "\\`x-" (symbol-name symbol))
                       (fboundp 'x-create-frame))
                      ((string-match "selection" (symbol-name symbol))
                       (fboundp 'x-selection-exists-p))
                      ((string-match "fringe" (symbol-name symbol))
                       (fboundp 'define-fringe-bitmap))
+                     ((equal "font-use-system-font" (symbol-name symbol))
+                      (featurep 'system-font-setting))
+                     ;; Conditioned on x-create-frame, because that's
+                     ;; the condition for loadup.el to preload tool-bar.el.
+                     ((string-match "tool-bar-" (symbol-name symbol))
+                      (fboundp 'x-create-frame))
                      (t t))))
     (if (not (boundp symbol))
        ;; If variables are removed from C code, give an error here!
@@ -442,29 +516,44 @@ since it could result in memory overflow and make Emacs crash."
       ;; Save the standard value, unless we already did.
       (or (get symbol 'standard-value)
          (put symbol 'standard-value (list standard)))
-      ;; If this is NOT while dumping Emacs,
-      ;; set up the rest of the customization info.
+      ;; We need these properties independent of whether cus-start is loaded.
+      (if (setq prop (memq :safe rest))
+         (put symbol 'safe-local-variable (cadr prop)))
+      (if (setq prop (memq :risky rest))
+         (put symbol 'risky-local-variable (cadr prop)))
+      (if (setq prop (memq :set rest))
+         (put symbol 'custom-set (cadr prop)))
+      ;; Note this is the _only_ initialize property we handle.
+      (if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay)
+         (push symbol custom-delayed-init-variables))
+      ;; If this is NOT while dumping Emacs, set up the rest of the
+      ;; customization info.  This is the stuff that is not needed
+      ;; until someone does M-x customize etc.
       (unless purify-flag
-       ;; Add it to the right group.
-       (custom-add-to-group group symbol 'custom-variable)
+       ;; Add it to the right group(s).
+       (if (listp group)
+           (dolist (g group)
+             (custom-add-to-group g symbol 'custom-variable))
+         (custom-add-to-group group symbol 'custom-variable))
        ;; Set the type.
        (put symbol 'custom-type type)
-       (put symbol 'custom-version version)))))
+       (if version (put symbol 'custom-version version))
+       (while rest
+         (setq prop (car rest)
+               propval (cadr rest)
+               rest (nthcdr 2 rest))
+         (cond ((memq prop '(:standard :risky :safe :set))) ; handled above
+               ((eq prop :tag)
+                (put symbol 'custom-tag propval))))))))
 
 (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable)
 (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start
                     'custom-variable)
-(put 'selection-coding-system 'custom-set
-     (lambda (symbol value)
-       (set-selection-coding-system value)
-       (set symbol value)))
 
-;; Record cus-start as loaded
-;; if we have set up all the info that we can set up.
-;; Don't record cus-start as loaded
-;; if we have set up only the standard values.
+;; Record cus-start as loaded if we have set up all the info that we can.
+;; Don't record it as loaded if we have only set up the standard values
+;; and safe/risky properties.
 (unless purify-flag
   (provide 'cus-start))
 
-;;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60
 ;;; cus-start.el ends here