From: Andy Moreton <andrewjmoreton@gmail.com>
To: 36270@debbugs.gnu.org
Subject: bug#36270: executable-find does not find shell commands on MSYS2
Date: Wed, 19 Jun 2019 18:38:02 +0100 [thread overview]
Message-ID: <vz1fto5xypx.fsf@gmail.com> (raw)
In-Reply-To: <CAAeL0SQU2t8LwyGJoWpxTpj3ebw=qNr1aT0RS6-ggWBqdYfteQ@mail.gmail.com>
On Wed 19 Jun 2019, Eli Zaretskii wrote:
>> From: Juanma Barranquero <lekktu@gmail.com>
>> I stumbled upon this because I was trying to understand failures in
>> vc-tests.el on Windows, and the reason is that it calls call-process
>> to run some shell scripts, like ci. I'd like to fix that and run the
>> tests, but I haven't really stared at it long enough to know if
>> there's any non-ugly fix.
>
> One non-ugly fix is to use RCS from the ezwinports site. The binaries
> there are 32-bit, but I don't think it will make any difference.
I use the following advice in a Windows build of emacs to get shell
scripts working for Cygwin. MSYS2 should be similar, with a suitable
setting for `shell-file-name':
(defun call-process:filter-args (args)
"Ensure native Windows emacs can run shell script programs."
(let ((program (nth 0 args)))
(if (executable-find program)
args
(list shell-file-name (nth 1 args) (nth 2 args) (nth 3 args)
shell-command-switch
(mapconcat #'shell-quote-argument
(append (list program) (nthcdr 4 args)) " ")))))
(advice-add 'call-process :filter-args #'call-process:filter-args)
(defun make-process:filter-args (args)
"Ensure native Windows emacs can run shell script programs."
(let* ((command (plist-get args :command)))
(if (executable-find (car command))
args
(plist-put args :command
(list shell-file-name shell-command-switch
(mapconcat #'shell-quote-argument command " "))))))
(advice-add 'make-process :filter-args #'make-process:filter-args))
Perhaps something similar could be added for Windows builds.
AndyM
next prev parent reply other threads:[~2019-06-19 17:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 23:42 bug#36270: executable-find does not find shell commands on MSYS2 Juanma Barranquero
2019-06-18 0:23 ` Glenn Morris
2019-06-18 0:57 ` Juanma Barranquero
2019-06-18 16:51 ` Eli Zaretskii
2019-06-18 20:49 ` Juanma Barranquero
2019-06-19 16:24 ` Eli Zaretskii
2019-06-19 17:38 ` Andy Moreton [this message]
2019-06-19 19:22 ` Juanma Barranquero
2019-06-19 19:20 ` Juanma Barranquero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vz1fto5xypx.fsf@gmail.com \
--to=andrewjmoreton@gmail.com \
--cc=36270@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).