emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/cider 1989a725a5 1/2: Possibly display error overlays on `


From: ELPA Syncer
Subject: [nongnu] elpa/cider 1989a725a5 1/2: Possibly display error overlays on `cider-load-buffer`
Date: Mon, 6 Nov 2023 15:59:15 -0500 (EST)

branch: elpa/cider
commit 1989a725a504cc0a19b43dedf3f22723b5569b31
Author: vemv <vemv@users.noreply.github.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>

    Possibly display error overlays on `cider-load-buffer`
    
    Part of https://github.com/clojure-emacs/cider/issues/3495
---
 CHANGELOG.md  |  1 +
 cider-eval.el | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8bea8400d1..398819653a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
 
 - CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html): 
display Java class/method/field info when available.
   - This info is available when 
[enrich-classpath](https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath)
 is active.
+- [#3495](https://github.com/clojure-emacs/cider/issues/3495): possibly 
display error overlays on 
[`cider-load-buffer`](https://docs.cider.mx/cider/usage/code_evaluation.html#basic-evaluation).
 - `cider-popup-buffer-display`: honor `special-display-buffer-names` if 
customized for a given CIDER buffer name (e.g. `*cider-inspect*`), avoiding the 
double-rendering of the given buffer.
 - [#3572](https://github.com/clojure-emacs/cider/issues/3572): `lein.sh`: 
honor `XDG_CACHE_HOME`. 
 - Bump the injected `cider-nrepl` to 
[0.43.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.43.0/CHANGELOG.md#0430-2023-11-04).
diff --git a/cider-eval.el b/cider-eval.el
index 790dfb9cbd..d928908a65 100644
--- a/cider-eval.el
+++ b/cider-eval.el
@@ -951,7 +951,16 @@ Optional argument DONE-HANDLER lambda will be run once 
load is complete."
                                    (cider-emit-interactive-eval-output value))
                                  (lambda (_buffer err)
                                    (cider-emit-interactive-eval-err-output err)
-                                   (cider-handle-compilation-errors err 
eval-buffer))
+                                   ;; 1.- Jump to the error line:
+                                   (cider-handle-compilation-errors err 
eval-buffer)
+                                   (with-current-buffer eval-buffer
+                                     (let* ((phase 
(cider--error-phase-of-last-exception buffer))
+                                            ;; 2.- Calculate the overlay 
position, which is the point (per the previous jump),
+                                            ;;     and then end-of-line (for 
ensuring the overlay will be rendered properly):
+                                            (end (save-excursion
+                                                   (end-of-line)
+                                                   (point))))
+                                       (cider--maybe-display-error-as-overlay 
phase err end))))
                                  (lambda (buffer)
                                    (when cider-eval-register
                                      (set-register cider-eval-register res))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]