Copy link
@alphapapa

alphapapa Aug 16, 2021

Author Owner

@skeeto Chris, this may be somewhat of a "blast from the past" for you, but I thought you might be interested in this change. It's so simple, to block on the curl process's output and completion this way.

I found this trick (if it even qualifies as one) in the Elisp manual by accident (I mean, maybe I should have re-read the whole section on processes, but who does that?).

And I discovered that after foolishly trying and failing to hack up a solution using Elisp threads, mutexs, and condition variables. It seemed like it should have worked! And it seemed reasonably clever! But, of course, if it were that easy, someone would have done it before. All it did was completely hang Emacs, so not even SIGUSR2 woke it, but only SIGKILL worked.

So then I found this trick in the Elisp manual when I typed some process-related word into a Helm-Info command, and it seems to work very well. It's not as, er...clever as using your aio library, which always intrigues me, but I still haven't really grokked it yet. :)