From 93c294210492bc079118961dfcee249cf7de7196 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 24 Mar 2018 08:29:34 +0700 Subject: [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. --- cider-repl.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cider-repl.el') 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 -- cgit v1.2.3