comparison lisp/progmodes/executable.el @ 54065:18ada18b62be

(executable-command-find-posix-p): Fix choice of the directory.
author Markus Rost <rost@math.uni-bielefeld.de>
date Wed, 18 Feb 2004 20:47:46 +0000
parents 11ae9146993f
children 2e6b67f7b5c9
comparison
equal deleted inserted replaced
54064:c9135adb6143 54065:18ada18b62be
143 ;;;###autoload 143 ;;;###autoload
144 (defun executable-command-find-posix-p (&optional program) 144 (defun executable-command-find-posix-p (&optional program)
145 "Check if PROGRAM handles arguments Posix-style. 145 "Check if PROGRAM handles arguments Posix-style.
146 If PROGRAM is non-nil, use that instead of \"find\"." 146 If PROGRAM is non-nil, use that instead of \"find\"."
147 ;; Pick file to search from location we know 147 ;; Pick file to search from location we know
148 (let* ((dir (car load-path)) 148 (let* ((dir (file-truename data-directory))
149 (file (find-if 149 (file (car (directory-files dir nil "^[^.]"))))
150 (lambda (x)
151 ;; Filter directories . and ..
152 (not (string-match "^\\.\\.?$" x)))
153 (directory-files dir))))
154 (with-temp-buffer 150 (with-temp-buffer
155 (call-process (or program "find") 151 (call-process (or program "find")
156 nil 152 nil
157 (current-buffer) 153 (current-buffer)
158 nil 154 nil