aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/executable.el
diff options
context:
space:
mode:
authorStefan Monnier2005-05-11 16:42:40 +0000
committerStefan Monnier2005-05-11 16:42:40 +0000
commitba47dcb28876a44cec69a25828f1f2a420e5befd (patch)
tree638283e903b7cc608dd0453b7bb325d466456c4b /lisp/progmodes/executable.el
parenta4479657966929ec8b38cb90ed9beb9cb2c8162e (diff)
downloademacs-ba47dcb28876a44cec69a25828f1f2a420e5befd.tar.gz
emacs-ba47dcb28876a44cec69a25828f1f2a420e5befd.zip
(executable-find): Move to files.el.
Diffstat (limited to 'lisp/progmodes/executable.el')
-rw-r--r--lisp/progmodes/executable.el26
1 files changed, 1 insertions, 25 deletions
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index 0eb53771019..d278b10ba0c 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -161,30 +161,6 @@ If PROGRAM is non-nil, use that instead of \"find\"."
161 (if (search-forward file nil t) 161 (if (search-forward file nil t)
162 t)))) 162 t))))
163 163
164;;;###autoload
165(defun executable-find (command)
166 "Search for COMMAND in `exec-path' and return the absolute file name.
167Return nil if COMMAND is not found anywhere in `exec-path'."
168 (let ((list exec-path)
169 file)
170 (while list
171 (setq list
172 (if (and (setq file (expand-file-name command (car list)))
173 (let ((suffixes exec-suffixes)
174 candidate)
175 (while suffixes
176 (setq candidate (concat file (car suffixes)))
177 (if (and (file-executable-p candidate)
178 (not (file-directory-p candidate)))
179 (setq suffixes nil)
180 (setq suffixes (cdr suffixes))
181 (setq candidate nil)))
182 (setq file candidate)))
183 nil
184 (setq file nil)
185 (cdr list))))
186 file))
187
188(defun executable-chmod () 164(defun executable-chmod ()
189 "This gets called after saving a file to assure that it be executable. 165 "This gets called after saving a file to assure that it be executable.
190You can set the absolute or relative mode in variable `executable-chmod' for 166You can set the absolute or relative mode in variable `executable-chmod' for
@@ -301,5 +277,5 @@ file modes."
301 277
302(provide 'executable) 278(provide 'executable)
303 279
304;;; arch-tag: 58458d1c-d9db-45ec-942b-8bbb1d5e319d 280;; arch-tag: 58458d1c-d9db-45ec-942b-8bbb1d5e319d
305;;; executable.el ends here 281;;; executable.el ends here