From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: `start-process` in Emacs on Windows seems to mangle process output Date: Thu, 19 Nov 2015 20:03:50 +0200 Message-ID: <837fld988p.fsf@gnu.org> References: <4de8ec5c-bcf0-49ea-99e5-555f3186c5d9@googlegroups.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1447956291 2766 80.91.229.3 (19 Nov 2015 18:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 18:04:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 19:04:43 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZzTZL-00005o-V2 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 19:04:28 +0100 Original-Received: from localhost ([::1]:43293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTZL-0005kJ-6Y for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 13:04:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTZ6-0005fo-36 for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:04:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzTZ1-000801-3C for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:04:12 -0500 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:44773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzTZ0-0007zh-NI for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:04:07 -0500 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NY200M00PHZL800@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 19:59:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NY200KGSPYGJ430@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Thu, 19 Nov 2015 19:59:04 +0200 (IST) In-reply-to: <4de8ec5c-bcf0-49ea-99e5-555f3186c5d9@googlegroups.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108139 Archived-At: > Date: Thu, 19 Nov 2015 06:49:30 -0800 (PST) > From: evgeniy.sharapov@gmail.com > Injection-Date: Thu, 19 Nov 2015 14:49:30 +0000 > > Here's the my problem. When I run > > ------------------------------------------------------------------ > (let ((default-directory "C:/Users/esharapov/.emacs.d/")) > (apply 'start-process "ag" (get-buffer-create "test") > "c:\\App\\emacs\\libexec\\emacs\\24.5\\i686-pc-mingw32\\cmdproxy.exe" > (list "-c" "\"ag\" \"--nocolor\" \"--literal\" \"--line-number\" \"--smart-case\" \"--nogroup\" \"--column\" \"--stats\" \"--\" \"keymap-on\" \".\""))) > ------------------------------------------------------------------ > > I get in the buffer following output: > > ------------------------------------------------------------------ > 194:15: (defmacro keymap-on-key (name keys) > 233:9: (keymap-on-key ctl-x-f-map "C-x f") > 572:7: (keymap-on-key ctl-z-w-map "C-z w") > 194:15: (defmacro keymap-on-key (name keys) > > 233:9: (keymap-on-key ctl-x-f-map "C-x f") > > 572:7: (keymap-on-key ctl-z-w-map "C-z w") > > 6 matches > 382 files searched > 8993756 bytes searched > 0.446822 seconds > > Process ag finished What kind of program is "ag"? What does it do, and how? > However when I run it in the Windows command prompt as > > ------------------------------------------------------------------ > c:\\App\\emacs\\libexec\\emacs\\24.5\\i686-pc-mingw32\\cmdproxy.exe /c "C:\\App\\bin\\ag.exe --nocolor --literal --line-number --smart-case --nogroup --column --stats -- keymap-on ." > ------------------------------------------------------------------ > > I get the following output > > ------------------------------------------------------------------ > #configuration.org#:194:15: (defmacro keymap-on-key (name keys) > #configuration.org#:233:9: (keymap-on-key ctl-x-f-map "C-x f") > #configuration.org#:572:7: (keymap-on-key ctl-z-w-map "C-z w") > configuration.org:194:15: (defmacro keymap-on-key (name keys) > configuration.org:233:9: (keymap-on-key ctl-x-f-map "C-x f") > configuration.org:572:7: (keymap-on-key ctl-z-w-map "C-z w") > 6 matches > 382 files searched > 8993756 bytes searched > 0.483917 seconds > ------------------------------------------------------------------- > > Notice when I use 'start-process' the file name is being removed from the process output. Does anyone know what's the issue here ? Does "ag", whatever it is, behave differently depending on whether its standard output is a console device or something else? Also, are you sure the same "ag" is run in both cases? The first command didn't include the absolute file name of the program, could it be that cmdproxy found some other copy of it?