diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | cider-client.el | 8 | ||||
-rw-r--r-- | cider-selector.el | 4 | ||||
-rw-r--r-- | nrepl-client.el | 15 | ||||
-rw-r--r-- | test/cider-selector-tests.el | 4 |
5 files changed, 11 insertions, 23 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d38965e..11dbc89a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### New features -* Change default value of `cider-overlays-use-font-lock` to `t`. Unlike before, a value of `t`, causes `cider-result-overlay-face` is to be prepended to the font-lock faces (instead of just not being used). +* Change default value of `cider-overlays-use-font-lock` to `t`. Unlike before, a value of `t`, causes `cider-result-overlay-face` is to be prepended to the font-lock faces (instead of just not being used). * `cider-result-overlay-face` default value changed to a background and a box, so it can be prepended to other faces without overriding the foreground. * [#1518](https://github.com/clojure-emacs/cider/pull/1518): Add `cider-dynamic-indentation` defcustom, to disable dynamic indent functionality. * Font-lock traced vars. @@ -21,6 +21,7 @@ and try to associate the created connection with this project automatically. * Requires Clojure(Script) 1.7 or newer. * Requires Java 7 or newer. * Improve stacktrace presentation of compiler errors (readability, DWIM point positioning). +* [#1458](https://github.com/clojure-emacs/cider/issues/1458): Separate nREPL messages by connections instead of by sessions. ### Bugs fixed diff --git a/cider-client.el b/cider-client.el index 02e22196..dc4ebf26 100644 --- a/cider-client.el +++ b/cider-client.el @@ -618,8 +618,8 @@ Return the REPL buffer given by `cider-current-connection'.") (define-obsolete-function-alias 'nrepl-current-session 'cider-current-session "0.10") (defun cider-current-messages-buffer () - "The nREPL messages buffer, matching the current connection's default session." - (format nrepl-message-buffer-name-template (cider-current-session))) + "The nREPL messages buffer, matching the current connection." + (format nrepl-message-buffer-name-template (cider-current-connection))) (defun cider-current-tooling-session () "Return the current tooling session." @@ -628,10 +628,6 @@ Return the REPL buffer given by `cider-current-connection'.") (define-obsolete-function-alias 'nrepl-current-tooling-session 'cider-current-tooling-session "0.10") -(defun cider-current-tooling-messages-buffer () - "The nREPL messages buffer, matching the current connection's tooling session." - (format nrepl-message-buffer-name-template (cider-current-tooling-session))) - (defun cider--var-choice (var-info) "Prompt to choose from among multiple VAR-INFO candidates, if required. This is needed only when the symbol queried is an unqualified host platform diff --git a/cider-selector.el b/cider-selector.el index 6810d246..40db62c5 100644 --- a/cider-selector.el +++ b/cider-selector.el @@ -145,10 +145,6 @@ is chosen. The returned buffer is selected with "*nrepl-messages* buffer." (cider-current-messages-buffer)) -(def-cider-selector-method ?M - "Tooling *nrepl-messages* buffer." - (cider-current-tooling-messages-buffer)) - (def-cider-selector-method ?x "*cider-error* buffer." cider-error-buffer) diff --git a/nrepl-client.el b/nrepl-client.el index 14318cc2..dbc6f65b 100644 --- a/nrepl-client.el +++ b/nrepl-client.el @@ -1202,7 +1202,7 @@ TYPE is either request or response. The message is logged to a buffer described by `nrepl-message-buffer-name-template'." (when nrepl-log-messages - (with-current-buffer (nrepl-messages-buffer msg) + (with-current-buffer (nrepl-messages-buffer (current-buffer) msg) (setq buffer-read-only nil) (when (> (buffer-size) nrepl-message-buffer-max-size) (goto-char (/ (buffer-size) nrepl-message-buffer-reduce-denominator)) @@ -1275,15 +1275,10 @@ Set this to nil to prevent truncation." 'follow-link t)))) (insert (color ")\n")))))))) -(defun nrepl-messages-buffer (msg) - "Return or create the buffer for MSG. -The default buffer name is *nrepl-messages session*." - ;; Log `new-session' replies to the "orphan" buffer, because that's probably - ;; where we logged the request it's replying to. - (let* ((msg-session (or (unless (nrepl-dict-get msg "new-session") - (nrepl-dict-get msg "session")) - "00000000-0000-0000-0000-000000000000")) - (msg-buffer-name (format nrepl-message-buffer-name-template msg-session))) +(defun nrepl-messages-buffer (conn msg) + "Return or create the buffer for CONN and MSG. +The default buffer name is *nrepl-messages connection*." + (let ((msg-buffer-name (format nrepl-message-buffer-name-template conn))) (or (get-buffer msg-buffer-name) (let ((buffer (get-buffer-create msg-buffer-name))) (with-current-buffer buffer diff --git a/test/cider-selector-tests.el b/test/cider-selector-tests.el index 30933abd..aec0e77b 100644 --- a/test/cider-selector-tests.el +++ b/test/cider-selector-tests.el @@ -49,9 +49,9 @@ (should (equal (current-buffer) b1))))))) (ert-deftest test-cider-selector-m () - (noflet ((cider-current-messages-buffer () "*nrepl-messages session-id*")) + (noflet ((cider-current-messages-buffer () "*nrepl-messages conn-id*")) (with-temp-buffer - (rename-buffer "*nrepl-messages session-id*") + (rename-buffer "*nrepl-messages conn-id*") (let ((b1 (current-buffer))) (with-temp-buffer (should (not (equal (current-buffer) b1))) |