help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ELisp finding files in Path


From: Marc Mientki
Subject: Re: ELisp finding files in Path
Date: Wed, 08 Dec 2010 15:30:08 -0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

Am 28.09.2010 12:10, schrieb Paulo J. Matos:

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.

Maybe someting like this?

(defun my-load-lib (name)
  (and (locate-library name)
       (executable-find name)
       (load name)))

(my-load-lib "mdd")


HTH
reagrds
Marc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]