GNU bug report logs -
#36270
executable-find does not find shell commands on MSYS2
Previous Next
Full log
View this message in rfc822 format
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Tue, 18 Jun 2019 02:57:59 +0200
> Cc: 36270 <at> debbugs.gnu.org
>
> Still, there's nothing magic about call-process. Is the native way,
> but not the only way to execute programs on Emacs. Why should
> file-executable-p and executable-find privilege native vs shell
> commands, in contexts where you can run the shell command easily?
Because otherwise we would have inconsistencies: executable-find will
find an "executable" which Emacs may or may not be able to run. We
want to declare a file "executable" only if it can be invoked by _all_
possible means of running an executable file.
This is a Windows-specific subtlety, because the mechanism for running
arbitrary scripts is different from that of Posix systems. We could
make the situation a tad better if we add support for the PATHEXT
environment variable, as suggested in bug#7784, patches welcome. But
this won't solve the problem entirely, when the user has some
interpreter installed which doesn't register itself in PATHEXT.
> (let ((shell-file-name "bash"))
> (shell-command "ci --version"))
>
> => 0
>
> As I said above, there's tension between two meanings of "executable"
> here. Both are meaningful.
I might be okay with adding a new function, shell-executable-find,
say. But we must first define what that means, exactly, and whether
it's feasible to implement something like that with reasonable effort
and complexity.
Meanwhile, just set up trivial batch file wrappers for your shell
scripts, and Bob's your uncle.
This bug report was last modified 5 years and 361 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.