[Top][All Lists]

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

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

From: Eli Zaretskii
Subject: bug#44858: [PATCH] Make byte-compiler warn about wide docstrings
Date: Fri, 27 Nov 2020 14:44:11 +0200

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 27 Nov 2020 12:15:03 +0100
> Cc: Eli Zaretskii <eliz@gnu.org>, 44858@debbugs.gnu.org
> > > How about some simplified heuristics, like assume that the expansion
> > > takes no more than N characters (where N could be something like 5)?
> > > This should work in, like, 80% of cases, I think.
> >
> > Yup.  And 15% is mostly when it expands to `M-x some-long-command'
> > because the keymap hasn't been loaded yet, I think?  Which we could
> > conceivably fix by loading the file when the used `C-h f's an autoloaded
> > function with one of these constructs?  Perhaps a bit hacky...
> I would be wary of using a heuristic here, because I think false
> positives are worse than false negatives in this case.

Can we have some numbers, please? how many false positives do you get
by assuming the expanded key sequence takes 5 characters? what about 3
or 4 or 7?

> We unfortunately don't have any way of silencing individual
> warnings, so a user seeing a false positive is left with two
> suboptimal choices: ignore the warning (a bad habit to train our
> users in) or change the formatting of a docstring to stop it
> (potentially making it subjectively worse in the process).

The assumption is that using such heuristic will cause false
negatives, not false positives.  Do you see any bad consequences to
false negatives?

> How about using the somewhat safer heuristic of treating substitutions
> as one character wide?  Would that make sense?

I'd say, at least 3, because there are very few non-trivial key
bindings bound to a single character.

reply via email to

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