Subject: 29.0.50; single string in function body should act as doc string
From: Nicolas Graner <[email-masked]>
To: [email-masked]
Date: Fri, 04 Nov 2022 13:26:22 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

According to the Emacs lisp manual, node "Documentation Strings of Functions":

    You may wonder how the documentation string could be optional, since
    there are required components of the function that follow it (the
    body). Since evaluation of a string returns that string, without any
    side effects, it has no effect if it is not the last form in the
    body. Thus, in practice, there is no confusion between the first
    form of the body and the documentation string; if the only body form
    is a string then it serves both as the return value and as the
    documentation.

This last sentence is no longer true in 29.0.50, the single string is
not used as doc string:

(defun f () "foo")
⇒ f
(f)
⇒ "foo"
(documentation 'f)
⇒ nil
(emacs-version)
⇒ "GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
 of 2022-11-03"

Hope this helps,
Nicolas