Mercurial > emacs
changeset 40595:3ba2b666d7e1
(define-button-type): Make sure every user-defined button type has a supertype.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 01 Nov 2001 06:59:32 +0000 |
parents | 171532c543b3 |
children | 6187d3d3a28a |
files | lisp/button.el |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/button.el Thu Nov 01 06:26:56 2001 +0000 +++ b/lisp/button.el Thu Nov 01 06:59:32 2001 +0000 @@ -121,12 +121,12 @@ button-type from which NAME inherits its default property values \(however, the inheritance happens only when NAME is defined; subsequent changes to a supertype are not reflected in its subtypes)." - (let* ((catsym (make-symbol (concat (symbol-name name) "-button"))) - (supertype + (let ((catsym (make-symbol (concat (symbol-name name) "-button"))) + (super-catsym + (button-category-symbol (or (plist-get properties 'supertype) - (plist-get properties :supertype))) - (super-catsym - (if supertype (button-category-symbol supertype) 'default-button))) + (plist-get properties :supertype) + 'button)))) ;; Provide a link so that it's easy to find the real symbol. (put name 'button-category-symbol catsym) ;; Initialize NAME's properties using the global defaults. @@ -142,6 +142,9 @@ (when (eq prop :supertype) (setq prop 'supertype)) (put catsym prop (pop properties)))) + ;; Make sure there's a `supertype' property + (unless (get catsym 'supertype) + (put catsym 'supertype 'button)) name)) (defun button-type-put (type prop val)