From 588c722f2209302fdea3a009e25da522e49e9bed Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 1 Nov 2001 07:00:07 +0000 Subject: [PATCH] (define-button-type): Make sure every user-defined button type has a supertype. --- lisp/ChangeLog | 5 +++++ lisp/button.el | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b9f79bfd49b..733e31bf774 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-11-01 Miles Bader + + * button.el (define-button-type): Make sure every user-defined + button type has a supertype. + 2001-10-31 Jason Rumney * international/mule-cmds.el (locale-language-names): Add chs and diff --git a/lisp/button.el b/lisp/button.el index aa9ade82ed1..ef0f3d11c65 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -121,12 +121,12 @@ In addition, the keyword argument :supertype may be used to specify a 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 @@ changes to a supertype are not reflected in its subtypes)." (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) -- 2.39.2