From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44858: [PATCH] Make byte-compiler warn about wide docstrings Date: Fri, 27 Nov 2020 14:44:11 +0200 Message-ID: <831rgfotpg.fsf@gnu.org> References: <83h7pcqjxy.fsf@gnu.org> <87pn3zjivc.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28265"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44858@debbugs.gnu.org, larsi@gnus.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 27 13:45:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kid7e-0007Ci-8r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Nov 2020 13:45:10 +0100 Original-Received: from localhost ([::1]:51970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kid7d-0001VZ-3Z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Nov 2020 07:45:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kid7W-0001VM-CB for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 07:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kid7W-0001gK-3a for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 07:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kid7V-0000Eq-VK for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 07:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Nov 2020 12:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44858 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44858-submit@debbugs.gnu.org id=B44858.1606481076871 (code B ref 44858); Fri, 27 Nov 2020 12:45:01 +0000 Original-Received: (at 44858) by debbugs.gnu.org; 27 Nov 2020 12:44:36 +0000 Original-Received: from localhost ([127.0.0.1]:44248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kid75-0000Dy-TQ for submit@debbugs.gnu.org; Fri, 27 Nov 2020 07:44:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kid73-0000Dl-Qq for 44858@debbugs.gnu.org; Fri, 27 Nov 2020 07:44:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46793) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kid6y-0001Ti-AE; Fri, 27 Nov 2020 07:44:28 -0500 Original-Received: from [176.228.60.248] (port=2792 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kid6x-0000Tg-Gl; Fri, 27 Nov 2020 07:44:27 -0500 In-Reply-To: (message from Stefan Kangas on Fri, 27 Nov 2020 12:15:03 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194443 Archived-At: > From: Stefan Kangas > Date: Fri, 27 Nov 2020 12:15:03 +0100 > Cc: Eli Zaretskii , 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.