Created
April 24, 2014 21:52
-
-
Save kazu-yamamoto/11270834 to your computer and use it in GitHub Desktop.
which
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun which (file path) | |
(catch 'loop | |
(while path | |
(if (file-exists-p (expand-file-name file (car path))) | |
(throw 'loop (message "%s" (expand-file-name file (car path)))) | |
(setq path (cdr path)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment