|
From: | Dmitry Gutov |
Subject: | Re: Adding Flycheck to NonGNU ELPA |
Date: | Fri, 23 Feb 2024 23:09:53 +0200 |
User-agent: | Mozilla Thunderbird |
On 23/02/2024 18:20, Spencer Baugh wrote:
From looking at ruby-flymake--helper, maybe it would be best to have a new helper for working with processes. It looks like ruby-flymake--helper just wants to: 1. Send the current buffer text to a process. 2. When the process exits cleanly, call a callback with all the process's output. It seems like we could add a helper that supports that. Then ruby-flymake--helper would disappear in favor of some process-run-and-call function.
Some kind of helper that covers the existing variations is indeed what I was thinking of. Though maybe (additionally) a macro version with a terse syntax would appeal to some, too.
Or... IMO, even better than a helper would be using Elisp threads for this. Then there's no need for any callback stuff. Really, threads are a natural fit for flymake, since flymake already provides a UI which can display data computed asynchronously by threads, and that's IMO the hardest part of using threads.
I'm not sure about Lisp threads for this particular purpose because they carry their own complexity (flakier error handling, for example), and the asynchrony requirement is solved by the current callback-based interface. I think threads can bring more value where you would be able to write code in a sequential fashion, while having it executed asynchronously (unrelatedly, one of the subjects you touched on in bug#69188). But maybe I'm wrong, you're welcome to show otherwise, maybe with a code example.
[Prev in Thread] | Current Thread | [Next in Thread] |