From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59014@debbugs.gnu.org, Nicolas Graner <nicolas@graner.name>
Subject: bug#59014: 29.0.50; single string in function body should act as doc string
Date: Fri, 04 Nov 2022 11:14:55 -0400 [thread overview]
Message-ID: <jwv7d0awy66.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <838rkq6fqd.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Nov 2022 14:55:54 +0200")
>> 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.
Boy, I should (re)read this manual more regularly. I was convinced the
intended behavior was to treat (defun f () "foo") as a function with no
docstring (as witnessed in the resulting behavior I implemented).
> 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?
Will do,
Stefan
next prev parent reply other threads:[~2022-11-04 15:14 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
2022-11-04 15:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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=jwv7d0awy66.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=59014@debbugs.gnu.org \
--cc=eliz@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).