Permalink
Browse files

Show relevant part of REPL buffer when refreshing.

  • Loading branch information...
1 parent 8a65b6a commit dca3afc0dcabdb658c5b74dd0078afa99b07d960 @candera committed Oct 15, 2017
Showing with 6 additions and 6 deletions.
  1. +6 −6 init.el
View
12 init.el
@@ -1839,12 +1839,12 @@ remain indented by four spaces after refilling."
(defun inf-clojure-refresh ()
"Runs `(refresh)` in the attached REPL."
(interactive)
- (save-excursion
- (save-window-excursion
- (switch-to-buffer inf-clojure-buffer)
- (goto-char (point-max))
- (insert "(require 'clojure.tools.namespace.repl) (clojure.tools.namespace.repl/refresh)")
- (comint-send-input))))
+ (let ((cur (current-buffer)))
+ (pop-to-buffer inf-clojure-buffer)
+ (goto-char (point-max))
+ (insert "(require 'clojure.tools.namespace.repl) (clojure.tools.namespace.repl/refresh)")
+ (comint-send-input)
+ (pop-to-buffer cur)))
(define-key inf-clojure-minor-mode-map (kbd "M-R") 'inf-clojure-refresh)

0 comments on commit dca3afc

Please sign in to comment.