From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for Flymake diagnostics Date: Tue, 16 Jul 2024 17:19:47 +0200 Message-ID: References: <865xtu7seh.fsf@gnu.org> <868qyf5587.fsf@gnu.org> <868qyd32ih.fsf@gnu.org> <861q452s5f.fsf@gnu.org> <86frsgmpe1.fsf@gnu.org> <86ttgvkti6.fsf@gnu.org> <868qy1iqbp.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40029"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@janestreet.com, 71504@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 16 17:22:17 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 1sTk0P-000A1I-DL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jul 2024 17:22:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTjyD-0002Pm-OQ; Tue, 16 Jul 2024 11:20:01 -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 1sTjyB-0002Nn-SD for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 11:19:59 -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 1sTjyB-0007Wz-JU for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 11:19:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sTjyE-0003iV-4X for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 11:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jul 2024 15:20: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.172114319714270 (code B ref 71504); Tue, 16 Jul 2024 15:20:02 +0000 Original-Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 15:19:57 +0000 Original-Received: from localhost ([127.0.0.1]:34256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTjy9-0003i6-30 for submit@debbugs.gnu.org; Tue, 16 Jul 2024 11:19:57 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:51806 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTjy5-0003hs-F2 for 71504@debbugs.gnu.org; Tue, 16 Jul 2024 11:19:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1721143190; bh=KjCjXWN8N+xI61RMobzj9pi2eXs9fxiMcapFkGNikxg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mZVZ4WRmTnn99f65HRXshrJ2sQHn9bGQC9Czt2bOSlH9Zo5i5bNu+O1E2DN+lAYcS G1Izo7Lmoha96Z5kae4M2ZskjxfrpVqCGcd4d9WzWcCD3YdZkyO6pKcCEF6XWyo2yG X3B1xUIMCuWcLqY9BK4HC6Jf8qvpC3lB11hfbJXlUrGpeh6ip6aqwz9nQFIvO1u6aH mNi2WAhNUZ8Kd1gfIYUHcM72S8oQ5Tf9PUCAb/33br70qJTOsoHY6vagHJfr2Gnhni Isa7R7CDBw0Vkw2YBze0R+GlJB8MPTuaURQD0LKAaSUDphHPealo/NDShuD7i2HerH NBe+ONJI7yYgw== In-Reply-To: <868qy1iqbp.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 16 Jul 2024 13:28:10 +0300") 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:288891 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: sbaugh@janestreet.com, 71504@debbugs.gnu.org >> Date: Tue, 16 Jul 2024 11:49:45 +0200 >> >> > If this is okay with Spencer, I think this should go to the master >> > branch, with the following two nits fixed: >> > >> > . the doc string of flymake-make-diagnostic should explicitly tell >> > that :fix-function is for backends to be set to the appropriate >> > fixup function >> > . this is documented in flymake.texi >> >> Thanks, will do. Note that to apply a fix suggestion, this patch uses >> function refactor-apply-edits from my library refactor.el. This is the >> "general purpose function for applying code changes" I mentioned in a >> previous message in this thread. So to land this on master we need to >> also add (at least a part of) refactor.el. I'm happy to contribute the >> library wholesale, FWIW. >> >> You can find the latest version of refactor.el here: >> >> https://git.sr.ht/~eshel/emacs/blob/main/lisp/progmodes/refactor.el > > Couldn't refactor-apply-edits be replaced with something that doesn't > depend on the rest of the library? Yes, that's certainly doable. refactor-apply-edits can apply edits in different ways depending on the value of refactor-apply-edits-function: 1. Apply all edits at once, without further confirmation. 2. Preview changes inline, and query about applying each change in turn. (This is like query-replace with inline before/after preview.) 3. Summarize edits in a diff buffer, let the user take it from there. I guess that for applying fix suggestions for Flymake diagnostics we can extract just the couple of functions that apply all edits at once. > I'd prefer not to delay the fixit support in Eglot until we decide > whether or not to add refactor.el. Adding refactor.el could then be a > separate discussion (and I do think having refactoring capabilities in > Emacs is long overdue). SGTM. (I assume you meant Flymake rather than Eglot?) I'll put together an updated patch once Spencer confirms. Eshel