bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44858: [PATCH] Make byte-compiler warn about wide docstrings


From: Stefan Kangas
Subject: bug#44858: [PATCH] Make byte-compiler warn about wide docstrings
Date: Tue, 24 Nov 2020 17:36:34 -0800

Severity: wishlist

In etc/TODO we have:

** Make byte-compiler warn when a doc string is too wide

Please find attached a patch that implements this.  Notably, it omits
defuns, and ignores any lines containing `substitute-command-keys' style
substitutions.

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.  We also have
other macros like `define-derived-mode' that produces `defun's
themselves, and the line reporting gets messed up.  (The autogenerated
docstrings from these macros seem to generate too wide docstrings in
several cases.)

For `substitute-command-keys', it would be nice to get it to work, but I
don't think we can know the values of keymaps at compile-time.  Possibly
there is a good solution for this, but I couldn't find it.

As for the state of our own sources, we seem to have less than 100
docstrings that break our own conventions and generates a warning with
the patch.  It shouldn't take too much work to fix them.

(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...)

Thoughts?

Attachment: 0001-Make-byte-compiler-warn-about-wide-docstrings.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]