emacs-deferred icon indicating copy to clipboard operation
emacs-deferred copied to clipboard

Is there a way to extract the stderr of a process that returns a non-zero status code?

Open MiloDavis opened this issue 7 years ago • 2 comments

I'm writing an emacs mode that relies on a parser that returns a non-zero status code if there are certain types of parsing errors. I'd like to extract the stderr output in these cases, however the best I've been able to figure out how to do is to extract the text that also specifies that there has been an error within the deferred library.

Looking in the source code, it looks like the message is immediately run through a format function. Is there a way to get the stderr output without having to parse this string?

MiloDavis avatar Aug 15 '17 16:08 MiloDavis

Hi @MiloDavis In the current implementation, there is no method to receive stdout output and stderr one separately, because previous emacs doesn't provide any convenient function.

From emacs 25, we can use make-process to handle stderr output in elisp. So, we need the wrapper function for make-process like deferred:process which wraps start-process. However, I'm not familiar enough with make-process, so, I think it is not trivial for me to design the deferred wrapper function. I'm sorry I don't have time to do that soon.

Your PR is welcome.

kiwanami avatar Aug 17 '17 07:08 kiwanami

I'll see if I can figure out how to do it. Thanks for the response.

MiloDavis avatar Aug 18 '17 08:08 MiloDavis