From 750d60733de2865e765a9f29539118a916c3b09e Mon Sep 17 00:00:00 2001 From: tijsmallaerts Date: Sun, 16 Dec 2018 20:24:37 +0100 Subject: [PATCH 1/2] [Fix #2105] Fix no comment syntax defined message when loading buffer after running failing test --- CHANGELOG.md | 1 + cider-eval.el | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 731db62c2..6896139c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * Fix jack-in from inside of remote buffers. * [#2454](https://github.com/clojure-emacs/cider/pull/2454): Fix erratic inspector behavior when multiple REPLs are connected * [#2467](https://github.com/clojure-emacs/cider/pull/2467): Make generic CIDER ops use any available nREPL connection. +* [#2105](https://github.com/clojure-emacs/cider/issues/2105): Fix no comment syntax defined message when loading buffer after running a failing test. ### Changes diff --git a/cider-eval.el b/cider-eval.el index 643fc93a9..cc5f68901 100644 --- a/cider-eval.el +++ b/cider-eval.el @@ -1055,9 +1055,10 @@ for the project, it is evaluated in both REPLs." (or (eq cider-save-file-on-load t) (y-or-n-p (format "Save file %s? " buffer-file-name)))) (save-buffer)) - (remove-overlays nil nil 'cider-temporary t) - (cider--clear-compilation-highlights) - (cider--quit-error-window) + (save-excursion + (remove-overlays nil nil 'cider-temporary t) + (cider--clear-compilation-highlights) + (cider--quit-error-window)) (let ((filename (buffer-file-name buffer)) (ns-form (cider-ns-form))) (cider-map-repls :auto From f4c6547ae36ff567413a054057e373cba9c78702 Mon Sep 17 00:00:00 2001 From: tijsmallaerts Date: Mon, 17 Dec 2018 12:51:33 +0100 Subject: [PATCH 2/2] Move save-excursion to quit error window function --- cider-eval.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cider-eval.el b/cider-eval.el index cc5f68901..4f51c4ce6 100644 --- a/cider-eval.el +++ b/cider-eval.el @@ -168,7 +168,8 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation." (defun cider--quit-error-window () "Buries the `cider-error-buffer' and quits its containing window." (when-let* ((error-win (get-buffer-window cider-error-buffer))) - (quit-window nil error-win))) + (save-excursion + (quit-window nil error-win)))) ;;; Dealing with compilation (evaluation) errors and warnings @@ -1055,10 +1056,9 @@ for the project, it is evaluated in both REPLs." (or (eq cider-save-file-on-load t) (y-or-n-p (format "Save file %s? " buffer-file-name)))) (save-buffer)) - (save-excursion - (remove-overlays nil nil 'cider-temporary t) - (cider--clear-compilation-highlights) - (cider--quit-error-window)) + (remove-overlays nil nil 'cider-temporary t) + (cider--clear-compilation-highlights) + (cider--quit-error-window) (let ((filename (buffer-file-name buffer)) (ns-form (cider-ns-form))) (cider-map-repls :auto