Browse files

remote-nrepl-and-nrepl-jump fixed

  • Loading branch information...
1 parent 60485aa commit fc7bf48c578b83ec49d4434d51bc0a71c2ddc824 @klang committed Jan 10, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 nrepl.el
View
9 nrepl.el
@@ -333,14 +333,21 @@ Uses `find-file'."
filename)))
(find-file fn)))
+(defun nrepl-maybe-local-m2-resource (jar)
+ (cond
+ ((file-exists-p jar) jar)
+ ((string-match "^.+\\(\\/.m2.+\\)" jar)
+ (concat (getenv "HOME") (match-string 1 jar)))
+ (:else jar)))
+
(defun nrepl-find-resource (resource)
(cond ((string-match "^file:\\(.+\\)" resource)
(nrepl-find-file (match-string 1 resource)))
((string-match "^\\(jar\\|zip\\):file:\\(.+\\)!/\\(.+\\)" resource)
(let* ((jar (match-string 2 resource))
(path (match-string 3 resource))
(buffer-already-open (get-buffer (file-name-nondirectory jar))))
- (nrepl-find-file jar)
+ (nrepl-find-file (nrepl-maybe-local-m2-resource jar))
(goto-char (point-min))
(search-forward path)
(let ((opened-buffer (current-buffer)))

0 comments on commit fc7bf48

Please sign in to comment.