aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/button.el
diff options
context:
space:
mode:
authorMiles Bader2001-11-01 07:00:07 +0000
committerMiles Bader2001-11-01 07:00:07 +0000
commit588c722f2209302fdea3a009e25da522e49e9bed (patch)
tree6b59be603d9d87e078ff6eaaebbcc26b1b2d6b81 /lisp/button.el
parent1c7a4f723f3d5a07cd7381a345681c5afb341130 (diff)
downloademacs-588c722f2209302fdea3a009e25da522e49e9bed.tar.gz
emacs-588c722f2209302fdea3a009e25da522e49e9bed.zip
(define-button-type): Make sure every user-defined button type has a supertype.
Diffstat (limited to 'lisp/button.el')
-rw-r--r--lisp/button.el13
1 files changed, 8 insertions, 5 deletions
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
121button-type from which NAME inherits its default property values 121button-type from which NAME inherits its default property values
122\(however, the inheritance happens only when NAME is defined; subsequent 122\(however, the inheritance happens only when NAME is defined; subsequent
123changes to a supertype are not reflected in its subtypes)." 123changes to a supertype are not reflected in its subtypes)."
124 (let* ((catsym (make-symbol (concat (symbol-name name) "-button"))) 124 (let ((catsym (make-symbol (concat (symbol-name name) "-button")))
125 (supertype 125 (super-catsym
126 (button-category-symbol
126 (or (plist-get properties 'supertype) 127 (or (plist-get properties 'supertype)
127 (plist-get properties :supertype))) 128 (plist-get properties :supertype)
128 (super-catsym 129 'button))))
129 (if supertype (button-category-symbol supertype) 'default-button)))
130 ;; Provide a link so that it's easy to find the real symbol. 130 ;; Provide a link so that it's easy to find the real symbol.
131 (put name 'button-category-symbol catsym) 131 (put name 'button-category-symbol catsym)
132 ;; Initialize NAME's properties using the global defaults. 132 ;; Initialize NAME's properties using the global defaults.
@@ -142,6 +142,9 @@ changes to a supertype are not reflected in its subtypes)."
142 (when (eq prop :supertype) 142 (when (eq prop :supertype)
143 (setq prop 'supertype)) 143 (setq prop 'supertype))
144 (put catsym prop (pop properties)))) 144 (put catsym prop (pop properties))))
145 ;; Make sure there's a `supertype' property
146 (unless (get catsym 'supertype)
147 (put catsym 'supertype 'button))
145 name)) 148 name))
146 149
147(defun button-type-put (type prop val) 150(defun button-type-put (type prop val)