* lisp/simple.el (function-documentation): Fix bug#59014

This commit is contained in:
Stefan Monnier 2022-11-04 11:59:51 -04:00
parent 5d6e919a90
commit 616aa23d8a

View file

@ -2647,10 +2647,7 @@ function as needed."
((or `(lambda ,_args . ,body) `(closure ,_env ,_args . ,body)
`(autoload ,_file . ,body))
(let ((doc (car body)))
(when (and (funcall docstring-p doc)
;; Handle a doc reference--but these never come last
;; in the function body, so reject them if they are last.
(or (cdr body) (eq 'autoload (car-safe function))))
(when (funcall docstring-p doc)
doc)))
(_ (signal 'invalid-function (list function))))))