* ELisp finding files in Path
@ 2010-09-28 10:10 Paulo J. Matos
2010-09-28 10:22 ` Eli Zaretskii
2010-09-28 10:22 ` Thierry Volpiatto
0 siblings, 2 replies; 4+ messages in thread
From: Paulo J. Matos @ 2010-09-28 10:10 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELisp finding files in Path
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
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2010-09-28 10:22 UTC (permalink / raw)
To: help-gnu-emacs
> From: pocmatos@gmail.com (Paulo J. Matos)
> Date: Tue, 28 Sep 2010 11:10:12 +0100
>
> 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?
Check out the executable-find function, it will return nil if it
doesn't find an executable program on PATH.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELisp finding files in Path
2010-09-28 10:10 ELisp finding files in Path Paulo J. Matos
2010-09-28 10:22 ` Eli Zaretskii
@ 2010-09-28 10:22 ` Thierry Volpiatto
1 sibling, 0 replies; 4+ messages in thread
From: Thierry Volpiatto @ 2010-09-28 10:22 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELisp finding files in Path
2010-09-28 10:22 ` Eli Zaretskii
@ 2010-09-28 10:36 ` Paulo J. Matos
0 siblings, 0 replies; 4+ messages in thread
From: Paulo J. Matos @ 2010-09-28 10:36 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>
> Check out the executable-find function, it will return nil if it
> doesn't find an executable program on PATH.
>
>
woohoo, thanks!
--
PMatos
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-28 10:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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.