From 7561c01380aa3347901eeddd2d0a466cb29ebbd8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 9 Mar 2021 11:04:03 -0500 Subject: * 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. --- lisp/emacs-lisp/cconv.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/cconv.el') 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))) -- cgit v1.2.3