Commit 588c722f authored by Miles Bader's avatar Miles Bader
Browse files

(define-button-type): Make sure every user-defined button type has a supertype.

parent 1c7a4f72
2001-11-01 Miles Bader <miles@gnu.org>
* button.el (define-button-type): Make sure every user-defined
button type has a supertype.
2001-10-31 Jason Rumney <jasonr@gnu.org>
 
* international/mule-cmds.el (locale-language-names): Add chs and
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment