File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 53
53
54
54
### Changes
55
55
56
+ * Display the current connection instead of the current namespace in ` cider-mode ` 's modeline.
56
57
* [ #1078 ] ( https://github.com/clojure-emacs/cider/issues/1078 ) : Removed
57
58
` cider-load-fn-into-repl-buffer ` , previously bound to ` C-c M-f ` in the REPL.
58
59
* [ #1019 ] ( https://github.com/clojure-emacs/cider/pull/1019 ) :
Original file line number Diff line number Diff line change 33
33
(require 'cider-interaction )
34
34
(require 'cider-eldoc )
35
35
36
+ (defun cider--modeline-info ()
37
+ " Return info for the `cider-mode' modeline.
38
+
39
+ Info contains project name and host:port endpoint."
40
+ (let ((current-connection (nrepl-current-connection-buffer t )))
41
+ (if current-connection
42
+ (with-current-buffer current-connection
43
+ (format " %s @%s :%s "
44
+ (or (nrepl--project-name nrepl-project-dir) " <no project>" )
45
+ (car nrepl-endpoint)
46
+ (cadr nrepl-endpoint)))
47
+ " not connected" )))
48
+
36
49
;;;### autoload
37
50
(defcustom cider-mode-line
38
- '(:eval (format " cider[%s ] " (cider-current-ns )))
51
+ '(:eval (format " cider[%s ] " (cider--modeline-info )))
39
52
" Mode line lighter for `cider-mode' .
40
53
41
54
The value of this variable is a mode line template as in
42
55
`mode-line-format' . See Info Node `(elisp)Mode Line Format' for
43
56
details about mode line templates.
44
57
45
58
Customize this variable to change how `cider-mode' displays its
46
- status in the mode line. The default value displays the current ns .
59
+ status in the mode line. The default value displays the current connection .
47
60
Set this variable to nil to disable the mode line
48
61
entirely."
49
62
:group 'cider
You can’t perform that action at this time.
0 commit comments