aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/executable.el
diff options
context:
space:
mode:
authorKaroly Lorentey2004-02-02 19:19:08 +0000
committerKaroly Lorentey2004-02-02 19:19:08 +0000
commitd3a6748c5b378a86fc8408222c7dd26e47218af9 (patch)
tree33f9334088634447425b8c926dd45d1e83fa80e2 /lisp/progmodes/executable.el
parent465fc071a1aa48e87f37bff460410eec921eaa53 (diff)
parentd83a97ab5fbcde063e4a87042cd721a23f13fbe0 (diff)
downloademacs-d3a6748c5b378a86fc8408222c7dd26e47218af9.tar.gz
emacs-d3a6748c5b378a86fc8408222c7dd26e47218af9.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-57 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-58 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-59 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-60 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-61 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-62 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-63 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-64 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-65 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-66 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-67 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-68 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-69 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-71
Diffstat (limited to 'lisp/progmodes/executable.el')
-rw-r--r--lisp/progmodes/executable.el27
1 files changed, 26 insertions, 1 deletions
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index 21f894753a1..b301d84d144 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -1,6 +1,6 @@
1;;; executable.el --- base functionality for executable interpreter scripts -*- byte-compile-dynamic: t -*- 1;;; executable.el --- base functionality for executable interpreter scripts -*- byte-compile-dynamic: t -*-
2 2
3;; Copyright (C) 1994, 1995, 1996, 2000, 2003 by Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 2000, 2003, 2004 by Free Software Foundation, Inc.
4 4
5;; Author: Daniel Pfeiffer <occitan@esperanto.org> 5;; Author: Daniel Pfeiffer <occitan@esperanto.org>
6;; Keywords: languages, unix 6;; Keywords: languages, unix
@@ -141,6 +141,31 @@ See `compilation-error-regexp-alist'.")
141(defvaralias 'executable-binary-suffixes 'exec-suffixes) 141(defvaralias 'executable-binary-suffixes 'exec-suffixes)
142 142
143;;;###autoload 143;;;###autoload
144(defun executable-command-find-posix-p (&optional program)
145 "Check if PROGRAM handles arguments Posix-style.
146If PROGRAM is non-nil, use that instead of \"find\"."
147 ;; Pick file to search from location we know
148 (let* ((dir (car load-path))
149 (file (find-if
150 (lambda (x)
151 ;; Filter directories . and ..
152 (not (string-match "^\\.\\.?$" x)))
153 (directory-files dir))))
154 (with-temp-buffer
155 (call-process (or program "find")
156 nil
157 (current-buffer)
158 nil
159 dir
160 "-name"
161 file
162 "-maxdepth"
163 "1")
164 (goto-char (point-min))
165 (if (search-forward file nil t)
166 t))))
167
168;;;###autoload
144(defun executable-find (command) 169(defun executable-find (command)
145 "Search for COMMAND in `exec-path' and return the absolute file name. 170 "Search for COMMAND in `exec-path' and return the absolute file name.
146Return nil if COMMAND is not found anywhere in `exec-path'." 171Return nil if COMMAND is not found anywhere in `exec-path'."