;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
;;
-;; Copyright (C) 1996-1997, 1999-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 1999-2012 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: FSF
:group 'editing)
(defgroup mode-line nil
- "Content of the modeline."
+ "Contents of the mode line."
:group 'environment)
(defgroup editing-basics nil
(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.
(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.
(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
(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*"))))
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."
: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 "\
;;; 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)
(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)
(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)
"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."
;;; 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."
"Return documentation of VARIABLE for use in Custom buffer.
Normally just return the docstring. But if VARIABLE automatically
becomes buffer local when set, append a message to that effect."
- (if (and (local-variable-if-set-p variable)
- (or (not (local-variable-p variable))
- (with-temp-buffer
- (local-variable-if-set-p variable))))
- (concat (documentation-property variable 'variable-documentation)
+ (format "%s%s" (documentation-property variable 'variable-documentation)
+ (if (and (local-variable-if-set-p variable)
+ (or (not (local-variable-p variable))
+ (with-temp-buffer
+ (local-variable-if-set-p variable))))
"\n
This variable automatically becomes buffer-local when set outside Custom.
-However, setting it through Custom sets the default value.")
- (documentation-property variable 'variable-documentation)))
+However, setting it through Custom sets the default value."
+ "")))
(define-widget 'custom-variable 'custom
"A widget for displaying a Custom variable.
(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)))
(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)))
(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)
(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)
;;; 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."
(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)
: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)
;; 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.
(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.
(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")
-(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.