Skip to content

Commit d7c7d99

Browse files
committed
Avoid overlays and messages on stderr that is unrelated to exception handling
Fixes #3587
1 parent 9fb72b3 commit d7c7d99

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [#3605](https://github.com/clojure-emacs/cider/issues/3605): avoid `cider--error-phase-of-last-exception` recursive loop.
88
- [#3613](https://github.com/clojure-emacs/cider/issues/3613): adapt `cider-completion-context.el` to upstream changes in Compliment.
9+
- [#3587](https://github.com/clojure-emacs/cider/issues/3587): avoid overlays and `message`s on stderr that is unrelated to exception handling.
910

1011
## 1.13.0 (2024-01-14)
1112

cider-eval.el

+10-7
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,16 @@ and the suffix matched by `cider-module-info-regexp'."
913913
(defun cider--maybe-display-error-as-overlay (phase err end)
914914
"Possibly display ERR as an overlay honoring END,
915915
depending on the PHASE."
916-
(when (or
917-
;; if we won't show *cider-error*, because of configuration, the overlay is adequate because it compensates for the lack of info in a compact manner:
918-
(not cider-show-error-buffer)
919-
(not (cider-connection-has-capability-p 'jvm-compilation-errors))
920-
;; if we won't show *cider-error*, because of an ignored phase, the overlay is adequate:
921-
(and cider-show-error-buffer
922-
(member phase (cider-clojure-compilation-error-phases))))
916+
(when (and (or
917+
;; if we won't show *cider-error*, because of configuration, the overlay is adequate because it compensates for the lack of info in a compact manner:
918+
(not cider-show-error-buffer)
919+
(not (cider-connection-has-capability-p 'jvm-compilation-errors))
920+
;; if we won't show *cider-error*, because of an ignored phase, the overlay is adequate:
921+
(and cider-show-error-buffer
922+
(member phase (cider-clojure-compilation-error-phases))))
923+
;; Only show overlays for things that do look like an exception (#3587):
924+
(or (string-match-p cider-clojure-runtime-error-regexp err)
925+
(string-match-p cider-clojure-compilation-regexp err)))
923926
;; Display errors as temporary overlays
924927
(let ((cider-result-use-clojure-font-lock nil)
925928
(trimmed-err (funcall cider-inline-error-message-function err)))

0 commit comments

Comments
 (0)