Re: [GNU ELPA] New package: flymake-harper

João Távora <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Eshel Yaron <[email protected]> writes:

>> - make Flymake error category symbols for harper diagnostics
>> - when making diagnostics, add the correction meta-info (I presume it is
>>   available) in the flymake-make-diagnostic call
>> - use flymake-overlay-control on those category symbols.  Add a keymap,
>> - make a new flymake-harper command and put it on the map.  The command
>>   uses meta-info and does the correction
>> - the map is activated when you click the flymake overlay
>>
>> If you want to autocorrect a number of diagnostics, make a command that
>> uses flymake-diagnostics to get all diags in a region and iterate.
>
> That's a viable solution for this particular backend, but in general
> that's IMO way too much work for a backend, and it's still not enough:
> you also need to choose keybindings, tell users about them, etc.  And
> every backend needs to do all that separately.  That's not quite
> "reasonably straightforward", sorry.

Well, I asked reasonably dumb llm to implement this, and it did pretty
easily follow Flymake's manual and my little guide above to make a full
100loc backend with the aforemention correction capability.  See
attached flymake-straightforward.el, it uses ripgrep to flag for the
word "straight" and correct it to "str8".

> The only thing backends should worry about is providing the fix data;
> the frontend should take care of all UI business.

Nothing against that, but making a "one size fits all" is usually hard.
There are other ways to skin a cat.  LSP the most obvious way and the
reason investing in a that flymake.el correction UI overhaul is probably
a waste of time: Eglot already gives you a UI does it for you.  Yet
another is describing convention in the manual and following it.  You
may have library facilities that reduce the churn for backends to follow
those conventions (though it's not really that much).  But sure,
eglot--mouse-call should be library function, not in flymake.el.  Then
you need a lib function could to add things to the margin/fringe in
non-conflicting ways, that's another largely unresolved can of worms,
also doesn't belong to flymake.  I'd focus on that.

João
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.