unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 51437@debbugs.gnu.org
Subject: bug#51437: 29.0.50; The annotated example of a complete working Flymake backend does not work with narrowed buffers
Date: Thu, 04 Nov 2021 23:41:08 +0100	[thread overview]
Message-ID: <m2ilx78ry3.fsf@me.com> (raw)
In-Reply-To: <CALDnm52hqwZPPpZRPcEs3L+brDF=nj+qs2iKunWD9nrOr6sLCg@mail.gmail.com>

João Távora <joaotavora@gmail.com> 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č <salutis@me.com>
Studenohorská 25
84103 Bratislava
Slovakia

[he/him]





  reply	other threads:[~2021-11-04 22:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 13:01 bug#51437: 29.0.50; The annotated example of a complete working Flymake backend does not work with narrowed buffers Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-29 13:35 ` Lars Ingebrigtsen
2021-10-29 18:07   ` João Távora
2021-10-30 21:15     ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31  9:26       ` João Távora
2021-11-04 22:41         ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-10  4:53       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ilx78ry3.fsf@me.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=51437@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=larsi@gnus.org \
    --cc=salutis@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).