From: Daniel Colascione Date: Sat, 14 Mar 2015 23:32:04 +0000 (-0700) Subject: Type checking for `define-widget' X-Git-Tag: emacs-25.0.90~2564^2~162^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=554001dfa90be447dc0c71c596eb837d8e3b374b;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8da573ed2f7..5004924e9d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2015-03-14 Daniel Colascione + * 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 diff --git a/lisp/widget.el b/lisp/widget.el index f8faa0f379b..539f91e63a0 100644 --- a/lisp/widget.el +++ b/lisp/widget.el @@ -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)