From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for Flymake diagnostics Date: Tue, 16 Jul 2024 17:27:03 -0400 Message-ID: References: <865xtu7seh.fsf@gnu.org> <868qyf5587.fsf@gnu.org> <868qyd32ih.fsf@gnu.org> <861q452s5f.fsf@gnu.org> <86frsgmpe1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9097"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 71504@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 16 23:28:20 2024 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 1sTpie-00026w-1g for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jul 2024 23:28:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTpiN-0006sn-F5; Tue, 16 Jul 2024 17:28:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTpiL-0006sd-0a for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 17:28:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTpiK-0006yl-Oe for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 17:28:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sTpiM-0004TU-Hr for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 17:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jul 2024 21:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71504 X-GNU-PR-Package: emacs Original-Received: via spool by 71504-submit@debbugs.gnu.org id=B71504.172116523617134 (code B ref 71504); Tue, 16 Jul 2024 21:28:02 +0000 Original-Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 21:27:16 +0000 Original-Received: from localhost ([127.0.0.1]:34512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTphb-0004SH-IV for submit@debbugs.gnu.org; Tue, 16 Jul 2024 17:27:16 -0400 Original-Received: from mxout1.mail.janestreet.com ([38.105.200.78]:52121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTphY-0004S1-2E for 71504@debbugs.gnu.org; Tue, 16 Jul 2024 17:27:14 -0400 In-Reply-To: (Eshel Yaron's message of "Thu, 11 Jul 2024 09:28:35 +0200") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1721165223; bh=JvXwQ/TsN6LnJt2sjiXuLrxWf2laKjfKIHzi1NabtX0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=g3FCRGySYeVurMLN5mCP6xQEprpYb62j0QiwXo0Nis3gBJvP3N7cLejDJ261jGVKj pHO4eHsUTXPf1LdVO9LKBfc8MeXKN4TkZZi5//d1zMmgJMKatAI6G6KdeRlanjljQQ 8YxVc/5nzwqBxbulnYRyDgrDoej9ENrsHlBVLWWuXmFzWR5Vc0X9Cz4t1XLUXvpsqo DRqW2d3dq1OxvSOrBNVSGPoYGk9yqrLiVuHGwNPLkwrYobrDH50j4p7dTZKqvOvtyB edK9rkxsnpXmYtxk1oyJzBrztCWL+rBnHYX7rVS/h0/V2oz5RhFcEoj6brfN5SBdDy JvEYa15W0EL3Q== 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288895 Archived-At: Eshel Yaron writes: > Eli Zaretskii writes: > >>> From: Eshel Yaron >>> Cc: sbaugh@janestreet.com, 71504@debbugs.gnu.org >>> Date: Thu, 11 Jul 2024 07:43:53 +0200 >>> >>> Hi Eli, >>> >>> Eli Zaretskii writes: >>> >>> > It sounds like we all agree, but then what is the problem? >>> >>> I'm not sure I understand what you're asking, I don't think there's any >>> problem here per se, just a need for a decision on how to proceed: >>> >>> If you and Spencer agree with my overall implementation, I'll polish it >>> a bit and post an updated patch for master. If you want to implement >>> the requested feature in some other way, that's perfectly fine too. >>> Lastly, if you don't think Emacs should provide a command for applying >>> fixes to Flymake diagnostics, feel free to close this feature request. >> >> I'm asking what is the overall idea of the proposed implementation. I >> think it's worthwhile to present it, so we could see if we all agree >> with that idea and the details of the proposed implementation. > > Thanks. To clarify, ideally Spencer will implement this feature request > however he sees fit. I'm offering my implementation as a reference, but > I'm not advocating for it over other alternatives that may come up. > > The idea of my implementation is to allow Flymake backends to associate > fixes with some of the diagnostics they create, and to add a command > that tries to apply a fix for the diagnostic at point. For the details, > see below the same patch I attached to this message: > https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01318.html A few issues: - At an immediate glance, fix-function should return a cl-defstruct instead of a list, to match the rest of the flymake API. - An implementation of this feature in flymake absolutely must come with support for Eglot, as the main user of this feature. Which, if the Eglot maintainer doesn't want to merge that, may mean we can't move forward. - Your patch adds support in shellcheck for fixes. That's uncontroversially useful and good. Could we add this support in a shellcheck-specific way before finalizing the flymake fix API? (Taking care to add it in a way that can be supported by a later unified UI, of course) - Likewise, you mentioned adding support for fixes to checkdoc, although I'm not sure where that patch is. That sounds also extremely useful, could it also be added first? - Do you hope to have a default binding for the fix-applying command you mention? Certainly I would like that, and I think it's worth talking about now. More broadly, I'm still a bit unsure about this whole approach. - What UI, exactly, do you want to build on top of this? Can we see an example of this UI? Or is it really just this one command? - If it's just the one command, and your hope is to give this some default binding, what exactly is the problem with doing that via a keymap overlay as Joao suggests? What do you want to do which can't be done with a keymap overlay bound to a backend-specific function? - Could this UI also support spell-checking, via ispell or flyspell? It seems like "fix the spelling of a typo'd word" is something that would very naturally fit this whole idea. - Could we implement all this outside of flymake, I wonder, with some kind of refactor-backend-functions buffer-local?