From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Redirecting standard output Date: Fri, 22 Apr 2011 01:50:47 -0400 Message-ID: References: <83oc402ky4.fsf@gnu.org> <8362q73dap.fsf@gnu.org> <876FF1E0-A9BB-4804-845C-46947AC085EE@swipnet.se> <4DB08348.3040208@lanl.gov> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1303451462 12405 80.91.229.12 (22 Apr 2011 05:51:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Apr 2011 05:51:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 22 07:50:58 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QD9Gb-0005Sl-Is for ged-emacs-devel@m.gmane.org; Fri, 22 Apr 2011 07:50:57 +0200 Original-Received: from localhost ([::1]:37519 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD9Ga-0008GZ-SB for ged-emacs-devel@m.gmane.org; Fri, 22 Apr 2011 01:50:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD9GX-0008GS-1K for emacs-devel@gnu.org; Fri, 22 Apr 2011 01:50:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QD9GR-0001nf-Ud for emacs-devel@gnu.org; Fri, 22 Apr 2011 01:50:52 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:57653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD9GR-0001nb-T2 for emacs-devel@gnu.org; Fri, 22 Apr 2011 01:50:47 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QD9GR-0006Vv-OE for emacs-devel@gnu.org; Fri, 22 Apr 2011 01:50:47 -0400 In-reply-to: (message from Lars Magne Ingebrigtsen on Thu, 21 Apr 2011 21:31:58 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:138634 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Thu, 21 Apr 2011 21:31:58 +0200 > > Davis Herring writes: > > > You can call `pipe' more than once; the trouble comes when you have to > > choose which one to read from to avoid blocking the process. Probably > > it's just that no one has bothered to implement it carefully enough with > > `select' or so. > > Oh, I see... I was a bit confused about how pipe worked. Yes, that > makes sense. Just hook up the STDERR endpoint to a pipe, too, and > you're in business. > > For the MSDOS case (with STDERR-to-buffer), we'd just have to open > another temp file, just like we do with STDOUT, so that's a very minor > change. > > For the non-MSDOS case, using two pipes and select shouldn't be too > difficult to implement, I think? You are in danger of reinventing the wait_reading_process_output wheel. I'm not sure that kind of complexity is justified for such a marginal need, just for the sake of theoretical completeness and/or symmetry between stdout and stderr. I think redirecting to a temporary file and then reading from there is more than adequate, and all but indistinguishable from the user POV (since we wait for the process to exit anyway). > Or are there gotchas when using select in Emacs? wait_reading_process_output already uses select, so adding another one is probably not a good idea.