Type checking for `define-widget'

* lisp/widget.el (define-widget): Check that documentation is a string
or nil; prevent wailing and gnashing of teeth when users forget to
pass a docstring and wonder why their properties don't work.
This commit is contained in:
Daniel Colascione 2015-03-14 16:32:04 -07:00
parent 3bf369928e
commit 554001dfa9
2 changed files with 7 additions and 0 deletions

View file

@ -1,5 +1,9 @@
2015-03-14 Daniel Colascione <dancol@dancol.org>
* widget.el (define-widget): Check that documentation is a string
or nil; prevent wailing and gnashing of teeth when users forget to
pass a docstring and wonder why their properties don't work.
* startup.el (command-line): Process "--no-x-resources".
2015-03-13 Kevin Ryde <user42_kevin@yahoo.com.au>

View file

@ -83,6 +83,9 @@ create identical widgets:
* (apply 'widget-create CLASS ARGS)
The third argument DOC is a documentation string for the widget."
;;
(unless (or (null doc) (stringp doc))
(error "widget documentation must be `nil' or a string."))
(put name 'widget-type (cons class args))
(put name 'widget-documentation (purecopy doc))
name)