From 616aa23d8a130a664a2ce3bb05f3518ce0f5a018 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Nov 2022 11:59:51 -0400 Subject: [PATCH] * lisp/simple.el (function-documentation): Fix bug#59014 --- lisp/simple.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index e804f717b01..5f676ea50de 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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)))))) -- 2.39.2