unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graner <nicolas@graner.name>
To: 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 13:26:22 +0100	[thread overview]
Message-ID: <86fseyewi9.fsf@graner.name> (raw)

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





             reply	other threads:[~2022-11-04 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 12:26 Nicolas Graner [this message]
2022-11-04 12:55 ` bug#59014: 29.0.50; single string in function body should act as doc string Eli Zaretskii
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=86fseyewi9.fsf@graner.name \
    --to=nicolas@graner.name \
    --cc=59014@debbugs.gnu.org \
    /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).