unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 44858@debbugs.gnu.org
Subject: bug#44858: [PATCH] Make byte-compiler warn about wide docstrings
Date: Thu, 26 Nov 2020 04:46:25 -0800	[thread overview]
Message-ID: <CADwFkmmbWx19tiC3xRhGyHRx9x1xjPupbK_6mFnZg3VNmqsqrg@mail.gmail.com> (raw)
In-Reply-To: <87zh34wfxo.fsf@gnus.org>

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I like it.

Thanks.

>> I've been messing around with getting defuns to work, but I can't find a
>> way for it to work reliably.  The problem is that they are already macro
>> expanded when we start issuing warnings, so it's not trivial to reliably
>> separate defuns from other cases where lambda is used.
>
> I'm probably misunderstanding you completely, but do we have to separate
> between lambda and defuns?  lambdas can also have doc strings...

Indeed they can.  The problem I had was how to differentiate between the
many different macros that generate lambdas.  I didn't record the exact
details, but it got pretty messy between `defun', `define-derived-mode',
`cl-defgeneric', etc. etc.  The problem I saw was basically warnings
about symbols only visible after macro expansion, and that warnings
would point to entirely the wrong line and column.  (If anyone wants to
take a look, it should be sufficient to uncomment the lambda part in my
patch and run "make bootstrap".)

I was looking at `byte-defop-compiler-1', but that seems to only be
usable for functions and special forms?  IIUC, when we compile all
macros have been expanded and all information about what macro was used
where is lost.  But it's possible that I'm misunderstanding things, as
I'm still wrapping my head around this code.

>> (If you were to add defuns into the mix, we would get around 700
>> warnings for wide docstrings, several of which would be autogenerated.
>> We should probably look into that at some point...)
>
> Yes, the autogenerated docstrings should be fixed, too -- mostly by
> running them through `fill-paragraph'.

I tried that in e.g. define-derived-mode, but fill.el is loaded after
derived.el.  So it seems like there is some fun to be had in figuring
out the dependencies there...





  reply	other threads:[~2020-11-26 12:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  1:36 bug#44858: [PATCH] Make byte-compiler warn about wide docstrings Stefan Kangas
2020-11-26 10:49 ` Lars Ingebrigtsen
2020-11-26 12:46   ` Stefan Kangas [this message]
2020-11-26 12:53     ` Lars Ingebrigtsen
2020-12-10 20:59       ` Stefan Kangas
2020-12-10 21:53         ` Stefan Kangas
2020-12-11  8:16           ` Eli Zaretskii
2020-12-11 20:03             ` Stefan Kangas
2020-12-11  7:33         ` Eli Zaretskii
2020-12-11 20:36           ` Stefan Kangas
2020-12-19 11:22             ` Eli Zaretskii
2020-12-19 16:50               ` Stefan Kangas
2020-12-19 17:14                 ` Eli Zaretskii
2020-12-29  1:27                   ` Basil L. Contovounesios
2020-12-29  2:16                     ` Lars Ingebrigtsen
2020-12-19 17:18                 ` Lars Ingebrigtsen
2020-12-19 23:48                   ` Stefan Kangas
2020-12-11  7:53         ` Eli Zaretskii
2020-12-19 23:55           ` Stefan Kangas
2020-12-20 17:53             ` Lars Ingebrigtsen
2020-12-28  5:18               ` Stefan Kangas
2020-12-11 15:13         ` Lars Ingebrigtsen
2020-12-30 12:07       ` Stefan Kangas
2020-12-31  4:42         ` Lars Ingebrigtsen
2020-11-26 14:19 ` Eli Zaretskii
2020-11-27  8:37   ` Lars Ingebrigtsen
2020-11-27 11:15     ` Stefan Kangas
2020-11-27 12:44       ` Eli Zaretskii
2020-12-06 11:09         ` Stefan Kangas
2020-12-06 11:19           ` Eli Zaretskii
2020-12-06 16:54           ` Drew Adams
2020-11-27 18:36     ` Drew Adams
2020-11-27 18:55       ` Drew Adams
2020-12-03 20:18 ` Tomas Nordin
2020-12-11 20:14   ` Stefan Kangas
2021-09-24 17:25 ` Stefan Kangas
2021-09-25  1:07   ` Lars Ingebrigtsen
2021-09-26 11:38     ` Stefan Kangas

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=CADwFkmmbWx19tiC3xRhGyHRx9x1xjPupbK_6mFnZg3VNmqsqrg@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=44858@debbugs.gnu.org \
    --cc=larsi@gnus.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).