7

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.

4
  • 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.
    – wasamasa
    Feb 4 '15 at 19:19
  • 1
    Not to be nitpicky, but the body and title are somewhat different questions here. :-)
    – Malabarba
    Feb 4 '15 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.
    – wasamasa
    Feb 4 '15 at 20:21
  • 4
    Why never ? (That's all I have to say.)
    – politza
    Feb 4 '15 at 20:25
3

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.

2
  • 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 '17 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.
    – narendraj9
    Jul 4 '20 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.