From: Stefan Kangas <stefankangas@gmail.com>
To: "T.V Raman" <raman@google.com>
Cc: emacs-devel@gnu.org, ohwoeowho@gmail.com
Subject: Re: bytecomp: doc string wider than 80 spurious warnings are back
Date: Thu, 28 Sep 2023 00:38:54 -0700 [thread overview]
Message-ID: <CADwFkm=ALqvYhOorFGpftGYqraVCgsB0Cn9yEXSjskzYJCzvtg@mail.gmail.com> (raw)
In-Reply-To: <25876.19565.180274.795481@retriever.mtv.corp.google.com>
"T.V Raman" <raman@google.com> writes:
> Hope it gets fixed upstream in Hydra. But stepping back a level:
>
> 1. Byte Compiler warnings are really useful when developing in Emacs
> Lisp.
> 2. But they lose their value if the byte compiler gets noisy
No disagreement there.
> -- in
> this case I think this warning qualifies as noise because:
>
> A. The developer who is hit with this warning can do nothing
> about it
> B. It obscures more useful warnings
>
A typical case looks like this:
(defmacro foo (name)
`(defun bar ()
,(format "foo %s." name)))
If someone passes in a string NAME longer than 80 characters, that will
generate a warning. It is the responsibility of whoever writes a macro
to ensure it doesn't generate long docstrings by properly wrapping it.
The same is true for any byte-compiler warning.
In core we use `internal--format-docstring-line' for this, which means
that fixed code for the above would look like this:
(defmacro foo (name)
`(defun bar ()
,(internal--format-docstring-line
(format "foo %s." name))))
I don't think there's anything we can do about macros in third-party
packages, unfortunately. Perhaps `internal--format-docstring-line' is
useful enough not to be marked internal, though? I'm not sure.
> And by the way when this was fixed a few months ago, it
> ws fixed in the Emacs tree.
But that warning was due to a macro in our tree, right?
next prev parent reply other threads:[~2023-09-28 7:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 23:11 bytecomp: doc string wider than 80 spurious warnings are back T.V Raman
2023-09-26 1:55 ` Stefan Kangas
2023-09-26 13:59 ` T.V Raman
2023-09-27 11:22 ` Stefan Kangas
2023-09-27 15:38 ` T.V Raman
2023-09-27 16:16 ` Emanuel Berg
2023-09-27 19:56 ` T.V Raman
2023-09-27 20:16 ` Emanuel Berg
2023-09-28 7:47 ` Stefan Kangas
2023-09-28 14:18 ` T.V Raman
2023-09-28 23:04 ` Michael Heerdegen
2023-09-29 2:20 ` T.V Raman
2023-09-29 13:52 ` Eli Zaretskii
2023-09-29 14:16 ` Stefan Kangas
2023-09-29 14:26 ` T.V Raman
2023-09-29 16:06 ` Emanuel Berg
2023-09-29 16:16 ` Eli Zaretskii
2023-09-28 7:38 ` Stefan Kangas [this message]
2023-09-28 14:16 ` T.V Raman
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='CADwFkm=ALqvYhOorFGpftGYqraVCgsB0Cn9yEXSjskzYJCzvtg@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=ohwoeowho@gmail.com \
--cc=raman@google.com \
/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).