help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with remote async processes.


From: Ergus
Subject: Re: Issue with remote async processes.
Date: Sun, 27 Mar 2022 22:46:19 +0200

On Sun, Mar 27, 2022 at 09:22:53AM +0200, Michael Albinus wrote:
Ergus <spacibba@aol.com> writes:

Hi,

Sorry to bother... I have another question. When we use process-file and
start-file-process with tramp, how can we get the error output in a
buffer?

The argument BUFFER can be a list. The car is the output (string or
buffer), the cdr is the stderr (just a string, a filename).

--8<---------------cut here---------------start------------->8---
(let ((default-directory "/ssh::")
     (output (generate-new-buffer "*Output*"))
     (stderr "/ssh::/tmp/xxx"))
 (process-file "echo" nil (list output stderr) nil "Hallo")
 (process-file "echa" nil (list output stderr) nil "Holla")
 (find-file stderr))
--8<---------------cut here---------------end--------------->8---

In start-file-process, it is similar. The difference is, that stderr can
be either a string (filename) or a buffer.

--8<---------------cut here---------------start------------->8---
(let ((default-directory "/ssh::")
     (output (generate-new-buffer "*Output*"))
     (stderr (generate-new-buffer "*Stderr*")))
 (start-file-process "test1" (list output stderr) "echo" "Hallo")
 (start-file-process "test2" (list output stderr) "echa" "Holla"))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.

Very thanks Michael... This is useful.

What's reason process-file doesn't support to use a buffer for stderr?

Performance? Technical?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]