Created
March 29, 2013 17:50
-
-
Save jaycfields/5272391 to your computer and use it in GitHub Desktop.
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 find-java-src () | |
(interactive) | |
(er/mark-word) | |
(let* ((project-root (locate-dominating-file (file-name-directory (buffer-file-name)) "project.clj")) | |
(the-str (buffer-substring-no-properties (region-beginning) (region-end)))) | |
(if project-root | |
(progn | |
(grep-string-in the-str | |
(concat project-root "lib/sources")) | |
(switch-to-grep) | |
(sit-for 0.25) | |
(search-forward (concat (expand-file-name project-root) "lib/sources/")) | |
(compile-goto-error) | |
(let* ((current-point (point))) | |
(search-forward-regexp ".*\.jar") | |
(switch-to-buffer (buffer-substring-no-properties current-point (point)))) | |
(search-forward the-str) | |
(archive-extract)) | |
(message (concat "no project.clj found at or below " (buffer-file-name)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment