kiwanami / emacs-deferred

Simple asynchronous functions for emacs lisp
GNU General Public License v3.0
312 stars 43 forks source link

W stderr #49

Closed Wojtek242 closed 7 years ago

Wojtek242 commented 7 years ago

Hi,

I wanted deferred:process functions to return an exit-code as well as a separate stderr message. Unfortunately, start-process does not support stderr so I had to use make-process which gets called in a different way which is why I moved some code out of process-buffer-gen into their own functions.

My own criticism is that process-buffer-gen returns different types of values depending on input (a list if called with 'make-process and a single buffer if called with 'start-process 'start-process-shell-command), but I was struggling to find a nicer way to do it without having to repeat a bunch of code. At the same time, since it's only an internal function, this isn't so bad. If you would have advice or a preference on this point, I'd be happy to fix the code.

I've also added tests for the new code.

Cheers, Wojtek242

Wojtek242 commented 7 years ago

Well, looks like make-process is not available in Emacs 24. Hmm, I'll try to think of some alternatives...

Wojtek242 commented 7 years ago

Closing as this will have to wait until Emacs 24 is not required - will soon submit a simpler version which should work on Emacs 24.