]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-edit.el
* lisp/progmodes/ruby-mode.el: Bump the version to 1.2.
[gnu-emacs] / lisp / cus-edit.el
index 4458bb7b56f1ce1e3bba5d4056ef26b5cb4254dc..8e06b16bd126ef3b8d97e09ef04b2f4ef60bde33 100644 (file)
   :group 'editing)
 
 (defgroup mode-line nil
-  "Content of the modeline."
+  "Contents of the mode line."
   :group 'environment)
 
 (defgroup editing-basics nil
@@ -526,7 +526,10 @@ WIDGET is the widget to apply the filter entries of MENU on."
   :type 'boolean)
 
 (defcustom custom-unlispify-remove-prefixes nil
-  "Non-nil means remove group prefixes from option names in buffer."
+  "Non-nil means remove group prefixes from option names in buffer.
+Discarding prefixes often leads to confusing names for options
+and faces in Customize buffers, so do not set this to a non-nil
+value unless you are sure you know what it does."
   :group 'custom-menu
   :group 'custom-buffer
   :type 'boolean)
@@ -1159,7 +1162,7 @@ Show the buffer in another window, but don't select it."
     (unless (eq symbol basevar)
       (message "`%s' is an alias for `%s'" symbol basevar))))
 
-(defvar customize-changed-options-previous-release "23.1"
+(defvar customize-changed-options-previous-release "24.1"
   "Version for `customize-changed-options' to refer back to by default.")
 
 ;; Packages will update this variable, so make it available.
@@ -1254,8 +1257,8 @@ that were added or redefined since that version."
     (if found
        (custom-buffer-create (custom-sort-items found t 'first)
                              "*Customize Changed Options*")
-      (error "No user option defaults have been changed since Emacs %s"
-            since-version))))
+      (user-error "No user option defaults have been changed since Emacs %s"
+                  since-version))))
 
 (defun customize-package-emacs-version (symbol package-version)
   "Return the Emacs version in which SYMBOL's meaning last changed.
@@ -1386,7 +1389,7 @@ suggest to customize that face, if it's customizable."
                                         (default-value symbol))))
                    (push (list symbol 'custom-variable) found)))))
     (if (not found)
-       (error "No rogue user options")
+       (user-error "No rogue user options")
       (custom-buffer-create (custom-sort-items found t nil)
                            "*Customize Rogue*"))))
 ;;;###autoload
@@ -1403,8 +1406,8 @@ suggest to customize that face, if it's customizable."
                         (get symbol 'saved-variable-comment))
                     (boundp symbol)
                     (push (list symbol 'custom-variable) found))))
-    (if (not found )
-       (error "No saved user options")
+    (if (not found)
+       (user-error "No saved user options")
       (custom-buffer-create (custom-sort-items found t nil)
                            "*Customize Saved*"))))
 
@@ -1541,7 +1544,7 @@ that option."
 This button will have a menu with all three reset operations."
   :type 'boolean
   :group 'custom-buffer
-  :version "24.2")
+  :version "24.3")
 
 (defcustom custom-buffer-verbose-help t
   "If non-nil, include explanatory text in the customization buffer."
@@ -1853,64 +1856,52 @@ item in another window.\n\n"))
   :group 'custom-buffer)
 
 (defface custom-invalid '((((class color))
-                          (:foreground "yellow1" :background "red1"))
-                         (t
-                          (:weight bold :slant italic :underline t)))
+                          :foreground "yellow1" :background "red1")
+                         (t :weight bold :slant italic :underline t))
   "Face used when the customize item is invalid."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-invalid-face 'custom-invalid "22.1")
 
 (defface custom-rogue '((((class color))
-                        (:foreground "pink" :background "black"))
-                       (t
-                        (:underline t)))
+                        :foreground "pink" :background "black")
+                       (t :underline t))
   "Face used when the customize item is not defined for customization."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-rogue-face 'custom-rogue "22.1")
 
 (defface custom-modified '((((min-colors 88) (class color))
-                           (:foreground "white" :background "blue1"))
+                           :foreground "white" :background "blue1")
                           (((class color))
-                           (:foreground "white" :background "blue"))
-                          (t
-                           (:slant italic :bold)))
+                           :foreground "white" :background "blue")
+                          (t :slant italic))
   "Face used when the customize item has been modified."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-modified-face 'custom-modified "22.1")
 
 (defface custom-set '((((min-colors 88) (class color))
-                      (:foreground "blue1" :background "white"))
+                      :foreground "blue1" :background "white")
                      (((class color))
-                      (:foreground "blue" :background "white"))
-                     (t
-                      (:slant italic)))
+                      :foreground "blue" :background "white")
+                     (t :slant italic))
   "Face used when the customize item has been set."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-set-face 'custom-set "22.1")
 
 (defface custom-changed '((((min-colors 88) (class color))
-                          (:foreground "white" :background "blue1"))
+                          :foreground "white" :background "blue1")
                          (((class color))
-                          (:foreground "white" :background "blue"))
-                         (t
-                          (:slant italic)))
+                          :foreground "white" :background "blue")
+                         (t :slant italic))
   "Face used when the customize item has been changed."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-changed-face 'custom-changed "22.1")
 
 (defface custom-themed '((((min-colors 88) (class color))
-                          (:foreground "white" :background "blue1"))
-                         (((class color))
-                          (:foreground "white" :background "blue"))
-                         (t
-                          (:slant italic)))
+                         :foreground "white" :background "blue1")
+                        (((class color))
+                         :foreground "white" :background "blue")
+                        (t :slant italic))
   "Face used when the customize item has been set by a theme."
   :group 'custom-magic-faces)
 
-(defface custom-saved '((t (:underline t)))
+(defface custom-saved '((t :underline t))
   "Face used when the customize item has been saved."
   :group 'custom-magic-faces)
-(define-obsolete-face-alias 'custom-saved-face 'custom-saved "22.1")
 
 (defconst custom-magic-alist
   '((nil "#" underline "\
@@ -2101,25 +2092,22 @@ and `face'."
 ;;; The `custom' Widget.
 
 (defface custom-button
-  '((((type x w32 ns) (class color))   ; Like default modeline
-     (:box (:line-width 2 :style released-button)
-          :background "lightgrey" :foreground "black"))
-    (t
-     nil))
+  '((((type x w32 ns) (class color))   ; Like default mode line
+     :box (:line-width 2 :style released-button)
+     :background "lightgrey" :foreground "black"))
   "Face for custom buffer buttons if `custom-raised-buttons' is non-nil."
   :version "21.1"
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-button-face 'custom-button "22.1")
 
 (defface custom-button-mouse
   '((((type x w32 ns) (class color))
-     (:box (:line-width 2 :style released-button)
-          :background "grey90" :foreground "black"))
+     :box (:line-width 2 :style released-button)
+     :background "grey90" :foreground "black")
     (t
      ;; This is for text terminals that support mouse, like GPM mouse
      ;; or the MS-DOS terminal: inverse-video makes the button stand
      ;; out on mouse-over.
-     (:inverse-video t)))
+     :inverse-video t))
   "Mouse face for custom buffer buttons if `custom-raised-buttons' is non-nil."
   :version "22.1"
   :group 'custom-faces)
@@ -2138,15 +2126,12 @@ and `face'."
 
 (defface custom-button-pressed
   '((((type x w32 ns) (class color))
-     (:box (:line-width 2 :style pressed-button)
-          :background "lightgrey" :foreground "black"))
-    (t
-     (:inverse-video t)))
+     :box (:line-width 2 :style pressed-button)
+     :background "lightgrey" :foreground "black")
+    (t :inverse-video t))
   "Face for pressed custom buttons if `custom-raised-buttons' is non-nil."
   :version "21.1"
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-button-pressed-face
-  'custom-button-pressed "22.1")
 
 (defface custom-button-pressed-unraised
   '((default :inherit custom-button-unraised)
@@ -2164,22 +2149,15 @@ and `face'."
 (defface custom-documentation '((t nil))
   "Face used for documentation strings in customization buffers."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-documentation-face
-  'custom-documentation "22.1")
-
-(defface custom-state '((((class color)
-                         (background dark))
-                        (:foreground "lime green"))
-                       (((class color)
-                         (background light))
-                        (:foreground "dark green"))
-                       (t nil))
+
+(defface custom-state '((((class color) (background dark))
+                        :foreground "lime green")
+                       (((class color) (background light))
+                        :foreground "dark green"))
   "Face used for State descriptions in the customize buffer."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-state-face 'custom-state "22.1")
 
-(defface custom-link
-  '((t :inherit link))
+(defface custom-link '((t :inherit link))
   "Face for links in customization buffers."
   :version "22.1"
   :group 'custom-faces)
@@ -2250,9 +2228,9 @@ and `face'."
             (setq widget nil)))))
   (widget-setup))
 
-(make-obsolete 'custom-show "this widget type is no longer supported." "24.1")
 (defun custom-show (widget value)
   "Non-nil if WIDGET should be shown with VALUE by default."
+  (declare (obsolete "this widget type is no longer supported." "24.1"))
   (let ((show (widget-get widget :custom-show)))
     (if (functionp show)
        (funcall show widget value)
@@ -2376,20 +2354,18 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
   "Face used for comments on variables or faces."
   :version "21.1"
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-comment-face 'custom-comment "22.1")
 
 ;; like font-lock-comment-face
 (defface custom-comment-tag
-  '((((class color) (background dark)) (:foreground "gray80"))
-    (((class color) (background light)) (:foreground "blue4"))
+  '((((class color) (background dark)) :foreground "gray80")
+    (((class color) (background light)) :foreground "blue4")
     (((class grayscale) (background light))
-     (:foreground "DimGray" :weight bold :slant italic))
+     :foreground "DimGray" :weight bold :slant italic)
     (((class grayscale) (background dark))
-     (:foreground "LightGray" :weight bold :slant italic))
-    (t (:weight bold)))
+     :foreground "LightGray" :weight bold :slant italic)
+    (t :weight bold))
   "Face used for the comment tag on variables or faces."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-comment-tag-face 'custom-comment-tag "22.1")
 
 (define-widget 'custom-comment 'string
   "User comment."
@@ -2428,26 +2404,19 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
 ;;; The `custom-variable' Widget.
 
 (defface custom-variable-tag
-  `((((class color)
-      (background dark))
-     (:foreground "light blue" :weight bold))
-    (((min-colors 88) (class color)
-      (background light))
-     (:foreground "blue1" :weight bold))
-    (((class color)
-      (background light))
-     (:foreground "blue" :weight bold))
-    (t (:weight bold)))
+  `((((class color) (background dark))
+     :foreground "light blue" :weight bold)
+    (((min-colors 88) (class color) (background light))
+     :foreground "blue1" :weight bold)
+    (((class color) (background light))
+     :foreground "blue" :weight bold)
+    (t :weight bold))
   "Face used for unpushable variable tags."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-variable-tag-face
-  'custom-variable-tag "22.1")
 
-(defface custom-variable-button '((t (:underline t :weight bold)))
+(defface custom-variable-button '((t :underline t :weight bold))
   "Face used for pushable variable tags."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-variable-button-face
-  'custom-variable-button "22.1")
 
 (defcustom custom-variable-default-form 'edit
   "Default form of displaying variable values."
@@ -2879,7 +2848,7 @@ Optional EVENT is the location for the menu."
         (comment (widget-value comment-widget))
         val)
     (cond ((eq state 'hidden)
-          (error "Cannot set hidden variable"))
+          (user-error "Cannot set hidden variable"))
          ((setq val (widget-apply child :validate))
           (goto-char (widget-get val :from))
           (error "%s" (widget-get val :error)))
@@ -2921,7 +2890,7 @@ Optional EVENT is the location for the menu."
         (comment (widget-value comment-widget))
         val)
     (cond ((eq state 'hidden)
-          (error "Cannot set hidden variable"))
+          (user-error "Cannot set hidden variable"))
          ((setq val (widget-apply child :validate))
           (goto-char (widget-get val :from))
           (error "Saving %s: %s" symbol (widget-get val :error)))
@@ -2995,7 +2964,7 @@ redraw the widget immediately."
   (let* ((symbol (widget-value widget)))
     (if (get symbol 'standard-value)
        (custom-variable-backup-value widget)
-      (error "No standard setting known for %S" symbol))
+      (user-error "No standard setting known for %S" symbol))
     (put symbol 'variable-comment nil)
     (put symbol 'customized-value nil)
     (put symbol 'customized-variable-comment nil)
@@ -3057,7 +3026,7 @@ to switch between two values."
          (condition-case nil
              (funcall set symbol (car value))
             (error nil)))
-      (error "No backup value for %s" symbol))
+      (user-error "No backup value for %s" symbol))
     (put symbol 'customized-value (list (custom-quote (car value))))
     (put symbol 'variable-comment comment)
     (put symbol 'customized-variable-comment comment)
@@ -3314,10 +3283,9 @@ Only match frames that support the specified face attributes.")
 ;;; The `custom-face' Widget.
 
 (defface custom-face-tag
-  `((t :inherit custom-variable-tag))
+  '((t :inherit custom-variable-tag))
   "Face used for face tags."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-face-tag-face 'custom-face-tag "22.1")
 
 (defcustom custom-face-default-form 'selected
   "Default form of displaying face definition."
@@ -3795,7 +3763,7 @@ redraw the widget immediately."
         (value (get symbol 'face-defface-spec))
         (comment-widget (widget-get widget :comment-widget)))
     (unless value
-      (error "No standard setting for this face"))
+      (user-error "No standard setting for this face"))
     (put symbol 'customized-face nil)
     (put symbol 'customized-face-comment nil)
     (custom-push-theme 'theme-face symbol 'user 'reset)
@@ -3932,37 +3900,24 @@ and so forth.  The remaining group tags are shown with `custom-group-tag'."
   :group 'custom-faces)
 
 (defface custom-group-tag-1
-  `((((class color)
-      (background dark))
-     (:foreground "pink" :weight bold :height 1.2 :inherit variable-pitch))
-    (((min-colors 88) (class color)
-      (background light))
-     (:foreground "red1" :weight bold :height 1.2 :inherit variable-pitch))
-    (((class color)
-      (background light))
-     (:foreground "red" :weight bold :height 1.2 :inherit variable-pitch))
-    (t (:weight bold)))
-  "Face used for group tags."
+  '((default :weight bold :height 1.2 :inherit variable-pitch)
+    (((class color) (background dark)) :foreground "pink")
+    (((min-colors 88) (class color) (background light)) :foreground "red1")
+    (((class color) (background light)) :foreground "red"))
+  "Face for group tags."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-group-tag-face-1 'custom-group-tag-1 "22.1")
 
 (defface custom-group-tag
-  `((((class color)
-      (background dark))
-     (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch))
-    (((min-colors 88) (class color)
-      (background light))
-     (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
-    (((class color)
-      (background light))
-     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
-    (t (:weight bold)))
-  "Face used for low level group tags."
+  '((default :weight bold :height 1.2 :inherit variable-pitch)
+    (((class color) (background dark)) :foreground "light blue")
+    (((min-colors 88) (class color) (background light)) :foreground "blue1")
+    (((class color) (background light)) :foreground "blue")
+    (t :weight bold))
+  "Face for low level group tags."
   :group 'custom-faces)
-(define-obsolete-face-alias 'custom-group-tag-face 'custom-group-tag "22.1")
 
 (defface custom-group-subtitle
-  `((t (:weight bold)))
+  '((t :weight bold))
   "Face for the \"Subgroups:\" subtitle in Custom buffers."
   :group 'custom-faces)
 
@@ -4414,7 +4369,7 @@ if only the first line of the docstring is shown."))
       ;; sense.
       (if no-error
          nil
-       (error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
+       (user-error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
     (file-chase-links (or custom-file user-init-file))))
 
 ;; If recentf-mode is non-nil, this is defined.
@@ -4825,6 +4780,7 @@ If several parents are listed, go to the first of them."
     (set (make-local-variable 'widget-link-suffix) ""))
   (setq show-trailing-whitespace nil))
 
+(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
 (define-derived-mode Custom-mode nil "Custom"
   "Major mode for editing customization buffers.
 
@@ -4867,26 +4823,9 @@ if that value is non-nil."
 
 (put 'Custom-mode 'mode-class 'special)
 
-;; backward-compatibility
-(defun custom-mode ()
-  "Non-interactive variant of `Custom-mode'."
-  (Custom-mode))
-(make-obsolete 'custom-mode 'Custom-mode "23.1")
-(put 'custom-mode 'mode-class 'special)
-(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
+(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1")
 
-(dolist (regexp
-        '("^No user option defaults have been changed since Emacs "
-          "^Invalid face:? "
-          "^No \\(?:customized\\|rogue\\|saved\\) user options"
-          "^No customizable items matching "
-          "^There are unset changes"
-          "^Cannot set hidden variable"
-          "^No \\(?:saved\\|backup\\) value for "
-          "^No standard setting known for "
-          "^No standard setting for this face"
-          "^Saving settings from \"emacs -q\" would overwrite existing customizations"))
-  (add-to-list 'debug-ignored-errors regexp))
+(add-to-list 'debug-ignored-errors "^Invalid face:? ")
 
 ;;; The End.