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

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

Re: quickly find all executables


From: Kin Cho
Subject: Re: quickly find all executables
Date: 24 Jul 2003 13:44:16 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Kin Cho wrote:
> 
> > Kevin Rodgers <ihs_4664@yahoo.com> writes:
> >
> >>(let ((directories exec-path)
> >>      (executables '()))
> >>  (while directories
> >>    (let ((files (if (file-directory-p (car directories))
> >>                 (directory-files (car directories) t nil t)
> >>               '())))
> >>      (while files
> >>    (if (and (file-regular-p (car files))
> >>             (file-executable-p (car files)))
> >>        (setq executables (cons (car files) executables)))
> >>    (setq files (cdr files))))
> >>    (setq directories (cdr directories)))
> >>  (nreverse executables))
> >>
> > Thanks.  I used add-to-list above to avoid adding duplicates
> > that
> > won't be used anyway.
> 
> But the files are full path names, so there won't be any exact duplicates.

Unless there are duplicated entries in exec-path -- but I first
should remove duplicates from my exec-path.

-kin


reply via email to

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