all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: ELisp finding files in Path
Date: Tue, 28 Sep 2010 12:22:57 +0200	[thread overview]
Message-ID: <87aan2dv5q.fsf@tux.homenetwork> (raw)
In-Reply-To: yaytylatbzv.fsf@alma.europe.root.pri

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 




      parent reply	other threads:[~2010-09-28 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 10:10 ELisp finding files in Path Paulo J. Matos
2010-09-28 10:22 ` Eli Zaretskii
2010-09-28 10:36   ` Paulo J. Matos
2010-09-28 10:22 ` Thierry Volpiatto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aan2dv5q.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.