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: Generalize start-process with keyword args Date: Tue, 17 Mar 2015 23:15:41 +0200 Message-ID: <83lhivxr42.fsf@gnu.org> References: <87d24d3uwz.fsf-ueno@gnu.org> <86a8zc21ua.fsf@gmail.com> <83oanszq6u.fsf@gnu.org> <8661a01stb.fsf@gmail.com> <83egooyu08.fsf@gnu.org> <86oanrwdhb.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426626988 4226 80.91.229.3 (17 Mar 2015 21:16:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2015 21:16:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 17 22:16:21 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 1YXyqZ-0004vR-4a for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 22:16:19 +0100 Original-Received: from localhost ([::1]:57109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyqY-0002zs-BX for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 17:16:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyqE-0002vj-4n for emacs-devel@gnu.org; Tue, 17 Mar 2015 17:15:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXyqA-0000xK-Hh for emacs-devel@gnu.org; Tue, 17 Mar 2015 17:15:58 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:47220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyqA-0000wJ-05 for emacs-devel@gnu.org; Tue, 17 Mar 2015 17:15:54 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NLD00P00JY61900@mtaout29.012.net.il> for emacs-devel@gnu.org; Tue, 17 Mar 2015 23:12:28 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLD00LEFK8SVM40@mtaout29.012.net.il>; Tue, 17 Mar 2015 23:12:28 +0200 (IST) In-reply-to: <86oanrwdhb.fsf@gmail.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.185 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:183970 Archived-At: > From: Andy Moreton > Date: Tue, 17 Mar 2015 20:55:28 +0000 > > A simple example is using the cscope package from Cygwin. This installs > a cscope executable, a cscope-indexer script and cscope.el that uses the > cscope indexes for symbol lookup. cscope.el can also invoke the indexer > script to regenerate the indexes (by invoking `cscope-indexing-script' > with arguments via `start-process'). > > This script can easily be reused without modification, by advising > `start-process to rework its arguments: cahnge PROGRAM to be "bash" and > prepend "-c" to the PROGRAM-ARGS list. This allows cscope.el to invoke > the original script from a Win32 emacs build without needing any changes > to the original package. So how you suggest this to work? Should such scripts be treated as executable only if the interpreter they require is on PATH, and otherwise be treated as non-executable? Or should we always treat them as executables, and let them fail if the interpreter is not available? Or should we require that a script that says #! /usr/local/bin/perl is run by "/usr/local/bin/perl", and nothing else? What about scripts that say #! /usr/bin/env perl should we run 'env' for them, too? And what about MSYS mounting of Windows directories, whereby /bin/bash resolves to something like C:\MSYS\1.0\bin\bash.exe (of which Emacs has no idea)? I see a lot of complications with the semantics of this, and no easy solutions, since the necessary tools are not available on Windows, could be installed in any directory, and come with a set of assumptions that don't necessarily play well with a native Emacs. > > But what shell would be able to interpret such scripts on Windows? > > AFAIK, there are no good candidates for that role. > > A shell from cygwin, msys2 or msys. They are all subtly incompatible with a native Emacs, both in the file-name syntax and in how they treat I/O. > >> This allows integration of unix style commands inplemented as > >> executable shell scripts with Win32 emacs. > > > > IMO, those shell scripts should be ported to Windows by converting > > them to batch files that the stock Windows shell can interpret. > > Far more work (and more error prone) than simply invoking the existing > script via an appropriate (posix) shell. The same can be said about porting any program. Porting shell scripts is part of the job, IMO.