;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
;;
-;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: FSF
:group 'environment)
(defgroup hardware nil
- "Support for interfacing with exotic hardware."
+ "Support for interfacing with miscellaneous hardware."
:group 'environment)
(defgroup terminals nil
:group 'environment)
(defgroup data nil
- "Support editing files of data."
+ "Support for editing files of data."
:group 'emacs)
(defgroup files nil
- "Support editing files."
+ "Support for editing files."
:group 'emacs)
(defgroup wp nil
(const :tag "none" nil))
:group 'custom-menu)
-;;;###autoload (add-hook 'same-window-regexps "\\`\\*Customiz.*\\*\\'")
+;;;###autoload (add-hook 'same-window-regexps (purecopy "\\`\\*Customiz.*\\*\\'"))
(defun custom-sort-items (items sort-alphabetically order-groups)
"Return a sorted copy of ITEMS.
(unless (eq symbol basevar)
(message "`%s' is an alias for `%s'" symbol basevar))))
-(defvar customize-changed-options-previous-release "21.1"
+(defvar customize-changed-options-previous-release "22.1"
"Version for `customize-changed-options' to refer back to by default.")
;; Packages will update this variable, so make it available.
(:weight bold :slant italic :underline t)))
"Face used when the customize item is invalid."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-invalid-face 'face-alias 'custom-invalid)
+(define-obsolete-face-alias 'custom-invalid-face 'custom-invalid "22.1")
(defface custom-rogue '((((class color))
(:foreground "pink" :background "black"))
(:underline t)))
"Face used when the customize item is not defined for customization."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-rogue-face 'face-alias 'custom-rogue)
+(define-obsolete-face-alias 'custom-rogue-face 'custom-rogue "22.1")
(defface custom-modified '((((min-colors 88) (class color))
(:foreground "white" :background "blue1"))
(:slant italic :bold)))
"Face used when the customize item has been modified."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-modified-face 'face-alias 'custom-modified)
+(define-obsolete-face-alias 'custom-modified-face 'custom-modified "22.1")
(defface custom-set '((((min-colors 88) (class color))
(:foreground "blue1" :background "white"))
(:slant italic)))
"Face used when the customize item has been set."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-set-face 'face-alias 'custom-set)
+(define-obsolete-face-alias 'custom-set-face 'custom-set "22.1")
(defface custom-changed '((((min-colors 88) (class color))
(:foreground "white" :background "blue1"))
(:slant italic)))
"Face used when the customize item has been changed."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-changed-face 'face-alias 'custom-changed)
+(define-obsolete-face-alias 'custom-changed-face 'custom-changed "22.1")
(defface custom-themed '((((min-colors 88) (class color))
(:foreground "white" :background "blue1"))
(defface custom-saved '((t (:underline t)))
"Face used when the customize item has been saved."
:group 'custom-magic-faces)
-;; backward-compatibility alias
-(put 'custom-saved-face 'face-alias 'custom-saved)
+(define-obsolete-face-alias 'custom-saved-face 'custom-saved "22.1")
(defconst custom-magic-alist
'((nil "#" underline "\
"Face for custom buffer buttons if `custom-raised-buttons' is non-nil."
:version "21.1"
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-button-face 'face-alias 'custom-button)
+(define-obsolete-face-alias 'custom-button-face 'custom-button "22.1")
(defface custom-button-mouse
'((((type x w32 ns) (class color))
"Face for pressed custom buttons if `custom-raised-buttons' is non-nil."
:version "21.1"
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-button-pressed-face 'face-alias 'custom-button-pressed)
+(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)
-;; backward-compatibility alias
-(put 'custom-documentation-face 'face-alias 'custom-documentation)
+(define-obsolete-face-alias 'custom-documentation-face
+ 'custom-documentation "22.1")
(defface custom-state '((((class color)
(background dark))
(t nil))
"Face used for State descriptions in the customize buffer."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-state-face 'face-alias 'custom-state)
+(define-obsolete-face-alias 'custom-state-face 'custom-state "22.1")
(defface custom-link
'((t :inherit link))
(when (and (>= pos from) (<= pos to))
(condition-case nil
(progn
- (if (> column 0)
- (goto-line line)
- (goto-line (1+ line)))
+ (goto-char (point-min))
+ (forward-line (if (> column 0)
+ (1- line)
+ line))
(move-to-column column))
(error nil)))))
"Face used for comments on variables or faces."
:version "21.1"
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-comment-face 'face-alias 'custom-comment)
+(define-obsolete-face-alias 'custom-comment-face 'custom-comment "22.1")
;; like font-lock-comment-face
(defface custom-comment-tag
(t (:weight bold)))
"Face used for the comment tag on variables or faces."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-comment-tag-face 'face-alias 'custom-comment-tag)
+(define-obsolete-face-alias 'custom-comment-tag-face 'custom-comment-tag "22.1")
(define-widget 'custom-comment 'string
"User comment."
(t (:weight bold)))
"Face used for unpushable variable tags."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-variable-tag-face 'face-alias 'custom-variable-tag)
+(define-obsolete-face-alias 'custom-variable-tag-face
+ 'custom-variable-tag "22.1")
(defface custom-variable-button '((t (:underline t :weight bold)))
"Face used for pushable variable tags."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-variable-button-face 'face-alias 'custom-variable-button)
+(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."
`((t :inherit custom-variable-tag))
"Face used for face tags."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-face-tag-face 'face-alias 'custom-face-tag)
+(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."
(t (:weight bold)))
"Face used for group tags."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-group-tag-face-1 'face-alias 'custom-group-tag-1)
+(define-obsolete-face-alias 'custom-group-tag-face-1 'custom-group-tag-1 "22.1")
(defface custom-group-tag
`((((class color)
(t (:weight bold)))
"Face used for low level group tags."
:group 'custom-faces)
-;; backward-compatibility alias
-(put 'custom-group-tag-face 'face-alias 'custom-group-tag)
+(define-obsolete-face-alias 'custom-group-tag-face 'custom-group-tag "22.1")
(define-widget 'custom-group 'custom
"Customize group."
(symbol (widget-value widget))
(members (custom-group-members symbol
(and (eq custom-buffer-style 'tree)
- custom-browse-only-groups))))
+ custom-browse-only-groups)))
+ (doc (widget-docstring widget)))
(cond ((and (eq custom-buffer-style 'tree)
(eq state 'hidden)
(or members (custom-unloaded-widget-p widget)))
(let ((start (point)))
(insert tag " group: ")
(widget-specify-sample widget start (point)))
- (insert (widget-docstring widget))
+ (cond
+ ((not doc)
+ (insert " Group definition missing. "))
+ ((< (length doc) 50)
+ (insert doc)))
;; Create visibility indicator.
(unless (eq custom-buffer-style 'links)
(insert "--------")
;; Update buttons.
(widget-put widget :buttons buttons)
;; Insert documentation.
- (widget-add-documentation-string-button
- widget :visibility-widget 'custom-visibility)
+ (when (and doc (>= (length doc) 50))
+ (widget-add-documentation-string-button
+ widget :visibility-widget 'custom-visibility))
;; Parent groups.
(if nil ;;; This should test that the buffer
\\<widget-keymap>\
Move to next button, link or editable field. \\[widget-forward]
-Move to previous button, link or editable field. \\[advertised-widget-backward]
+Move to previous button, link or editable field. \\[widget-backward]
\\<custom-field-keymap>\
Complete content of editable text field. \\[widget-complete]
\\<custom-mode-map>\