Re: [GNU ELPA] New package: flymake-harper
Eshel Yaron <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <[email protected]> |
João Távora <[email protected]> writes: > 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". Sure, it's doable, but it can be much easier, so backend authors like Philip will actually provide the fixes they have readily available. In your example, the infrastructure in my Flymake allows me to delete half of the code in your flymake-straightforward.el and get basically the same result. Only f-s--proc and f-s-backend (with one added line) are needed (see below). In other words, just the backend proper. :) Eshel
flymake-straightforward.el
(application/emacs-lisp, 2.9 KB) - not displayed