GNU bug report logs - #71504
30.0.50; FR: Fix suggestions ("quick fix") for Flymake diagnostics

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Wed, 12 Jun 2024 08:44:02 UTC

Severity: wishlist

Found in version 30.0.50

Full log


Message #44 received at 71504 <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com, 71504 <at> debbugs.gnu.org
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
Date: Tue, 16 Jul 2024 11:49:45 +0200
Hi Eli,

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Eshel Yaron <me <at> eshelyaron.com>
>> Cc: sbaugh <at> janestreet.com,  71504 <at> debbugs.gnu.org
>> Date: Thu, 11 Jul 2024 09:28:35 +0200
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> > 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
>
> Thanks.
>
> 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


Regards,

Eshel




This bug report was last modified 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.