From: "T.V Raman" <raman@google.com>
To: stefankangas@gmail.com
Cc: raman@google.com, emacs-devel@gnu.org, ohwoeowho@gmail.com
Subject: Re: bytecomp: doc string wider than 80 spurious warnings are back
Date: Thu, 28 Sep 2023 07:16:43 -0700 [thread overview]
Message-ID: <25877.35531.898469.897554@retriever.mtv.corp.google.com> (raw)
In-Reply-To: <CADwFkm=ALqvYhOorFGpftGYqraVCgsB0Cn9yEXSjskzYJCzvtg@mail.gmail.com>
Agreed on everything except the last: Yes, we cant do anything about
third party macros, but we == Emacs is the one displaying the
docstring, so we can surely break ourselves free from the docstring
not being wider than 80 chars; and for instance, in your example, the
function name passed is a 128-char hyphenated string, then how to
handle that is still better handled in the display algorithm,
Stefan Kangas writes:
> "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?
--
prev parent reply other threads:[~2023-09-28 14:16 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
2023-09-28 14:16 ` T.V Raman [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25877.35531.898469.897554@retriever.mtv.corp.google.com \
--to=raman@google.com \
--cc=emacs-devel@gnu.org \
--cc=ohwoeowho@gmail.com \
--cc=stefankangas@gmail.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.