From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: ELisp finding files in Path Date: Tue, 28 Sep 2010 12:22:57 +0200 Organization: ThierryVolpiatto Message-ID: <87aan2dv5q.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285669545 12337 80.91.229.12 (28 Sep 2010 10:25:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Sep 2010 10:25:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 28 12:25:44 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0XNW-0006bs-SO for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Sep 2010 12:25:43 +0200 Original-Received: from localhost ([127.0.0.1]:43283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0XNW-0001UW-9W for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Sep 2010 06:25:42 -0400 Original-Received: from [140.186.70.92] (port=58015 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0XMa-0001Sm-Oq for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:24:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0XMZ-00045m-MR for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:24:44 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:37445) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0XMZ-00045U-CJ for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:24:43 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P0XMW-0006Fd-Ia for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 12:24:40 +0200 Original-Received: from 33.77.197-77.rev.gaoland.net ([77.197.77.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Sep 2010 12:24:40 +0200 Original-Received: from thierry.volpiatto by 33.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Sep 2010 12:24:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 20 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 33.77.197-77.rev.gaoland.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) Cancel-Lock: sha1:IILbfxylug3s0gPzpzgufjANw84= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75028 Archived-At: pocmatos@gmail.com (Paulo J. Matos) writes: > Hi, > > I would like to execute some commands in my .emacs only if there are > some files in the current PATH. The specific example is, I only want to > load a perforce library (p4.el) if I can find the executable p4 in the > path. > > How can I do this? I couldn't find any way to either run a shell command > (through which I could run `which p4`), or read an environment variable > PATH, and then find all the files in it and see if p4 is there. > > Any tips would be appreciated. (when (executable-find ...) (load ...) -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997