From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: Generalize start-process with keyword args Date: Tue, 17 Mar 2015 20:55:28 +0000 Message-ID: <86oanrwdhb.fsf@gmail.com> References: <87d24d3uwz.fsf-ueno@gnu.org> <86a8zc21ua.fsf@gmail.com> <83oanszq6u.fsf@gnu.org> <8661a01stb.fsf@gmail.com> <83egooyu08.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426625777 17405 80.91.229.3 (17 Mar 2015 20:56:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2015 20:56:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 17 21:56:09 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 1YXyWw-0001en-3K for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 21:56:02 +0100 Original-Received: from localhost ([::1]:57005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyWv-0002bI-GU for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 16:56:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyWg-0002aL-1k for emacs-devel@gnu.org; Tue, 17 Mar 2015 16:55:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXyWc-0003Tf-RD for emacs-devel@gnu.org; Tue, 17 Mar 2015 16:55:45 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:57832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyWc-0003TZ-EP for emacs-devel@gnu.org; Tue, 17 Mar 2015 16:55:42 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YXyWY-0001RI-TA for emacs-devel@gnu.org; Tue, 17 Mar 2015 21:55:38 +0100 Original-Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 21:55:38 +0100 Original-Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 21:55:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:FOvk2uFVRijd+szuxEzDtXR3mzE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:183968 Archived-At: On Tue 17 Mar 2015, Eli Zaretskii wrote: >> From: Andy Moreton >> Date: Mon, 16 Mar 2015 22:27:44 +0000 >> >> On Mon 16 Mar 2015, Eli Zaretskii wrote: >> >> >> From: Andy Moreton >> >> Date: Mon, 16 Mar 2015 19:12:45 +0000 >> >> >> >> start-process assumes that the system is capable of handling shebang >> >> lines in shell scripts and launching them by executing a shell. >> > >> > Can you point out where does this assumption live in the code? >> >> In the callers of start-process > > Can you give me an example of such a caller? (I'm not asking idle > questions here; there are aspects of the problem you describe that > aren't really clear to me, but I prefer finding out the answers by > looking at the code than by asking too many questions.) Sorry for not being clear. 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. Similar issues arise with using other tools (e.g. git, hg) that use shell scripts or symlinks for some executable tools. >> By (optionally) invoking the command via a shell. > > 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. >> 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. AndyM