From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pocmatos@gmail.com (Paulo J. Matos) Newsgroups: gmane.emacs.help Subject: ELisp finding files in Path Date: Tue, 28 Sep 2010 11:10:12 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285668685 8619 80.91.229.12 (28 Sep 2010 10:11:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Sep 2010 10:11:25 +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:11:24 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 1P0X9a-00029T-Dn for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Sep 2010 12:11:18 +0200 Original-Received: from localhost ([127.0.0.1]:46003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0X9Z-0003B7-Nw for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Sep 2010 06:11:17 -0400 Original-Received: from [140.186.70.92] (port=50006 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0X8n-00038f-6Q for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:10:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0X8i-00027U-5j for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:10:29 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:51434) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0X8h-00027I-VK for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 06:10:24 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P0X8f-0001qN-72 for help-gnu-emacs@gnu.org; Tue, 28 Sep 2010 12:10:21 +0200 Original-Received: from 193.128.72.68 ([193.128.72.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Sep 2010 12:10:21 +0200 Original-Received: from pocmatos by 193.128.72.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Sep 2010 12:10:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.128.72.68 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0atMyvcKm8xl/Or/c+p9YRTD8Es= 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:75026 Archived-At: 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. -- PMatos