help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: execute shell scripts by call-process in msys2 environment


From: Eli Zaretskii
Subject: Re: execute shell scripts by call-process in msys2 environment
Date: Wed, 12 Sep 2018 20:10:56 +0300

> From: Andy Moreton <andrewjmoreton@gmail.com>
> Date: Wed, 12 Sep 2018 17:45:35 +0100
> 
> On MSYS2 "/usr/bin/ci" is a shell script that execs "rcs ci". This works
> ok with `shell-command' as that shell can execute the script.

Yes, MSYS2 moves more and more towards being just a variant of Cygwin
in this regard: a large number of "ported" packages are available just
as MSYS2 builds, which means you cannot easily run them from native
apps.

In this case, it should be trivial to provide a small batch file that
invokes "rcs ci" exactly like the shell script does.  Then native
programs, including Emacs, will be able to invoke the batch file as if
it were a program.  Alas, the MSYS2 guys evidently don't think this to
be important enough...

> Other parts of emacs use `call-process' or `make-process', which expect
> to run an executable directly, without invoking a shell. They can also
> run shell scripts if the OS kernel execs the interpreter parsed from the
> '#!' line in the script. MSYS2 (and Cygwin) run on Windows, which does
> not do '#!' parsing in the kernel.

FWIW, ye olde MSDOS port of Emacs is capable of running shell scripts,
but "sic transit gloria mundi".

> The following advice works for me on emacs 26 and later to fix this
> problem on Cygwin (MSYS2 should be similar):

I think it's much easier and safer to write a one-line batch file.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]