From a19ff1a8d92f6fd3a1c4a206ab061d897c93d650 Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Wed, 6 Aug 2025 18:31:02 +0300 Subject: [PATCH] [nrepl-client] Fix nrepl--eval-request sending duplicate info Addresses #3831. --- CHANGELOG.md | 8 ++++++++ nrepl-client.el | 19 +++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09dd76455..03e8ed560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## master (unreleased) +### New features + +### Changes + +### Bugs fixed + +- [#3832](https://github.com/clojure-emacs/cider/issues/3832): Fix nrepl--eval-request sending duplicate info. + ## 1.19.0 (2025-07-10) ### New features diff --git a/nrepl-client.el b/nrepl-client.el index f056ff8b2..d4374974c 100644 --- a/nrepl-client.el +++ b/nrepl-client.el @@ -1025,16 +1025,15 @@ Register CALLBACK as the response handler." NS provides context for the request. If LINE and COLUMN are non-nil and current buffer is a file buffer, \"line\", \"column\" and \"file\" are added to the message." - (nconc (and ns `("ns" ,ns)) - `("op" "eval" - "code" ,(substring-no-properties input)) - (when cider-enlighten-mode - '("enlighten" "true")) - (let ((file (or (buffer-file-name) (buffer-name)))) - (when (and line column file) - `("file" ,file - "line" ,line - "column" ,column))))) + `("op" "eval" + "code" ,(substring-no-properties input) + ,@(when ns `("ns" ,ns)) + ,@(when cider-enlighten-mode '("enlighten" "true")) + ,@(let ((file (or (buffer-file-name) (buffer-name)))) + (when (and line column file) + `("file" ,file + "line" ,line + "column" ,column))))) (defun nrepl-request:eval (input callback connection &optional ns line column additional-params tooling) "Send the request INPUT and register the CALLBACK as the response handler.