summaryrefslogtreecommitdiff
path: root/cider-repl.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-03-24 08:29:34 +0700
committerBozhidar Batsov <bozhidar@batsov.com>2018-03-24 09:03:35 +0700
commit93c294210492bc079118961dfcee249cf7de7196 (patch)
treee4ed9f1ee31754b5b6a9c9a274fa97e48a8bb28f /cider-repl.el
parent432078e98f7a758ba41f9a084014546f349f5026 (diff)
[Fix #2244] Display the REPL name in the modeline
I couldn't find a better way to do it, but this seems to work well. I was on the fence about Clojure-REPL vs REPL[clj], but opted to go with the shorter variant (mostly becausee ClojureScript-REPL is quite long). We can easily name this configurable.
Diffstat (limited to 'cider-repl.el')
-rw-r--r--cider-repl.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/cider-repl.el b/cider-repl.el
index 345a3c2b..223d355f 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -225,7 +225,7 @@ via `cider-current-connection'.")
(when (member "state" (nrepl-dict-get response "status"))
(nrepl-dbind-response response (repl-type changed-namespaces)
(when repl-type
- (setq cider-repl-type repl-type))
+ (cider-repl-set-type repl-type))
(unless (nrepl-dict-empty-p changed-namespaces)
(setq cider-repl-ns-cache (nrepl-dict-merge cider-repl-ns-cache changed-namespaces))
(dolist (b (buffer-list))
@@ -261,7 +261,7 @@ ENDPOINT is a plist as returned by `nrepl-connect'."
(with-current-buffer (get-buffer-create buff-name)
(unless (derived-mode-p 'cider-repl-mode)
(cider-repl-mode)
- (setq cider-repl-type "clj"))
+ (cider-repl-set-type "clj"))
(setq nrepl-err-handler #'cider-default-err-handler)
(cider-repl-reset-markers)
(add-hook 'nrepl-response-handler-functions #'cider-repl--state-handler nil 'local)
@@ -1065,7 +1065,10 @@ namespace to switch to."
(format "Set REPL type (currently `%s') to: "
cider-repl-type)
'("clj" "cljs")))))
- (setq cider-repl-type type)))
+ (setq cider-repl-type type)
+ (if (equal type "cljs")
+ (setq mode-name "REPL[cljs]")
+ (setq mode-name "REPL[clj]"))))
;;; Location References