Is there a reason so few packages seem to use transaction queues (tq-enqueue
etc.) for communication with external processes? Most of the packages I have looked at seem to prefer the regular filter mechanism.
-
I suspect a combination of people just skipping that part of the manual or just reading about filters and transaction queues looking weird and not being powerful/flexible enough.– wasamasaFeb 4, 2015 at 19:19
-
1Not to be nitpicky, but the body and title are somewhat different questions here. :-)– MalabarbaFeb 4, 2015 at 20:09
-
To keep it in line with my sentiment and to answer the titular question: Never. Unless you're maintaining legacy code using it.– wasamasaFeb 4, 2015 at 20:21
-
4Why never ? (That's all I have to say.)– politzaFeb 4, 2015 at 20:25
1 Answer
One thing to know about Emacs is that there are a lot of obscure libraries that come with it. And, far from being a historical oddity, more go into the tree all the time. Many times these were written for a single use.
There's no single reason such things aren't reused. Maybe it didn't fit some uses, maybe some authors didn't know of it, etc. In your case for tq.el
the answer is the same -- use it if it is a good fit for your problem. To me it seems a bit under-general; e.g., there's no way to queue a regexp without also sending a string. Also it's a bit old-fashioned with the "closure" arguments; these are unnecessary now that Emacs has lexical binding.
There's also some library duplication in Emacs. So for example there are both ewoc.el
and tabulated-list.el
, two different ways to accomplish a sort of MVC-ish task.
-
Indeed, I had no idea this library existed! Emacs really has too much stuff built-in--the current plan to extract things into ELPA is definitely a good idea. May 11, 2017 at 17:54
-
Is there any other built-in library providing answer question boundaries to the communication between Emacs and a sub-process like transaction queues? As far as I understand, the default filter functions can be called with arbitrarily sized chunks of the output produced by the sub-process. Jul 4, 2020 at 23:20