diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-09 11:04:03 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-09 11:04:03 -0500 |
commit | 7561c01380aa3347901eeddd2d0a466cb29ebbd8 (patch) | |
tree | 1d1166b592dda2086fa81fa96f7648402c670a83 /lisp/emacs-lisp/cconv.el | |
parent | 40d8f83e53ba64355035da78967c994d09a7802d (diff) | |
download | emacs-7561c01380aa3347901eeddd2d0a466cb29ebbd8.tar.gz emacs-7561c01380aa3347901eeddd2d0a466cb29ebbd8.tar.bz2 emacs-7561c01380aa3347901eeddd2d0a466cb29ebbd8.zip |
* lisp/emacs-lisp/cconv.el: Don't confuse a string for a docstring
(cconv--convert-funcbody): Check there's something after a docstring.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-string-vs-docstring):
New corresponding test.
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r-- | lisp/emacs-lisp/cconv.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index bd0a3e87e64..68e930fa3f5 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -295,8 +295,9 @@ of converted forms." (if wrappers (let ((special-forms '())) ;; Keep special forms at the beginning of the body. - (while (or (stringp (car funcbody)) ;docstring. - (memq (car-safe (car funcbody)) '(interactive declare))) + (while (or (and (cdr funcbody) (stringp (car funcbody))) ;docstring. + (memq (car-safe (car funcbody)) + '(interactive declare :documentation))) (push (pop funcbody) special-forms)) (let ((body (macroexp-progn funcbody))) (dolist (wrapper wrappers) (setq body (funcall wrapper body))) |