From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add facility to collect stderr of async subprocess Date: Tue, 31 Mar 2015 16:27:10 +0900 Message-ID: References: <87d24d3uwz.fsf-ueno@gnu.org> <83pp87y6iu.fsf@gnu.org> <83mw3bxz9f.fsf@gnu.org> <83k2yfx8zi.fsf@gnu.org> <83egomxog1.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427786866 16980 80.91.229.3 (31 Mar 2015 07:27:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 07:27:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 31 09:27:44 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YcqaE-0005gQ-3S for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 09:27:34 +0200 Original-Received: from localhost ([::1]:37333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcqaD-0002mI-2x for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 03:27:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcqZw-0002mD-5z for emacs-devel@gnu.org; Tue, 31 Mar 2015 03:27:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcqZu-0002xU-Uh for emacs-devel@gnu.org; Tue, 31 Mar 2015 03:27:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcqZu-0002xM-RE for emacs-devel@gnu.org; Tue, 31 Mar 2015 03:27:14 -0400 Original-Received: from du-a.org ([2001:e41:db5e:fb14::1]:36877 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YcqZu-0003tF-1H; Tue, 31 Mar 2015 03:27:14 -0400 In-Reply-To: <83egomxog1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Mar 2015 18:25:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184589 Archived-At: Hello Eli, Eli Zaretskii writes: >> So, let's start with small (but common) things. The attached patch adds >> a new keyword `:stderr' to `make-process'. The argument can be either a >> buffer or a (newly introduced) pipe process. > > Do you expect this to work on Windows? If so, then there's at least > some part of "having higher layers DTRT" I failed to adequately > explain ;-) > > Redirection of stderr does indeed work on the lowest level of creating > subprocesses on MS-Windows, but we don't expect to read from a pipe > connected to child's stderr, and thus the 'pselect' emulation watches > only one file handle per sub-process. This needs to be expanded. Sorry for my ignorance about Windows and thanks for writing up the detail comment in commit 22ece83a. It is very helpful. > In addition, this: > >> (let ((stderr (make-pipe-process :name "stderr"))) >> (make-process :name "test" >> :buffer (current-buffer) >> :command (list (expand-file-name "./test.sh")) >> :stderr stderr) >> (set-process-filter stderr ...)) > > introduces a new concept whereby a process object ('stderr' in this > case) can be passed to another subprocess, which AFAIK was not > possible until now, at least not on MS-Windows. I don't get your concern here. The above code is merely meant to pass the actual FD of the child end of pipe, through an opaque Lisp object `stderr'. > Volunteers are welcome to work on this, of course. I've just set up MSYS2 and tried the Emacs w64 build instruction[1] (and also obtained a copy of Hart's book). Let me try again later. Footnotes: [1] http://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/ Regards, -- Daiki Ueno