summaryrefslogtreecommitdiff
path: root/cider-interaction.el
diff options
context:
space:
mode:
authorVitalie Spinu <spinuvit@gmail.com>2014-08-30 12:22:35 -0700
committerVitalie Spinu <spinuvit@gmail.com>2014-08-31 15:31:28 -0700
commitb788a8dace7f84d7f0a4b904bb46350023585187 (patch)
tree942ea459487c9c1cb4e60bc10ee1eafd65f50cf3 /cider-interaction.el
parentdd1c044201d4e2930b45b0af5200b550bd741f05 (diff)
Add `other-buffer` flag to `cider-jump-to`
Diffstat (limited to 'cider-interaction.el')
-rw-r--r--cider-interaction.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/cider-interaction.el b/cider-interaction.el
index 1180ebd0..96982094 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -649,11 +649,15 @@ not found."
(file (cadr (assoc "file" info))))
(cider-find-file file)))
-(defun cider-jump-to (buffer &optional pos)
+(defun cider-jump-to (buffer &optional pos other-buffer)
"Push current point onto marker ring, and jump to BUFFER to position POS.
POS can be either a cons cell (LINE . COLUMN) or a number representing the
-character position in a buffer. "
+character position in a buffer. If OTHER-BUFFER is non-nil use
+`pop-to-buffer' to jump to the location, otherwise `switch-to-buffer'."
(ring-insert find-tag-marker-ring (point-marker))
+ (if other-buffer
+ (pop-to-buffer buffer)
+ (switch-to-buffer buffer))
(with-current-buffer buffer
(widen)
;; check if we have a (line . column) pair or just a buffer position
@@ -664,8 +668,7 @@ character position in a buffer. "
(if (cdr pos)
(move-to-column (cdr pos))
(back-to-indentation)))
- (cider-mode +1))
- (switch-to-buffer buffer))
+ (cider-mode +1)))
(defun cider-jump-to-resource (path &optional line)
"Jump to the resource at the relative PATH, optionally at a specific LINE.