Subject: Re: bug#51437: 29.0.50; The annotated example of a complete working Flymake backend does not work with narrowed buffers

From: Rudolf Adamkovič <[email-masked]>
Date: Thu, 04 Nov 2021 23:41:08 +0100

João Távora <[email-masked]> writes:

> This is starting to sound like a more generic Flymake limitation/bug
> than a documentation bug. I'll have a look when I get home.

True.

> Have you experimented with the 'region' arg when reporting back
> diagnostics? Also you can have a look at how the Elisp backend does
> it? I think, though I am not sure, that it works with narrowed
> buffers.

I did not dig that deep yet. :)

> By the way, Flymake for spell checking is a great idea. Is your
> backend available somewhere?

I use Vale to check on my writing (style and spelling) as follows:

┌────
│ (with-eval-after-load 'flymake
│   (my-define-flymake-backend
│    my-flymake-vale
│    (lambda (file) (list "vale" "--output" "line" "--ext" ".md" "--no-wrap"))
│    "^stdin.md:\\([0-9]+\\):\\([0-9]+\\):\\(.*\\)$"
│    (lambda (msg) t)))
└────

I dislike the idea of unnecessary "backend packages", and I think Flymake should empower the user to plug in any CLI tool in a couple of minutes. No packages, no complicated functions with `make-process', and so on. Instead, make simple asynchronous live buffer checking simple. Then, everyone will plug in their linters, unit test runners, style/spell-checkers, and the like. As of now, Flymake fights such a user. For instance, I use the same macro for everything else, including programming:

┌────
│ (with-eval-after-load 'flymake
│     (my-define-flymake-backend
│      my-flymake-swiftlint
│      'my-flymake-swiftlint-command
│      "^<nopath>:\\([0-9]+\\):\\([0-9]+\\): \\(.*\\)$"
│      (lambda (msg) (string-match "^warning" msg))))
└────

TL;DR Vanilla Flymake makes it unnecesserily hard to plug in a simple CLI utility for buffer checking.

Rudy
-- 
"I love deadlines. I love the whooshing noise they make as they go by." -- Douglas Adams, The Salmon of Doubt

Rudolf Adamkovič <[email-masked]>
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]