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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Eshel Yaron <me@HIDDEN>; dated Wed, 12 Jun 2024 08:44:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 25 Jul 2024 09:04:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 25 05:04:58 2024
Received: from localhost ([127.0.0.1]:35517 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sWuPB-00027E-QA
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2024 05:04:58 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:58244 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sWuP9-000276-O1
 for 71504 <at> debbugs.gnu.org; Thu, 25 Jul 2024 05:04:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1721898288;
 bh=LKko6jAaOP1PCEPxsjeT6+/g8qP6y47Z9mVHUUdTlVo=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=CXiLtxDCxFBbXtMn8sA6SOvj3IkatkP7hyxtj/xd82gXDqIDRJKCx0dB8UqPKk0UP
 nNnqRNsWbEseGiz6TWDqeOML87aV7rNphhHoL0BfQtkiyrLpgRdPeWIa9nDrF1v3ax
 f5X2L7X5PnS3WRenKLnbEd2gQHYZ4ToT8BdobwgQ09SVN7/0RoSHV1M1CCCSo+Cfp1
 uS9Gi9YGrcqochpkd+r9hwm/cB8GgbefbQFMZmzsQvTiGNL4bB9EvngHLKSpacWyYG
 LcSkQ2VDgx+jZWh3MJ29YZtAD5fx3MsMn5IsCAsjWKbxOvYPjt0WA0qziwqZSxoa72
 Mx6+wdKGRCthQ==
From: Eshel Yaron <me@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <ierfrryd9q7.fsf@HIDDEN> (Spencer Baugh's message of
 "Wed, 24 Jul 2024 12:40:32 -0400")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <iered7tuixk.fsf@HIDDEN> <m1h6cokzi8.fsf@HIDDEN>
 <ierfrryd9q7.fsf@HIDDEN>
Date: Thu, 25 Jul 2024 11:04:45 +0200
Message-ID: <m1o76letaq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, 71504 <at> debbugs.gnu.org, joaotavora@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Spencer,

Spencer Baugh <sbaugh@HIDDEN> writes:

> Eshel Yaron <me@HIDDEN> writes:
>
>>> - Likewise, you mentioned adding support for fixes to checkdoc, although
>>> I'm not sure where that patch is.
>>
>> It's on my development branch, namely this commit:
>>
>> http://git.eshelyaron.com/gitweb/?p=emacs.git;a=commitdiff;h=650c2a056af8df85065b2851d3513c1e3d62c60c
>
> Is this server down right now?

Doesn't seem so, 180 days of uptime :)
There's also a mirror here if you have troubles reaching my server:

https://git.sr.ht/~eshel/emacs/commit/650c2a056af8df85065b2851d3513c1e3d62c60c




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 24 Jul 2024 17:45:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 24 13:45:48 2024
Received: from localhost ([127.0.0.1]:34439 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sWg3g-0006Qr-Ci
	for submit <at> debbugs.gnu.org; Wed, 24 Jul 2024 13:45:48 -0400
Received: from mail-ot1-f47.google.com ([209.85.210.47]:48616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1sWg3d-0006Qi-In
 for 71504 <at> debbugs.gnu.org; Wed, 24 Jul 2024 13:45:46 -0400
Received: by mail-ot1-f47.google.com with SMTP id
 46e09a7af769-703631c4930so3639987a34.1
 for <71504 <at> debbugs.gnu.org>; Wed, 24 Jul 2024 10:45:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1721843078; x=1722447878; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=gPMUm1uUYQHCCfx2cjwPG7cXXjT7s9CUKzrH/SIZXQY=;
 b=YcOksusKwF6u/tY+r0CCs5MkFuiT1mw9pDuQDb8Vyh+eyjwt6ydRYcClXVkDk6sTg2
 gt4Sxkl6pddRX14m0JaJpcPOFeQWoFTn+xT3DpYQ6TEq0n5d9HebRri6YvX8SQ/FbcFC
 JJ/NiUgAJMpmub9NcJ5nOX8rBVcvybv+sH8hpYEz/8MUPhRv/0lX/9R1uqvxmawpe+Ae
 w52ydUfeOukSnRvMKFftn0c0942duHd5U6Jn/3haGdyD1p1MRZxcjg5SbTxCQX9vT5Qv
 1TfKFqgMjTrnm5PnuE/Qxo+6GqAkJkI3da1xV9MAmG7Olvyjk9EoBK25K77Nc86wwNQe
 Xnig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1721843078; x=1722447878;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=gPMUm1uUYQHCCfx2cjwPG7cXXjT7s9CUKzrH/SIZXQY=;
 b=As7r3ryyRGERmGHJJX90EzA2ZRSR9BzbzzE40nIOolfOzFBZaV3H9vI3ca6xaUQTx7
 qzGNU6lpE79Id7WKMIgO51s47Sk1FK2st2zW4PXn2VLhaR3s7Nn3aQHHtbcaXYtVaARx
 6cT6X4z4AyyI00TognOTapDoXFS/3iDmcjiNQuVogaKtLvQvU3ky6+qEZdUpfwgnVe8X
 F+L0mpTZ8Ys+0Ye6RcKqJPock5xXapBkyfbyaGSRXPdjcydOgPbLJqEbU/CXx+Z5bWBr
 m14Mb2yAh5wJcTRZhl5iRmkCgT15I79TuOeMrAemSUNazuZG8HFfWR+vWD7lmORwSYCw
 oWsw==
X-Forwarded-Encrypted: i=1;
 AJvYcCWNNlqm0qS3BsFJb21Kw4CDZ4jf1CX3qMl6uXakPW0eQ+YHbyHlp2XsYNazAssvdmG4QrR3HTNgBqPb9Nwzxm9DrEmOC/Y=
X-Gm-Message-State: AOJu0Yzz3rWN1f+9Nq+27XqiTChnreJ/vcFd+OBWNC67rmPlZz+/Ijlm
 3kFgUhbgJBxtdnNEs+7eG7VoqmBVh4ZdksymT9CMbZke1jQvLU4F/nDlWENUFzlmKUYaLJnK+H3
 UDrP1xYpoEVjR65ooX8EXXoNWpI8=
X-Google-Smtp-Source: AGHT+IFK4KzsuK08zllPu0fQQiscPj4Ej6XHTzwIzCXoyK+wbhzK81dfKTJ/RQyxtP4gB95Z/AgYVCK4CK5OveOX0a8=
X-Received: by 2002:a05:6870:212:b0:261:236c:2bc1 with SMTP id
 586e51a60fabf-264a0d6cc7bmr332277fac.12.1721843078531; Wed, 24 Jul 2024
 10:44:38 -0700 (PDT)
MIME-Version: 1.0
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN>
 <m1bk39zaic.fsf@HIDDEN> <861q452s5f.fsf@HIDDEN>
 <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <iered7tuixk.fsf@HIDDEN>
 <m1h6cokzi8.fsf@HIDDEN> <ierfrryd9q7.fsf@HIDDEN>
In-Reply-To: <ierfrryd9q7.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 24 Jul 2024 18:44:28 +0100
Message-ID: <CALDnm50WrHCTNEbqyrHn-RSTT_3rrA9ToUoxq9PbVzTBDs6AXw@HIDDEN>
Subject: Re: bug#71504: 30.0.50;
 FR: Fix suggestions ("quick fix") for Flymake diagnostics
To: Spencer Baugh <sbaugh@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, Eshel Yaron <me@HIDDEN>,
 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Wed, Jul 24, 2024 at 5:40=E2=80=AFPM Spencer Baugh <sbaugh@HIDDEN=
m> wrote:

> I don't want to be obstructionist, but it seems to me that if we land
> this in flymake, eventually it will just *have* to be supported in
> Eglot.

Not aware that Eglot is under such obligation.  It generally wants
to use Emacs facilities that do useful work, but only if those things
are simpler than existing battle-tested things.  This is not one of
those.

The patch Eshel was proposing adds a re-representation of
code actions to Flymake, something completely outside its
responsibilities (as I designed and maintained for a number of
years at least).

Flymake's current API is fine for Eglot's code-action purposes.
A refactor.el API would be even better.

> I don't want to abuse that as a way to work around what Joao
> prefers.

I suggested an alternative idea to put in the refactor.el library.  No idea
why that's not being considered : =C2=AF\_(=E3=83=84)_/=C2=AF

https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01163.html

Then for sure Eglot would migrate, as I'm always looking for less
code to maintain, not more.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 24 Jul 2024 16:40:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 24 12:40:48 2024
Received: from localhost ([127.0.0.1]:34381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sWf2l-0004i0-PB
	for submit <at> debbugs.gnu.org; Wed, 24 Jul 2024 12:40:48 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50197)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1sWf2i-0004hk-Sw
 for 71504 <at> debbugs.gnu.org; Wed, 24 Jul 2024 12:40:46 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <m1h6cokzi8.fsf@HIDDEN> (Eshel Yaron's message of "Wed,
 17 Jul 2024 13:51:27 +0200")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <iered7tuixk.fsf@HIDDEN> <m1h6cokzi8.fsf@HIDDEN>
Date: Wed, 24 Jul 2024 12:40:32 -0400
Message-ID: <ierfrryd9q7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1721839233;
 bh=ZOOVIT1kvIHw3MxXkekmS8zMX+6m0fn8T+kC8jzAfD4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=UTN/xHYTI6iC7bmpJwjMleuIy/PUdmte+rrtLXhwWGakYTPL8vsQwlGylj9YA2tT1
 3opwuzGFbbQyFjcZ3TK8DhhzqJsqAP8keEPSiVBTb057PlgiaraNQ12RP7O6dObwNM
 fR6gieC04uJ/L7VUqNKWDeJrKmjTnydt7/FlBGVwm//elvxm6A+8OYmVfrVTJjH3A1
 GvQwaDD9+hva4WD0GOwzyKB6JppfXlu+XyXhXZIgCm1ZR19y8RuCAugoWrFkMHCjcH
 o1EyLcIksieFNMeZ/ZaLDiHSMclt5si5SuOZpBrDVQ+lQJbwEo3jIHDmiuY4UppsEM
 1XXGIvBMMJRsA==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, 71504 <at> debbugs.gnu.org, joaotavora@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eshel Yaron <me@HIDDEN> writes:

> Hi Spencer,
>
> Spencer Baugh <sbaugh@HIDDEN> writes:
>
>> Eshel Yaron <me@HIDDEN> writes:
>>> Eli Zaretskii <eliz@HIDDEN> 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
>>
>> 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.
>
> The fix-function returns any number of fixes, as a list of fixes.  I
> guess that's not the list you're referring to, because I don't see how
> this list (whose number of elements vary) can be replaced by a
> cl-defstruct.  Each individual fix is also represented as a list, with
> exactly two elements: TITLE and EDITS.  Is this what you'd like to see
> replaced with a cl-defstruct?

Yes.

>> - 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.
>
> I agree that Eglot support is important (it was naturally the first
> backend I adapted), and that it'll be great to have Jo=C3=A3o on board.
> I don't think it's a blocker, but it's your call.

I don't want to be obstructionist, but it seems to me that if we land
this in flymake, eventually it will just *have* to be supported in
Eglot.  I don't want to abuse that as a way to work around what Joao
prefers.

>> - 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)
>
> Maybe, but it would be less useful: it wouldn't help other backends,
> including third-party backends, to provide fixes.  Also, I don't think
> there's anything final here, there's plenty of room for developing the
> API further if more/different requirements arise.

Of course that's all true, but also it doesn't seem harmful to just add
some shellcheck-apply-fix command, which contains all the
shellcheck-specific logic you already need to add.  It will have a tiny
bit of duplication, but we can get rid of that after adding a unified
UI.

>> - Likewise, you mentioned adding support for fixes to checkdoc, although
>> I'm not sure where that patch is.
>
> It's on my development branch, namely this commit:
>
> http://git.eshelyaron.com/gitweb/?p=3Demacs.git;a=3Dcommitdiff;h=3D650c2a=
056af8df85065b2851d3513c1e3d62c60c

Is this server down right now?

>> That sounds also extremely useful, could it also be added first?
>
> First as in not via Flymake?  Note that checkdoc already has its own fix
> support, the point here is to add something that'll work consistently
> across backends.

Ah, I'll have to judge when I see the commit.

>> - 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.
>
> IMO it's fine to leave it unbound at first, and see how users bind it.
> But if you find an appropriate available binding, why not? :)
>
>> 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?
>
> A simple command is a good start.  Once diagnostics are enriched with
> fix suggestions, folks can add more bells and whistles if they like to.
>
> FWIW, two further small enhancements that I'm experimenting with are:
> 1. Apply fixes from the diagnostics list buffer.
> 2. Apply fixes to one or more diagnostics that you choose with completion.
>
>> - 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?
>
> As we've already established, individual backends can do anything at all
> via overlay properties and other methods.  But that puts extraneous
> burden on backends to deal with frontend concerns, and it doesn't yield
> a consistent UI across backends (one command that works everywhere).
>
>> - 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.
>
> Sure.

My implicit point here is that ispell/flyspell aren't flymake-based, so
something tied to flymake may make this harder.  (But maybe
flymake-based spellcheckers are better anyway?  I don't actually use
flyspell or any other on-the-fly spellchecker, so I can't really say)

>> - Could we implement all this outside of flymake, I wonder, with some
>> kind of refactor-backend-functions buffer-local?
>
> Dunno, probably, somehow.  But there's no refactor.el in core, and,
> however we do it, it'll need to interact with Flymake diagnostics that
> come from Flymake backends, so flymake.el seems like a natural choice.
> Crucially, in flymake.el we can extend flymake-make-diagnostic to make
> it as easy as possible for backends to provide fixes.

Well, sure, flymake is important.  But if we did it with some kind of
buffer-local list of backend functions, it could also have backends
which aren't flymake.  IDK if there are such backends though.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 17 Jul 2024 11:51:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 17 07:51:37 2024
Received: from localhost ([127.0.0.1]:35178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sU3C4-00077f-EM
	for submit <at> debbugs.gnu.org; Wed, 17 Jul 2024 07:51:36 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:46956 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sU3C1-00077V-6K
 for 71504 <at> debbugs.gnu.org; Wed, 17 Jul 2024 07:51:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1721217089;
 bh=0jWwCqXLKBNU1jxZzK32+OGOcglMEca3eNRPTnjCXVg=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=SRKXas1HeWqj5Dx0vqn/EmGBqi2trQ1UXsFZrsAdc59r1X66ivF01wJejnpmcO6gq
 DUXUwU7rpHS0bHz6/eI19RBKo8mVoTo1txJY7ZgrVTfzu2NhPuCkCH3WlSXCLvKHFk
 rn2WjYhawXyulKz0A152dQ2vV6TbWq/U8U6V7z0uDB+SpifjPIg24wvciKhHaz9flu
 7jZa59MtIU2uG0W4BTvAAZXiB13TBzO3PYT4GpuwgKO/Nkrr5sGoazEKKd3f51mLLU
 /IeC8alOw3sR/H9JY2DLyjk5RTb6ZG0ZJRb6cU4eujv4vidnYzEteS0t7jUwh1YUl+
 R6Qr2ysfBv4sA==
From: Eshel Yaron <me@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <iered7tuixk.fsf@HIDDEN> (Spencer Baugh's message of
 "Tue, 16 Jul 2024 17:27:03 -0400")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <iered7tuixk.fsf@HIDDEN>
Date: Wed, 17 Jul 2024 13:51:27 +0200
Message-ID: <m1h6cokzi8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Spencer,

Spencer Baugh <sbaugh@HIDDEN> writes:

> Eshel Yaron <me@HIDDEN> writes:
>> Eli Zaretskii <eliz@HIDDEN> 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
>
> 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.

The fix-function returns any number of fixes, as a list of fixes.  I
guess that's not the list you're referring to, because I don't see how
this list (whose number of elements vary) can be replaced by a
cl-defstruct.  Each individual fix is also represented as a list, with
exactly two elements: TITLE and EDITS.  Is this what you'd like to see
replaced with a cl-defstruct?

> - 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.

I agree that Eglot support is important (it was naturally the first
backend I adapted), and that it'll be great to have Jo=C3=A3o on board.
I don't think it's a blocker, but it's your call.

> - 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)

Maybe, but it would be less useful: it wouldn't help other backends,
including third-party backends, to provide fixes.  Also, I don't think
there's anything final here, there's plenty of room for developing the
API further if more/different requirements arise.

> - Likewise, you mentioned adding support for fixes to checkdoc, although
> I'm not sure where that patch is.

It's on my development branch, namely this commit:

http://git.eshelyaron.com/gitweb/?p=3Demacs.git;a=3Dcommitdiff;h=3D650c2a05=
6af8df85065b2851d3513c1e3d62c60c

> That sounds also extremely useful, could it also be added first?

First as in not via Flymake?  Note that checkdoc already has its own fix
support, the point here is to add something that'll work consistently
across backends.

> - 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.

IMO it's fine to leave it unbound at first, and see how users bind it.
But if you find an appropriate available binding, why not? :)

> 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?

A simple command is a good start.  Once diagnostics are enriched with
fix suggestions, folks can add more bells and whistles if they like to.

FWIW, two further small enhancements that I'm experimenting with are:
1. Apply fixes from the diagnostics list buffer.
2. Apply fixes to one or more diagnostics that you choose with completion.

> - 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?

As we've already established, individual backends can do anything at all
via overlay properties and other methods.  But that puts extraneous
burden on backends to deal with frontend concerns, and it doesn't yield
a consistent UI across backends (one command that works everywhere).

> - 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.

Sure.

> - Could we implement all this outside of flymake, I wonder, with some
> kind of refactor-backend-functions buffer-local?

Dunno, probably, somehow.  But there's no refactor.el in core, and,
however we do it, it'll need to interact with Flymake diagnostics that
come from Flymake backends, so flymake.el seems like a natural choice.
Crucially, in flymake.el we can extend flymake-make-diagnostic to make
it as easy as possible for backends to provide fixes.


Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 21:27:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 16 17:27:16 2024
Received: from localhost ([127.0.0.1]:34512 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTphb-0004SH-IV
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 17:27:16 -0400
Received: from mxout1.mail.janestreet.com ([38.105.200.78]:52121)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1sTphY-0004S1-2E
 for 71504 <at> debbugs.gnu.org; Tue, 16 Jul 2024 17:27:14 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <m1cynks7z0.fsf@HIDDEN> (Eshel Yaron's message of "Thu,
 11 Jul 2024 09:28:35 +0200")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
Date: Tue, 16 Jul 2024 17:27:03 -0400
Message-ID: <iered7tuixk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eshel Yaron <me@HIDDEN> writes:
> Eli Zaretskii <eliz@HIDDEN> writes:
>
>>> From: Eshel Yaron <me@HIDDEN>
>>> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
>>> Date: Thu, 11 Jul 2024 07:43:53 +0200
>>> 
>>> Hi Eli,
>>> 
>>> Eli Zaretskii <eliz@HIDDEN> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 15:35:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 16 11:35:57 2024
Received: from localhost ([127.0.0.1]:34282 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTkDb-00047k-Fl
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 11:35:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sTkDV-00047T-3N
 for 71504 <at> debbugs.gnu.org; Tue, 16 Jul 2024 11:35:54 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sTkBF-0001w4-Je; Tue, 16 Jul 2024 11:33:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Bea13W40cqueFjE2gOtuLyh8poxLJJ/xvFjsrVjLXAo=; b=iZN3PpAC7A8q
 4yCfv9O9MTUCGudCP91KnpKu3VxFFonP6dkr0JR5bDQ/MYOphiiATvwXI/zLyF0KxDbSAu2o/z9yj
 DhUHXancUMWZ6bVu07hfbWq7I1UnkNBtlXPErheD26xwXswnRVHZpaDTWdxg4Qs9yR10ejliXbfBm
 vXh9sIulBuqBOrg2BMuFMhlznCXWzTz1/UXWVns9u+lC/LiLLz+KXk6wQvw/sspxioyW6KilmEBJ+
 QfR/gNRcwrWgpMVhT6Mly/0kQz4Smb3BVZ5/xqgvQ5sIJQZ3giEacaURNeeu+lls3LrvFeNu9dWHO
 /JSqsfJ2WjFydfFWec7diw==;
Date: Tue, 16 Jul 2024 18:33:03 +0300
Message-Id: <86o76xgxn4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1zfqhmkj0.fsf@HIDDEN> (message from Eshel Yaron on Tue, 
 16 Jul 2024 17:19:47 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <86ttgvkti6.fsf@HIDDEN> <m18qy1psxy.fsf@HIDDEN>
 <868qy1iqbp.fsf@HIDDEN> <m1zfqhmkj0.fsf@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
> Date: Tue, 16 Jul 2024 17:19:47 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > 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?)

Yes, sorry.

> I'll put together an updated patch once Spencer confirms.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 15:19:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 16 11:19:57 2024
Received: from localhost ([127.0.0.1]:34256 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTjy9-0003i6-30
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 11:19:57 -0400
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 <me@HIDDEN>) id 1sTjy5-0003hs-F2
 for 71504 <at> 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==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <868qy1iqbp.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 16 Jul
 2024 13:28:10 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <86ttgvkti6.fsf@HIDDEN> <m18qy1psxy.fsf@HIDDEN>
 <868qy1iqbp.fsf@HIDDEN>
Date: Tue, 16 Jul 2024 17:19:47 +0200
Message-ID: <m1zfqhmkj0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: sbaugh@HIDDEN,  71504 <at> 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





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 10:28:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 16 06:28:32 2024
Received: from localhost ([127.0.0.1]:32823 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTfQ7-0001K7-U0
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 06:28:32 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sTfQ5-0001Jq-Q0
 for 71504 <at> debbugs.gnu.org; Tue, 16 Jul 2024 06:28:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sTfPu-0000Id-9Z; Tue, 16 Jul 2024 06:28:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=p5Uuu/F7+aZWm3J6H9IGViONU3Bn2rhtaw7YY8Xi0po=; b=qMuvwgvzxO4R
 UK/7XDkA+gjCckfZcuwitp1BAVkYm8ehjU0sS0q3vYXgKZ5pXhfv1UkUUr9XGWrVTq1had4kzDJcP
 5CuFAixyMpEZIG3ANUq47rZ9A3J6rtcmTQtSTc4TONVeLIVYA7xXzoAQ0RtrLiKH/J5cDDXCkfU4Z
 9PxlKMX4d/LNTsiZk6P+zR8rZiRT1SPZ9YkZZmw5TcOIYdA8Hdjm8S6iTgK5EJ5ZgFnVhuX/dL2FG
 MIYsAqB1ak7DgPTaLCxT9TmZB3y/VItk6I/JCWGfyZkvjuzoaZ0aERrldp4hUHxN/XHtkGKTpLbxK
 QQbl16DA7aQaOyzUoIYV3w==;
Date: Tue, 16 Jul 2024 13:28:10 +0300
Message-Id: <868qy1iqbp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m18qy1psxy.fsf@HIDDEN> (message from Eshel Yaron on Tue, 
 16 Jul 2024 11:49:45 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <86ttgvkti6.fsf@HIDDEN> <m18qy1psxy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: sbaugh@HIDDEN,  71504 <at> 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?  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).

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 16 Jul 2024 09:49:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 16 05:49:54 2024
Received: from localhost ([127.0.0.1]:32785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTeoj-0005vv-V6
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 05:49:54 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:48556 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sTeoi-0005vn-8X
 for 71504 <at> debbugs.gnu.org; Tue, 16 Jul 2024 05:49:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1721123389;
 bh=FUZiBo5v7uDGLe1Ba4xznickS5kp8KhBS9ZNSzPyNFY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=wFBpkZdbOEEDYvOgedoE2S4ZVmij5S5vJxAKgKGuJyxfEdMtUI/3xIk0P4Mn8y6xh
 OhpV/Jk10qLttNBFO0bLHPk659LjEJmXfwFzPrWZaz2rB7bLtU7ib2fvSMTNU5quuL
 8qLc4L19uq9ZL5yJY8RnJz8jcK0FtNRaVweJn1aVErb4YiQJrEZS4XgCExCCE7LnFX
 SZNV5XcNL46tUqauxocfh2IVjKZpa0lXWkVS6tdFM3D36IjNvVMnShL/JKJAAMNLRs
 vJzpPSnVEjNn3loh0bwwHKvlAfuwHvxBSyPtcHFEVKwdsnSaQfGzZ4eYlpmILpDI1p
 jU1I3bwoO66Kg==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <86ttgvkti6.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 12 Jul
 2024 09:35:13 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
 <86ttgvkti6.fsf@HIDDEN>
Date: Tue, 16 Jul 2024 11:49:45 +0200
Message-ID: <m18qy1psxy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Eli,

Eli Zaretskii <eliz@HIDDEN> writes:

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 12 Jul 2024 06:35:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 02:35:44 2024
Received: from localhost ([127.0.0.1]:53040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sS9se-0001Wz-3R
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:35:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sS9sc-0001Wn-Ub
 for 71504 <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:35:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sS9sX-0001pO-4r; Fri, 12 Jul 2024 02:35:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=U3yP9QPXj30T7R3XgP4aAITPsf7RegkDJa+uPZ5YEYI=; b=Eu4n5IalyAeC
 XdUe29D5o/UCBWuh5jmhB4eKCAVU5v726Y340lxDtyf1L9XefFlpoVH8vFFupYyS9Q/ZDwzITvSH3
 3BWgyc1ja6w1XfDLdkp9sL6V1Tnuyz5AU6SFPdtLbkmlKkKmVRhE0lKesbR87YEL8w0FHWGXI4OAq
 YGtwByffV/yS0TGI51ENjgwAysw7qODZA4gNDkwzoT7D+2LC2aSUtcE9E9aMGZQhhFiDiFIAdi63i
 a8enVXx+QXsCZSxjMfbJkIv8X4oqIdNIe9v+RAhyTIrkN/J+pLJjvk83zWIxSVG30FFCb7NU1/WEV
 4STZZUz7OopYr8wRfc5ZQQ==;
Date: Fri, 12 Jul 2024 09:35:13 +0300
Message-Id: <86ttgvkti6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1cynks7z0.fsf@HIDDEN> (message from Eshel Yaron on Thu, 
 11 Jul 2024 09:28:35 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN> <m1cynks7z0.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 11 Jul 2024 07:28:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 03:28:41 2024
Received: from localhost ([127.0.0.1]:50803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRoEL-0003AJ-7W
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 03:28:41 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:56084 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sRoEH-0003A9-S2
 for 71504 <at> debbugs.gnu.org; Thu, 11 Jul 2024 03:28:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1720682917;
 bh=OJ8Fct/KXH8HR2tqNbgADgXOom9IZKMOKZ+eWPebUM0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=lPBXBWs97oEMYaIHuVOcikQDA41aSpEhvxzqOsaU8HLbI5T4q+jHPbioQqaCIwJjV
 lnp4fE49nHLen/1ve1v55ZHeq/V1vxF4gz76sqMlOFsKYz37r/f9nq9vUn43GR4hX/
 y2IwzMsDNE8HjtdIsvj0w6uwzFq/H39gDm8W+b2nWGyufS3V+7MF8jG5oDongS46Tq
 cPDYGUyBs7JQTofnZVmh1JctbVKRlW6JvXiTSW3xrLCvpIWuDT5HbLHmtCFmoBe/lT
 tIZ0Rrk5VlJO4s5dWs3Qp+1ZHAMW9PBfNNLUj1MQRCcN+xsJLuhz3MbNP5la1TUd3I
 3b52vEeAVOTfw==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <86frsgmpe1.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 11 Jul
 2024 09:08:54 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
 <86frsgmpe1.fsf@HIDDEN>
X-Hashcash: 1:20:240711:eliz@HIDDEN::PCTCP63L3NxOo3Cg:0Cd
X-Hashcash: 1:20:240711:sbaugh@HIDDEN::KQJLLwVhaDLanlnL:6vYv
X-Hashcash: 1:20:240711:71504 <at> debbugs.gnu.org::NESiNlPnqD4ZoI0R:GJbN
Date: Thu, 11 Jul 2024 09:28:35 +0200
Message-ID: <m1cynks7z0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
>> Date: Thu, 11 Jul 2024 07:43:53 +0200
>> 
>> Hi Eli,
>> 
>> Eli Zaretskii <eliz@HIDDEN> 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

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 2e602658ea7..cf5349765db 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -368,7 +368,7 @@ flymake-error
   locus beg end type text backend data overlay-properties overlay
   ;; FIXME: See usage of these two in `flymake--highlight-line'.
   ;; Ideally they wouldn't be needed.
-  orig-beg orig-end)
+  orig-beg orig-end fix-function)
 
 ;;;###autoload
 (defun flymake-make-diagnostic (locus
@@ -377,7 +377,8 @@ flymake-make-diagnostic
                                 type
                                 text
                                 &optional data
-                                overlay-properties)
+                                overlay-properties
+                                fix-function)
   "Make a Flymake diagnostic for LOCUS's region from BEG to END.
 LOCUS is a buffer object or a string designating a file name.
 
@@ -396,14 +397,24 @@ flymake-make-diagnostic
 OVERLAY-PROPERTIES is an alist of properties attached to the
 created diagnostic, overriding the default properties and any
 properties listed in the `flymake-overlay-control' property of
-the diagnostic's type symbol."
+the diagnostic's type symbol.
+
+FIX-FUNCTION, if non-nil, is a function that takes DATA and returns a
+list of fix suggestions for this diagnostic.  Each fix suggestion is a
+list (TITLE EDITS), where TITLE is a string describing the fix and EDITS
+is a list of (FILE-OR-BUFFER . CHANGES) cons cells, where FILE-OR-BUFFER
+is the file name or buffer to edit, and CHANGES is a list of changes to
+perform in FILE-OR-BUFFER.  Each element of CHANGES is in turn a
+list (BEG END STR), where BEG and END are buffer positions to delete and
+STR is the string to insert at BEG afterwards."
   (when (stringp locus)
     (setq locus (expand-file-name locus)))
   (flymake--diag-make :locus locus :beg beg :end end
                       :type type :text text :data data
                       :overlay-properties overlay-properties
                       :orig-beg beg
-                      :orig-end end))
+                      :orig-end end
+                      :fix-function fix-function))
 
 ;;;###autoload
 (defun flymake-diagnostics (&optional beg end)
@@ -849,6 +860,42 @@ flymake--update-eol-overlays
             (overlay-put o 'before-string (flymake--eol-overlay-summary src-ovs))
           (delete-overlay o))))))
 
+(defun flymake-diagnostic-context-menu (menu click)
+  "Extend MENU with fix suggestions for diagnostic at CLICK."
+  (when-let ((diag (seq-find #'flymake--diag-fix-function
+                             (flymake-diagnostics
+                              (posn-point (event-start click)))))
+             (fixes (funcall (flymake--diag-fix-function diag)
+                             (flymake--diag-data diag)))
+             (i 1))
+    (dolist (fix fixes)
+      (define-key menu (vector (intern (format "flymake-fix-%d" i)))
+                  `(menu-item ,(format "Fix: %s" (car fix))
+                              ,(lambda ()
+                                 (interactive)
+                                 (refactor-apply-edits (cadr fix)))
+                              ,@(cddr fix)))
+      (cl-incf i)))
+  menu)
+
+(defun flymake-fix (pos)
+  "Fix Flymake diagnostic at POS."
+  (interactive "d")
+  ;; TODO - fix _all_ diagnostics at point.
+  (if-let ((diags (flymake-diagnostics pos)))
+      (if-let ((diag (seq-find #'flymake--diag-fix-function diags))
+               (fixes (funcall (flymake--diag-fix-function diag)
+                               (flymake--diag-data diag))))
+          (refactor-apply-edits
+           (car (if (cdr fixes)
+                    (alist-get
+                     (completing-read (format-prompt "Fix" (caar fixes))
+                                      fixes nil t nil nil (caar fixes))
+                     fixes nil nil #'string=)
+                  (cdar fixes))))
+        (message "No fix available for this diagnostic"))
+    (user-error "No diagnostic at this position")))
+
 (cl-defun flymake--highlight-line (diagnostic &optional foreign)
   "Attempt to overlay DIAGNOSTIC in current buffer.
 
@@ -956,6 +1003,7 @@ flymake--highlight-line
              (flymake-diagnostics pos)
              "\n"))))
       (default-maybe 'severity (warning-numeric-level :error))
+      (default-maybe 'context-menu-functions '(flymake-diagnostic-context-menu))
       ;; Use (PRIMARY . SECONDARY) priority, to avoid clashing with
       ;; `region' face, for example (bug#34022).
       (default-maybe 'priority (cons nil (+ 40 (overlay-get ov 'severity)))))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index a348e9ba6fd..fccee14af82 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -3195,6 +3195,21 @@ sh-shellcheck-arguments
 
 (defvar-local sh--shellcheck-process nil)
 
+(defun sh-shellcheck-fix (data)
+  "Format DATA, a cons cell (TITLE . FIX), as a Flymake fix suggestion."
+  `((,(car data)
+     ((,(current-buffer)
+       ,@(mapcar
+          (lambda (rep)
+            (let-alist rep
+              (without-restriction
+                (save-excursion
+                  (goto-char (point-min))
+                  (list (1- (+ (pos-bol .line) .column))
+                        (1- (+ (pos-bol .endLine) .endColumn))
+                        .replacement)))))
+          (alist-get 'replacements (cdr data))))))))
+
 (defun sh-shellcheck-flymake (report-fn &rest _args)
   "Flymake backend using the shellcheck program.
 Takes a Flymake callback REPORT-FN as argument, as expected of a
@@ -3236,7 +3251,9 @@ sh-shellcheck-flymake
                                 ("error" :error)
                                 ("warning" :warning)
                                 (_ :note))
-                              (format "SC%s: %s" .code .message)))))
+                              (format "SC%s: %s" .code .message)
+                              (cons .message .fix) nil
+                              (when (consp .fix) #'sh-shellcheck-fix)))))
                         (funcall report-fn))))
                 (kill-buffer (process-buffer proc)))))))
     (unless dialect




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 11 Jul 2024 06:09:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 02:09:04 2024
Received: from localhost ([127.0.0.1]:50768 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRmzI-0001Ht-70
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 02:09:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sRmzG-0001HP-9l
 for 71504 <at> debbugs.gnu.org; Thu, 11 Jul 2024 02:09:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sRmzB-0001jV-4G; Thu, 11 Jul 2024 02:08:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=bPkrZdO+5Cpbm1sOoQwaQtJUfnWHtkIs4Tz0iZDc3dc=; b=BiC7npgXuawg
 rVjdcfoSNc9QbwVvHxoWc9CxoQX8TtKRGDmGRmWQdlP8S90xLCfiiZNcFb3bPGnlEFmH1DF1+3bOF
 5kZ+I+sFwoeI85JiB0jt5RPGg91m0rZ0HYJqhWAk50AxaisfF9elVNJKU4zFVmXS3MGJqih2ECp8c
 FNkgXJOuwWyV8yJjO8lgl+H/d6zjfF6C3SASChElQ8rrHxuuOCU2RW+HWXOz+R3oIEgcR1D1Qkytf
 bgjlWYdYbjEkHsj1MVKBOUOEzd+JccXKXvpxcRs9NQ/IDx7ud0r/iwfne1FXO5bUhcqtV5G3W0oDT
 UExV9ez1wtZr8X/3UhmFJQ==;
Date: Thu, 11 Jul 2024 09:08:54 +0300
Message-Id: <86frsgmpe1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1a5iotrdy.fsf@HIDDEN> (message from Eshel Yaron on Thu, 
 11 Jul 2024 07:43:53 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN> <m1a5iotrdy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
> Date: Thu, 11 Jul 2024 07:43:53 +0200
> 
> Hi Eli,
> 
> Eli Zaretskii <eliz@HIDDEN> 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.

The reason I think we should go back and discuss that is that in the
beginning there seemed to be some disagreement, but after several
messages it actually sounds like we all agree.  So it would be good to
go back and examine the original idea again.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 11 Jul 2024 05:43:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 01:43:59 2024
Received: from localhost ([127.0.0.1]:50753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRmb1-0000Yv-9R
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 01:43:59 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:43568 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sRmay-0000Ym-8m
 for 71504 <at> debbugs.gnu.org; Thu, 11 Jul 2024 01:43:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1720676636;
 bh=5vusxppnR0S4OOv161Vya7GNDn0lW2zcxQ5KayBKL8M=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=aO/Xq8zLrv79b11ZGXvOCNDw9eIZpc+KElrTowDJDI1dawe/RggVgY32kSSlxSSrq
 rQipEQ0vHb1ZY5nSnyV3rW2Ob5AEanx5TXGY4eDf0Qi3V9ADbkyTB/rOohofWOB7Bf
 i3gHmC4CPK7dUtOIXsI0kYP/llM1zhW/CDea5STvjA6PRV1vHaPDfBpMi5O5iPixZt
 bQmxo9pNUrz0MayKg6WfJLb2+kci9qRy8FjkmP+Fn2n1x1lLVgejvicvn7nPOlrRwS
 i5vVaOltcdBj83cyt9VfUYUC05knuiDKx35r35DWVF5hu0aIEf+N9Bi8hrqIVHNUPv
 Jfd9680N2oYdA==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <861q452s5f.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 07 Jul
 2024 17:28:12 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
 <861q452s5f.fsf@HIDDEN>
Date: Thu, 11 Jul 2024 07:43:53 +0200
Message-ID: <m1a5iotrdy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Eli,

Eli Zaretskii <eliz@HIDDEN> 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.


Thanks,

Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 7 Jul 2024 14:30:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 10:30:36 2024
Received: from localhost ([127.0.0.1]:48917 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQSuS-000113-7b
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 10:30:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37750)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sQSuP-00010s-U8
 for 71504 <at> debbugs.gnu.org; Sun, 07 Jul 2024 10:30:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sQSsA-00044Z-IF; Sun, 07 Jul 2024 10:28:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Rma3EwuEbU5wfIfdTVdsB/KmD2lu+mEKBafW8OqYJGk=; b=L2DnBaHbkp2V
 mykRVdcTBLfIUOGV4nJJg4bUmzdlnwM7aKMteiF82ZMA+OFIAlCn1h3Jr8ggu3Jts9s9NJg5331TN
 jxNCl+V8gz1Cej/QI8CyJLx+EYmgbZ9xsm0I+9rDlnFph3zj9KopIWBZgMtanbc+fVXpolBUDcYLf
 LND7ED7amofmHTV8LznhpkQxNDmVvUlORVdwsZyM1qUXAWsjtkBbqT26Pb5NOQqDJlfJDUagYmoNy
 B4rM3r5xgJJGTBe6KW40YEO/qv28r9mpw3OffPDl+QeaKhNz7BTbZ+DFszG1gcOO2aPG/MDFLfsrw
 E9rVu5N3bYIvQ+bmNb1NEA==;
Date: Sun, 07 Jul 2024 17:28:12 +0300
Message-Id: <861q452s5f.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1bk39zaic.fsf@HIDDEN> (message from Eshel Yaron on Sun, 
 07 Jul 2024 13:50:35 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN> <m1bk39zaic.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
> Date: Sun, 07 Jul 2024 13:50:35 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> It'd be good to enhance compilation buffers as well, but this feature
> >> request is about interaction with Flymake diagnostics, that are shown in
> >> the diagnosed buffer: I'd like to have a standard way to act on (fix)
> >> the diagnostic at point.
> >
> > I frankly don't understand what you are saying here.  Several people
> > opined that we should take a broader view on the fixes and how to
> > handle them, but you insist that Flymake should have its own solution?
> 
> No.  I only insist that there should be a command for fixing the
> Flymake diagnostic at point.  If it's part of a "broader solution",
> that's swell.
> 
> > IOW, the "fixes" diagnostic shown by Flymake is not just diagnostic,
> > it's a suggestion to make some change in the source code.
> 
> I think there is a misunderstanding here: it's not about specific
> diagnostics which represent fixes, this is about enriching
> (potentially) all diagnostics with backend-provided fix suggestions,
> and adding a command that applies such fixes.  For example, with my
> implementation I use the same command for fixing checkdoc, shellcheck
> and LSP diagnostics.
> 
> > So supporting that cannot be separated from the more general concept
> > of making changes proposed by some external tool.  Or what am I
> > missing?
> 
> IIUC, I think I agree.  In my implementation, Flymake delegates the
> application of the code changes to another library, that includes a
> general purpose function for applying code changes.
> 
> > Or maybe this is a simple misunderstanding: what do you mean by
> > "acting on diagnostic at point"
> 
> Applying a suggested code change that resolves the diagnostic.
> 
> > , and how could such an act be indifferent to what and how is fixed?
> 
> A single command should let you fix diagnostics from different sources
> (backends).  It doesn't need to be indifferent, just consistent.
> 
> Does that make sense?

It sounds like we all agree, but then what is the problem?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 7 Jul 2024 11:50:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 07:50:46 2024
Received: from localhost ([127.0.0.1]:47507 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQQPl-0004pq-Pn
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 07:50:46 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:36484 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sQQPj-0004pg-7D
 for 71504 <at> debbugs.gnu.org; Sun, 07 Jul 2024 07:50:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1720353038;
 bh=ooRbIWOKpBgGCH7pDGPRy+9fAbhqh7VfIFiLxTDid9I=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=ZzHOqNxlObM5gsL6NLHQLn5dnABcZJxtjodFbyMkMcw24JXqxEpH9DkhWjTBnHupE
 T+z7tlcM/VmjwlXQqPT4VedpzCbM2CZ2rIeZnfC9FlvN1Jv4JdiRGHexkfmH3BE8gz
 hnO6MgaVkr5og1YQLvz9UUXHkkwZJe8z4dLwPqzhGW8ISgBhSogbRLpC6fPcNYUOLy
 B+I4LR1S4toDfzFxn/7qC5BQWCuBBN04EZjHEj4dNqWmEPyWvn54AU0ErNizREa4eK
 rtCMuZ8HdShKNC+yaZQ3o+Yk5YdIHWLiVkx2uAfP5ir2YwqiQRwhTPzr0sQ8UuxWfk
 89WvdM+/L08GA==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <868qyd32ih.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 07 Jul
 2024 13:44:22 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
 <868qyd32ih.fsf@HIDDEN>
Date: Sun, 07 Jul 2024 13:50:35 +0200
Message-ID: <m1bk39zaic.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
>> Date: Sun, 07 Jul 2024 10:53:12 +0200
>> 
>> >> From: Eshel Yaron <me@HIDDEN>
>> >> Cc: Eli Zaretskii <eliz@HIDDEN>,  71504 <at> debbugs.gnu.org
>> >> Date: Thu, 27 Jun 2024 20:15:37 +0200
>> >> 
>> >> Spencer Baugh <sbaugh@HIDDEN> writes:
>> >>
>> >> > For example, maybe we want to have a command which can accept fixes
>> >> > output by a process running in M-x compile.  Baking the UI into flymake
>> >> > would make that impossible, wouldn't it?
>> >> 
>> >> I don't think adding a command for fixing the diagnostic at point should
>> >> preclude any other developments or explorations.  It's a useful thing to
>> >> have, and many Flymake backends have the needed data readily available.
>> >> 
>> >> > So before any change in flymake I would like to see much more
>> >> > exploration of "fix" UIs which are genuinely flymake-independent.
>> >> 
>> >> Flymake shows diagnostics, and "fixing" is what we do to diagnostics.
>> >> What would be the benefit of a Flymake-independent UI for fixing the
>> >> diagnostics that Flymake already shows?
>> >
>> > The benefit would be that we will be able to use that UI when "fixes"
>> > are shown in, for example, the *compilation* buffer.
>> 
>> It'd be good to enhance compilation buffers as well, but this feature
>> request is about interaction with Flymake diagnostics, that are shown in
>> the diagnosed buffer: I'd like to have a standard way to act on (fix)
>> the diagnostic at point.
>
> I frankly don't understand what you are saying here.  Several people
> opined that we should take a broader view on the fixes and how to
> handle them, but you insist that Flymake should have its own solution?

No.  I only insist that there should be a command for fixing the
Flymake diagnostic at point.  If it's part of a "broader solution",
that's swell.

> IOW, the "fixes" diagnostic shown by Flymake is not just diagnostic,
> it's a suggestion to make some change in the source code.

I think there is a misunderstanding here: it's not about specific
diagnostics which represent fixes, this is about enriching
(potentially) all diagnostics with backend-provided fix suggestions,
and adding a command that applies such fixes.  For example, with my
implementation I use the same command for fixing checkdoc, shellcheck
and LSP diagnostics.

> So supporting that cannot be separated from the more general concept
> of making changes proposed by some external tool.  Or what am I
> missing?

IIUC, I think I agree.  In my implementation, Flymake delegates the
application of the code changes to another library, that includes a
general purpose function for applying code changes.

> Or maybe this is a simple misunderstanding: what do you mean by
> "acting on diagnostic at point"

Applying a suggested code change that resolves the diagnostic.

> , and how could such an act be indifferent to what and how is fixed?

A single command should let you fix diagnostics from different sources
(backends).  It doesn't need to be indifferent, just consistent.

Does that make sense?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 7 Jul 2024 10:44:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 06:44:42 2024
Received: from localhost ([127.0.0.1]:47473 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQPNq-0005tm-14
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 06:44:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52258)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sQPNn-0005tY-AM
 for 71504 <at> debbugs.gnu.org; Sun, 07 Jul 2024 06:44:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sQPNc-0000dT-Oz; Sun, 07 Jul 2024 06:44:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=+gcrUHcxjlRNQymtrvFAE7f+SphLfVG1kUOLf/DcUpE=; b=Xe/V2JF+alGr
 3ptXd+St28Z2kq/xCM6ypZGmUbvx3bHXROwxr+H2LlSkzAVY5qGttJtGDKiW1tzO0ElaLbrSgKIFz
 jlN7lYGZ5EboAqy7fSAVxWWPHFbubCt+tdLPe8vOOf8HniPr3deHahBp/KQF17rk+2kqY6GdB+4LQ
 iqrCg9akHMN1P1i6A7t9Yo6/bHIhr5epcXPX2Rp7B+1qbxwtCNwdwJdfSC82voWSR0Fjz3fJ0kNQs
 5t0clwsVY4UikynsrmM9T3Ej7Y3W7zF/D1hlImd7phhsAvOturQ0Lv99/v1Ql2oWNOhU5hhKmuVvJ
 p0USQ+E0N3hXz79OBkdLhA==;
Date: Sun, 07 Jul 2024 13:44:22 +0300
Message-Id: <868qyd32ih.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1ikxh1t3b.fsf@HIDDEN> (message from Eshel Yaron on Sun, 
 07 Jul 2024 10:53:12 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN> <m1ikxh1t3b.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: sbaugh@HIDDEN,  71504 <at> debbugs.gnu.org
> Date: Sun, 07 Jul 2024 10:53:12 +0200
> 
> >> From: Eshel Yaron <me@HIDDEN>
> >> Cc: Eli Zaretskii <eliz@HIDDEN>,  71504 <at> debbugs.gnu.org
> >> Date: Thu, 27 Jun 2024 20:15:37 +0200
> >> 
> >> Spencer Baugh <sbaugh@HIDDEN> writes:
> >>
> >> > For example, maybe we want to have a command which can accept fixes
> >> > output by a process running in M-x compile.  Baking the UI into flymake
> >> > would make that impossible, wouldn't it?
> >> 
> >> I don't think adding a command for fixing the diagnostic at point should
> >> preclude any other developments or explorations.  It's a useful thing to
> >> have, and many Flymake backends have the needed data readily available.
> >> 
> >> > So before any change in flymake I would like to see much more
> >> > exploration of "fix" UIs which are genuinely flymake-independent.
> >> 
> >> Flymake shows diagnostics, and "fixing" is what we do to diagnostics.
> >> What would be the benefit of a Flymake-independent UI for fixing the
> >> diagnostics that Flymake already shows?
> >
> > The benefit would be that we will be able to use that UI when "fixes"
> > are shown in, for example, the *compilation* buffer.
> 
> It'd be good to enhance compilation buffers as well, but this feature
> request is about interaction with Flymake diagnostics, that are shown in
> the diagnosed buffer: I'd like to have a standard way to act on (fix)
> the diagnostic at point.

I frankly don't understand what you are saying here.  Several people
opined that we should take a broader view on the fixes and how to
handle them, but you insist that Flymake should have its own solution?

IOW, the "fixes" diagnostic shown by Flymake is not just diagnostic,
it's a suggestion to make some change in the source code.  So
supporting that cannot be separated from the more general concept of
making changes proposed by some external tool.  Or what am I missing?

Or maybe this is a simple misunderstanding: what do you mean by
"acting on diagnostic at point", and how could such an act be
indifferent to what and how is fixed?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 7 Jul 2024 08:53:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 04:53:22 2024
Received: from localhost ([127.0.0.1]:47357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQNe6-000334-7s
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 04:53:22 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:51690 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sQNe3-00032v-Ma
 for 71504 <at> debbugs.gnu.org; Sun, 07 Jul 2024 04:53:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1720342395;
 bh=/7UfpAkJsAXk8icHqkFqP8miIEXNt6eDHcH64ZE+CYs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=ieq2wP96eooRl6WyPLu9VXIdijVel/o3iAcu2DhwDfJDeC1oGCO91s0AgeeefC0tQ
 1uOuS5CktOhxEl4fJcDhGhrdlevnFjM2XperW9Ps+6wQjuft4wwOC5a7fsjiWgczsE
 +QIC++D/nMXCPMHmkv20xhBHxiTfF9amn2cB1y+EBy0iG9p86ngoqr7Jd1fnFgttRR
 AxTcQ89FaxQBL9rA108byolM4a4MgoTQ2u6w0sOAseHgqs8xvaG18UFZuFU+GJrkvV
 EdFjeLoUZjUs7iFDVtR5fQ6ksgmKrYP6ECOgYfIoi6ka2CUdoplZy2nSETWUrjewmZ
 SK3oYRoeYcEMQ==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <868qyf5587.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jul
 2024 10:50:32 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
 <868qyf5587.fsf@HIDDEN>
Date: Sun, 07 Jul 2024 10:53:12 +0200
Message-ID: <m1ikxh1t3b.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Eli,

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>,  71504 <at> debbugs.gnu.org
>> Date: Thu, 27 Jun 2024 20:15:37 +0200
>> 
>> Spencer Baugh <sbaugh@HIDDEN> writes:
>>
>> > For example, maybe we want to have a command which can accept fixes
>> > output by a process running in M-x compile.  Baking the UI into flymake
>> > would make that impossible, wouldn't it?
>> 
>> I don't think adding a command for fixing the diagnostic at point should
>> preclude any other developments or explorations.  It's a useful thing to
>> have, and many Flymake backends have the needed data readily available.
>> 
>> > So before any change in flymake I would like to see much more
>> > exploration of "fix" UIs which are genuinely flymake-independent.
>> 
>> Flymake shows diagnostics, and "fixing" is what we do to diagnostics.
>> What would be the benefit of a Flymake-independent UI for fixing the
>> diagnostics that Flymake already shows?
>
> The benefit would be that we will be able to use that UI when "fixes"
> are shown in, for example, the *compilation* buffer.

It'd be good to enhance compilation buffers as well, but this feature
request is about interaction with Flymake diagnostics, that are shown in
the diagnosed buffer: I'd like to have a standard way to act on (fix)
the diagnostic at point.


Thanks,

Eshel






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 6 Jul 2024 07:52:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 03:52:55 2024
Received: from localhost ([127.0.0.1]:45524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ0E2-0005jX-VY
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:52:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34762)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sQ0E0-0005jJ-TJ
 for 71504 <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:52:53 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sQ0Bl-0007D5-KS; Sat, 06 Jul 2024 03:50:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=QxTHfiJMBY963l0nufbjpH9lSHqO08H+3CnbibW4xL8=; b=Od/Rhv5nw0e+
 5bYddeaOmfxcsayVLH33BBHIMcx690zRomaM0fCaBsO3FjPW/P7vsND6+279pd63b/jDhZfr+8Dgw
 pJ8M4I8hBqS081kMMJZahpyu4VLwxh7Ae+2Eb0kiIhI+h1GnnZB+5K3EbXog/VjGrWuYmwEWAeL9E
 KQWR1n9ik7ROKgnKO1tX/EI1ThsgwDWy9k7joRPcijH8DBhI3vH07B7/KU3kdPg9tOhyv5pQAGnU2
 +6M3Ik8uWZisnDhqe7ufmhPgqUMChuciXKi1T45rgy367MKFkzG1p1KbJqsiQIBdlMA1aA8+HKqdc
 2p2ZNjP1+X+RrFXF/LDKAw==;
Date: Sat, 06 Jul 2024 10:50:32 +0300
Message-Id: <868qyf5587.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1cyo2ckvq.fsf@HIDDEN> (message from Eshel Yaron on Thu, 
 27 Jun 2024 20:15:37 +0200)
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN> <m1cyo2ckvq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: sbaugh@HIDDEN, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Eshel Yaron <me@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  71504 <at> debbugs.gnu.org
> Date: Thu, 27 Jun 2024 20:15:37 +0200
> 
> Spencer Baugh <sbaugh@HIDDEN> writes:
> 
> > Eli Zaretskii <eliz@HIDDEN> writes:
> >>> Date: Wed, 12 Jun 2024 10:43:14 +0200
> >>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
> >>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >>> 
> >>> Following a recent short discussion[0] on emacs-devel, I'm opening this
> >>> feature request so it doesn't get lost:
> >>> 
> >>> Flymake should provide a standard way for backends to associate fix
> >>> suggestions with the diagnostics they produce, along with a
> >>> backend-agnostic user interface (e.g. a command) for examining and
> >>> applying such fixes.
> >>> 
> >>> I suggested a possible implementation that works quite well for me
> >>> (with the three backends I've adapted so far - checkdoc, shellcheck
> >>> and Eglot), but any other solution that gives various backends a
> >>> standard way to provide their fixes would be just as welcome.
> 
> [...]
> 
> > I also think we have not sufficiently explored different UI
> > possibilities, and I think adding to flymake now will limit us in what
> > UI possibilities we can explore, no matter how generic we try to be.
> > And that UI exploration can happen without adding to flymake.
> >
> > For example, maybe we want to have a command which can accept fixes
> > output by a process running in M-x compile.  Baking the UI into flymake
> > would make that impossible, wouldn't it?
> 
> I don't think adding a command for fixing the diagnostic at point should
> preclude any other developments or explorations.  It's a useful thing to
> have, and many Flymake backends have the needed data readily available.
> 
> > So before any change in flymake I would like to see much more
> > exploration of "fix" UIs which are genuinely flymake-independent.
> 
> Flymake shows diagnostics, and "fixing" is what we do to diagnostics.
> What would be the benefit of a Flymake-independent UI for fixing the
> diagnostics that Flymake already shows?

The benefit would be that we will be able to use that UI when "fixes"
are shown in, for example, the *compilation* buffer.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 27 Jun 2024 18:15:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 27 14:15:48 2024
Received: from localhost ([127.0.0.1]:43336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sMtet-0000Yc-PU
	for submit <at> debbugs.gnu.org; Thu, 27 Jun 2024 14:15:48 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:53330 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sMteq-0000YQ-So
 for 71504 <at> debbugs.gnu.org; Thu, 27 Jun 2024 14:15:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1719512140;
 bh=EOWYNk2DqvN7ie+NfLULfcLmTlQDSBFolLnRIzkDLJs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=YatQyot39qeU5MD+GbwVkvFZaPDHkyulq5Z519EgX5nFtuZ6BRy/+/mJDgb/hYCy2
 j8NICrxYSZKka4JV7Ar20K5vmKwJv8LbnuS4JMsiRxvBxC6tkGULbm16QSKcEbdNbz
 aaB2TM10FhrdDNIVP0wicsqNv2x1KMqVPUWp9JBMWgoO+913xGPyjhIcRgOMsf+2Z1
 B+WQVuo4vKgRsxxeeUcL3rLl4FH76cFq3pTjWWt+2u9rKDCUXaoXXmLe82X6Fl1Wql
 GPFqouJYK8T/OwXoKmrKhUNfWPUASiH0hSAxE2N5eErZnUaSYWU2GOtdG/BPra1pdw
 yMVjINA8W8rFA==
From: Eshel Yaron <me@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <ier5xtuwlsp.fsf@HIDDEN> (Spencer Baugh's message of
 "Thu, 27 Jun 2024 09:35:34 -0400")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
 <ier5xtuwlsp.fsf@HIDDEN>
X-Hashcash: 1:20:240627:eliz@HIDDEN::8irOpG5Ler5C5W7E:0Cz3
X-Hashcash: 1:20:240627:71504 <at> debbugs.gnu.org::05HMtpaAbHNveN8N:7Um4
X-Hashcash: 1:20:240627:sbaugh@HIDDEN::7+VG+g96Ns3daYhO:9RAK
Date: Thu, 27 Jun 2024 20:15:37 +0200
Message-ID: <m1cyo2ckvq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: Eli Zaretskii <eliz@HIDDEN>, 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Spencer,

Thanks for taking a look.

Spencer Baugh <sbaugh@HIDDEN> writes:

> Eli Zaretskii <eliz@HIDDEN> writes:
>>> Date: Wed, 12 Jun 2024 10:43:14 +0200
>>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>>> 
>>> Following a recent short discussion[0] on emacs-devel, I'm opening this
>>> feature request so it doesn't get lost:
>>> 
>>> Flymake should provide a standard way for backends to associate fix
>>> suggestions with the diagnostics they produce, along with a
>>> backend-agnostic user interface (e.g. a command) for examining and
>>> applying such fixes.
>>> 
>>> I suggested a possible implementation that works quite well for me
>>> (with the three backends I've adapted so far - checkdoc, shellcheck
>>> and Eglot), but any other solution that gives various backends a
>>> standard way to provide their fixes would be just as welcome.

[...]

> I also think we have not sufficiently explored different UI
> possibilities, and I think adding to flymake now will limit us in what
> UI possibilities we can explore, no matter how generic we try to be.
> And that UI exploration can happen without adding to flymake.
>
> For example, maybe we want to have a command which can accept fixes
> output by a process running in M-x compile.  Baking the UI into flymake
> would make that impossible, wouldn't it?

I don't think adding a command for fixing the diagnostic at point should
preclude any other developments or explorations.  It's a useful thing to
have, and many Flymake backends have the needed data readily available.

> So before any change in flymake I would like to see much more
> exploration of "fix" UIs which are genuinely flymake-independent.

Flymake shows diagnostics, and "fixing" is what we do to diagnostics.
What would be the benefit of a Flymake-independent UI for fixing the
diagnostics that Flymake already shows?


Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 27 Jun 2024 13:35:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 27 09:35:44 2024
Received: from localhost ([127.0.0.1]:41289 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sMpHs-0001FP-3F
	for submit <at> debbugs.gnu.org; Thu, 27 Jun 2024 09:35:44 -0400
Received: from mxout6.mail.janestreet.com ([64.215.233.21]:49817)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1sMpHq-0001FB-Sa
 for 71504 <at> debbugs.gnu.org; Thu, 27 Jun 2024 09:35:43 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71504: 30.0.50; FR: Fix suggestions ("quick fix") for
 Flymake diagnostics
In-Reply-To: <865xtu7seh.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Jun
 2024 10:32:06 +0300")
References: <m1ikye5z6l.fsf@HIDDEN> <865xtu7seh.fsf@HIDDEN>
Date: Thu, 27 Jun 2024 09:35:34 -0400
Message-ID: <ier5xtuwlsp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1719495334;
 bh=uPebfm99fXIxdTw+rFik2U99G/AKbPLN5HtGjftvx4k=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=XelvV0i5liwsMyvfYig5NHvMD1mGZdlA5D8H0tkeOZrDsvfAEUXH8y2nHpSDnhfFY
 0AntaYIrUlRf4W6gbX1tTypkBxShsNrz79fAd1gTcU9nEA30JkxBkbsJDFTDaQp9qZ
 GoJR6Fll4rL7f68TiftwritwU0NMYu1zg+sdv4pJ4qRbGf226awxwuAE+h05aLRI7+
 CBuobHcdrmjPVMH9D9WPY8RuDctstRCgS0ceQITCjZblv7eQXlvhWUGdxudwi8ICQH
 oEv8VaUl6b6MDOuo6CbkC5WRrPtxlY3Y2Pi3fwPKn2GUePWGCHchMgM4XaRV1BDeXD
 V+OS4IVzeLgug==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71504
Cc: 71504 <at> debbugs.gnu.org, Eshel Yaron <me@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:
>> Date: Wed, 12 Jun 2024 10:43:14 +0200
>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> Following a recent short discussion[0] on emacs-devel, I'm opening this
>> feature request so it doesn't get lost:
>> 
>> Flymake should provide a standard way for backends to associate fix
>> suggestions with the diagnostics they produce, along with a
>> backend-agnostic user interface (e.g. a command) for examining and
>> applying such fixes.
>> 
>> I suggested a possible implementation that works quite well for me
>> (with the three backends I've adapted so far - checkdoc, shellcheck
>> and Eglot), but any other solution that gives various backends a
>> standard way to provide their fixes would be just as welcome.
>> 
>> 
>> Thanks and best regards,
>> 
>> Eshel
>> 
>> 
>> [0] https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01137.html
>
> Spencer, any comments or suggestions?
>
> Thanks.

I basically agree with Joao's views in the linked thread.  It is already
possible to associate arbitrary data and actions with flymake
diagnostics by adding overlay properties, as Joao mentioned.

I also think we have not sufficiently explored different UI
possibilities, and I think adding to flymake now will limit us in what
UI possibilities we can explore, no matter how generic we try to be.
And that UI exploration can happen without adding to flymake.

For example, maybe we want to have a command which can accept fixes
output by a process running in M-x compile.  Baking the UI into flymake
would make that impossible, wouldn't it?

So before any change in flymake I would like to see much more
exploration of "fix" UIs which are genuinely flymake-independent.  And
fit in well with existing Emacs functionality, rather than just porting
VSCode and LSP patterns.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at 71504 <at> debbugs.gnu.org:


Received: (at 71504) by debbugs.gnu.org; 27 Jun 2024 07:32:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 27 03:32:19 2024
Received: from localhost ([127.0.0.1]:40890 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sMjcB-0005tE-AZ
	for submit <at> debbugs.gnu.org; Thu, 27 Jun 2024 03:32:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43580)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sMjc9-0005t1-BI
 for 71504 <at> debbugs.gnu.org; Thu, 27 Jun 2024 03:32:17 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sMjc0-0004Cw-SD; Thu, 27 Jun 2024 03:32:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=NKOWTgZEQqk9rnfpAm2nJh/i8d99mFPTBl9mWf+Jx6c=; b=RTQLLKb8o9cf
 4nSZdWv34V3ta1B/65QQurLxhURUVvdmSluOQvj5rstMR7ufFIHOQ9Rr1u1A/v5rIbzS89MDImSVx
 UEED/n/hQWPgHm/AnEYv5DrFh2OvRwmky88M5WwBcwzVfS8ljtihk9Q0VOtunm5ce+cdiTbQBSt0G
 qtD0b5ID03SFmISYZMlawLeEaMs8JqJc7Np3GnyZaqNKnQ9RypKDcoinJJ3eg8Yqv9fkEbPY4IUB3
 oOGfAnpQh+e+rZ5EoFDKZ9zM6GZ6G+FjOuiFtxlfJe3w/OR+jlZuTZKqfGnZfcpAK/bvdzcJf1HOh
 aVvUa9zPntjlrlTCy4icsg==;
Date: Thu, 27 Jun 2024 10:32:06 +0300
Message-Id: <865xtu7seh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>, Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <m1ikye5z6l.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#71504: 30.0.50;
 FR: Fix suggestions ("quick fix") for Flymake diagnostics
References: <m1ikye5z6l.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71504
Cc: 71504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 12 Jun 2024 10:43:14 +0200
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Following a recent short discussion[0] on emacs-devel, I'm opening this
> feature request so it doesn't get lost:
> 
> Flymake should provide a standard way for backends to associate fix
> suggestions with the diagnostics they produce, along with a
> backend-agnostic user interface (e.g. a command) for examining and
> applying such fixes.
> 
> I suggested a possible implementation that works quite well for me
> (with the three backends I've adapted so far - checkdoc, shellcheck
> and Eglot), but any other solution that gives various backends a
> standard way to provide their fixes would be just as welcome.
> 
> 
> Thanks and best regards,
> 
> Eshel
> 
> 
> [0] https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01137.html

Spencer, any comments or suggestions?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jun 2024 08:43:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 04:43:20 2024
Received: from localhost ([127.0.0.1]:37510 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sHJZg-00062f-A1
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2024 04:43:20 -0400
Received: from lists.gnu.org ([209.51.188.17]:34218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1sHJZe-00062Y-Ej
 for submit <at> debbugs.gnu.org; Wed, 12 Jun 2024 04:43:18 -0400
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 <me@HIDDEN>) id 1sHJZf-0004Pv-EK
 for bug-gnu-emacs@HIDDEN; Wed, 12 Jun 2024 04:43:19 -0400
Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1sHJZd-0003Qu-IW
 for bug-gnu-emacs@HIDDEN; Wed, 12 Jun 2024 04:43:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1718181796;
 bh=sk5bP1dIuy7DkbdJuWKC9J9k6kN6EaH014OpWwkRDks=;
 h=From:To:Subject:Date:From;
 b=SnhiQl8bG82WTq31q+LN1LRI7r5xTc0YBTxHs3+fqWQQN1k+1x8PjjG1tvKpx/FS5
 CCwjr+0TiRrpq/ed6FlnyXDJmlSAF1PPk7Zze4wFwqlbbl6E6bKOEk811c057h7kuq
 ZMNztzlgQdOwXQrNIxhL/6CBsplUGOKwUNBEmfASQ9g2VWSPsBImL8P8728926A/Jd
 t5OmcqMbNh5MaIPoLu5I2NSTsiOPr51yYvy8gaUT7Gf5gW5uyb8HYSO1y+uqLPw3wD
 aj31AN2wDoU+/ebgSnlemjgV0KIVDOQAdjtON/ATxpI7ML2Iu69DiVE94d65s/DSzL
 ApJVRm5lOc2zQ==
From: Eshel Yaron <me@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; FR: Fix suggestions ("quick fix") for Flymake diagnostics
X-Debbugs-Cc: 
Date: Wed, 12 Jun 2024 10:43:14 +0200
Message-ID: <m1ikye5z6l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@HIDDEN;
 helo=eshelyaron.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Following a recent short discussion[0] on emacs-devel, I'm opening this
feature request so it doesn't get lost:

Flymake should provide a standard way for backends to associate fix
suggestions with the diagnostics they produce, along with a
backend-agnostic user interface (e.g. a command) for examining and
applying such fixes.

I suggested a possible implementation that works quite well for me
(with the three backends I've adapted so far - checkdoc, shellcheck
and Eglot), but any other solution that gives various backends a
standard way to provide their fixes would be just as welcome.


Thanks and best regards,

Eshel


[0] https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01137.html




Acknowledgement sent to Eshel Yaron <me@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#71504; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 25 Jul 2024 09:15:02 UTC

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