emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs 21.3.50 grep.el/executable.el problems


From: Piet van Oostrum
Subject: Re: Emacs 21.3.50 grep.el/executable.el problems
Date: 15 Feb 2004 13:59:31 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Ehud Karni" <address@hidden> (EK) wrote:

EK> On Sat, 14 Feb 2004 17:04:42 +0200, Ehud Karni <address@hidden> wrote:
>> 
>> 2. progmodes/executable.el calls `find-if' which is defined in
>> cl-seq.el and requires the cl.el .

EK> Actually `executable-command-find-posix-p' does not work well if
EK> (car load-path) is a symbolic link name (and because of this it
EK> failed for me on both GNU\Linux and Cygwin - both posix systems).


EK> The following patch will fix this.

EK> !   (let* ((dir (car load-path))
EK> !          files file)
EK> !     (setq dir (or (file-symlink-p dir) dir))
EK> !     (setq files (directory-files dir))
EK> !     (while files
EK> !        (setq file (car files))
EK> !        (if (string-match "^\\.\\.?$" file)
EK> !            (setq files (cdr files))
EK> !            (setq files nil)))

Actually I think it can be done easier by replacing the find-if with a
directory-files call with a match regexp:

Something like (directory-files dir nil "^\\([^.]\\|\.[^.]\\|\.\..\\)")
-- 
Piet van Oostrum <address@hidden>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: address@hidden




reply via email to

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