From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: executable-find in files.el Date: Wed, 11 May 2005 15:07:36 -0400 Message-ID: <87fywt6128.fsf-monnier+emacs@gnu.org> References: <01c55657$Blat.v2.4$7979dc20@zahav.net.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115838186 24980 80.91.229.2 (11 May 2005 19:03:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 May 2005 19:03:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 11 21:03:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DVwSc-0005l4-4e for ged-emacs-devel@m.gmane.org; Wed, 11 May 2005 21:01:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVwbO-0000nc-VQ for ged-emacs-devel@m.gmane.org; Wed, 11 May 2005 15:10:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DVwb5-0000lc-21 for emacs-devel@gnu.org; Wed, 11 May 2005 15:10:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DVwb2-0000jn-MM for emacs-devel@gnu.org; Wed, 11 May 2005 15:10:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVwb2-0000jc-Ey for emacs-devel@gnu.org; Wed, 11 May 2005 15:10:16 -0400 Original-Received: from [209.226.175.34] (helo=tomts13-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DVwf2-0007Bu-2o; Wed, 11 May 2005 15:14:24 -0400 Original-Received: from alfajor ([67.68.217.114]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050511190740.YSUH25800.tomts13-srv.bellnexxia.net@alfajor>; Wed, 11 May 2005 15:07:40 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id D9870D72FF; Wed, 11 May 2005 15:07:36 -0400 (EDT) Original-To: Eli Zaretskii In-Reply-To: <01c55657$Blat.v2.4$7979dc20@zahav.net.il> (Eli Zaretskii's message of "Wed, 11 May 2005 21:29:12 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36991 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36991 >> + (defun executable-find (command) >> + "Search for COMMAND in `exec-path' and return the absolute file name. >> + Return nil if COMMAND is not found anywhere in `exec-path'." >> + ;; Use 1 rather than file-executable-p to better match the behavior of >> + ;; call-process. >> + (locate-file command exec-path exec-suffixes 1)) > Passing 1 as last arg of locate-file is subtly different from passing > file-executable-p. I think the latter does a better job, so I think > executable-find should use file-executable-p. Have you read the comment you quoted? What do you reply to that? Do you think it's more important to "do a subtly better job" or to "match the behavior of call-process"? In my view, the point of executable-find is to figure out whether there is a command that we can run. If it tells us "I found /ssh:foo/bar/baz", but then call-process fails because it doesn't work through Tramp, I think it's a problem. Stefan