Skip to content

Instantly share code, notes, and snippets.

@kazu-yamamoto
Created April 24, 2014 21:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kazu-yamamoto/11270834 to your computer and use it in GitHub Desktop.
which
(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