From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#36270: executable-find does not find shell commands on MSYS2 Date: Tue, 18 Jun 2019 19:51:42 +0300 Message-ID: <83r27qsuox.fsf@gnu.org> References: <2lef3rrbaa.fsf@fencepost.gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="48275"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36270@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 18 19:17:59 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hdHk6-000CRM-4d for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 19:17:58 +0200 Original-Received: from localhost ([::1]:60414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdHk5-0000he-5U for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 13:17:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59811) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdHL8-0005f0-9k for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 12:52:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdHL2-0000D5-EO for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 12:52:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdHKz-000050-NP for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 12:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdHKz-0001sE-Ls for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 12:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jun 2019 16:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36270 X-GNU-PR-Package: emacs Original-Received: via spool by 36270-submit@debbugs.gnu.org id=B36270.15608766997165 (code B ref 36270); Tue, 18 Jun 2019 16:52:01 +0000 Original-Received: (at 36270) by debbugs.gnu.org; 18 Jun 2019 16:51:39 +0000 Original-Received: from localhost ([127.0.0.1]:45503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdHKc-0001rU-TP for submit@debbugs.gnu.org; Tue, 18 Jun 2019 12:51:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdHKb-0001rG-IQ for 36270@debbugs.gnu.org; Tue, 18 Jun 2019 12:51:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hdHKW-0007fA-Bu; Tue, 18 Jun 2019 12:51:32 -0400 Original-Received: from [176.228.60.248] (port=3639 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hdHKU-0004qm-9M; Tue, 18 Jun 2019 12:51:30 -0400 In-reply-to: (message from Juanma Barranquero on Tue, 18 Jun 2019 02:57:59 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160780 Archived-At: > From: Juanma Barranquero > Date: Tue, 18 Jun 2019 02:57:59 +0200 > Cc: 36270@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.