diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2001-11-01 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * button.el (define-button-type): Make sure every user-defined | ||
| 4 | button type has a supertype. | ||
| 5 | |||
| 1 | 2001-10-31 Jason Rumney <jasonr@gnu.org> | 6 | 2001-10-31 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * international/mule-cmds.el (locale-language-names): Add chs and | 8 | * 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 | |||
| 121 | button-type from which NAME inherits its default property values | 121 | button-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 |
| 123 | changes to a supertype are not reflected in its subtypes)." | 123 | changes 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) |