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: Sat, 07 May 2011 15:10:03 +0300 Message-ID: <83wri2k8ys.fsf@gnu.org> References: <83oc402ky4.fsf@gnu.org> <8362q73dap.fsf@gnu.org> <876FF1E0-A9BB-4804-845C-46947AC085EE@swipnet.se> <4DB08348.3040208@lanl.gov> <83ei4sbuf3.fsf@gnu.org> <4DB3DFC1.7040303@swipnet.se> <83zkmykamq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1304770236 23120 80.91.229.12 (7 May 2011 12:10:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 May 2011 12:10:36 +0000 (UTC) To: larsi@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 07 14:10:31 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 1QIgL9-0000iP-CB for ged-emacs-devel@m.gmane.org; Sat, 07 May 2011 14:10:31 +0200 Original-Received: from localhost ([::1]:56200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIgL8-0001gI-R6 for ged-emacs-devel@m.gmane.org; Sat, 07 May 2011 08:10:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIgL6-0001gC-2i for emacs-devel@gnu.org; Sat, 07 May 2011 08:10:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIgL5-0007AR-50 for emacs-devel@gnu.org; Sat, 07 May 2011 08:10:27 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:50135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIgL4-0007AK-TU for emacs-devel@gnu.org; Sat, 07 May 2011 08:10:27 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LKT00D00R3IHD00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 07 May 2011 15:10:01 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.234.175]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LKT00BH5R4OMDV0@a-mtaout20.012.net.il>; Sat, 07 May 2011 15:10:01 +0300 (IDT) In-reply-to: <83zkmykamq.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 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:139199 Archived-At: > Date: Sat, 07 May 2011 14:34:05 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > I fixed that; see the diffs for revno 104152.1.2 for the gory details > (if you are interested). Btw, while working on this, I noticed that the code fragment shown below is doing a lot of work that is just thrown away in the case that `:file' is used to redirect stdout of the child. That's because we will never read from that file, so setting up the coding-system to decode it seems futile. Should we do all that only when output_to_buffer is non-zero? if (NILP (buffer)) { /* If BUFFER is nil, we must read process output once and then discard it, so setup coding system but with nil. */ setup_coding_system (Qnil, &process_coding); } else { Lisp_Object val, *args2; val = Qnil; if (!NILP (Vcoding_system_for_read)) val = Vcoding_system_for_read; else { if (EQ (coding_systems, Qt)) { size_t i; SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); args2[0] = Qcall_process; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; coding_systems = Ffind_operation_coding_system (nargs + 1, args2); } if (CONSP (coding_systems)) val = XCAR (coding_systems); else if (CONSP (Vdefault_process_coding_system)) val = XCAR (Vdefault_process_coding_system); else val = Qnil; } Fcheck_coding_system (val); /* In unibyte mode, character code conversion should not take place but EOL conversion should. So, setup raw-text or one of the subsidiary according to the information just setup. */ if (NILP (BVAR (current_buffer, enable_multibyte_characters)) && !NILP (val)) val = raw_text_coding_system (val); setup_coding_system (val, &process_coding); } immediate_quit = 1; QUIT;