From: Eli Zaretskii <eliz@gnu.org>
To: Nicolas Graner <nicolas@graner.name>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 59014@debbugs.gnu.org
Subject: bug#59014: 29.0.50; single string in function body should act as doc string
Date: Fri, 04 Nov 2022 14:55:54 +0200 [thread overview]
Message-ID: <838rkq6fqd.fsf@gnu.org> (raw)
In-Reply-To: <86fseyewi9.fsf@graner.name> (message from Nicolas Graner on Fri, 04 Nov 2022 13:26:22 +0100)
> From: Nicolas Graner <nicolas@graner.name>
> Date: Fri, 04 Nov 2022 13:26:22 +0100
>
> 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"
Thanks.
Stefan, this seems to be due to your changes in commit
39e8fd357dd0a1f3776c05eee2cc5be451686712. Specifically, the new
function-documentation returns nil in this case. Could you please
take a look at this?
next prev parent reply other threads:[~2022-11-04 12:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 12:26 bug#59014: 29.0.50; single string in function body should act as doc string Nicolas Graner
2022-11-04 12:55 ` Eli Zaretskii [this message]
2022-11-04 15:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 16:00 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 16:30 ` Nicolas Graner
2022-11-04 16:52 ` Eli Zaretskii
2022-11-04 17:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=838rkq6fqd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=59014@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=nicolas@graner.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).