Skip to content

Commit

Permalink
Avoid overlays and messages on stderr that is unrelated to exceptio…
Browse files Browse the repository at this point in the history
…n handling

Fixes clojure-emacs#3587
  • Loading branch information
vemv committed Feb 1, 2024
1 parent 0273dfc commit 3ff7e07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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

## 1.13.0 (2024-01-14)

Expand Down
17 changes: 10 additions & 7 deletions cider-eval.el
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,16 @@ and the suffix matched by `cider-module-info-regexp'."
(defun cider--maybe-display-error-as-overlay (phase err end)
"Possibly display ERR as an overlay honoring END,
depending on the PHASE."
(when (or
;; 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:
(not cider-show-error-buffer)
(not (cider-connection-has-capability-p 'jvm-compilation-errors))
;; if we won't show *cider-error*, because of an ignored phase, the overlay is adequate:
(and cider-show-error-buffer
(member phase (cider-clojure-compilation-error-phases))))
(when (and (or
;; 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:
(not cider-show-error-buffer)
(not (cider-connection-has-capability-p 'jvm-compilation-errors))
;; if we won't show *cider-error*, because of an ignored phase, the overlay is adequate:
(and cider-show-error-buffer
(member phase (cider-clojure-compilation-error-phases))))
;; Only show overlays for things that do look like an exception (#3587):
(or (string-match-p cider-clojure-runtime-error-regexp err)
(string-match-p cider-clojure-compilation-regexp err)))
;; Display errors as temporary overlays
(let ((cider-result-use-clojure-font-lock nil)
(trimmed-err (funcall cider-inline-error-message-function err)))
Expand Down

0 comments on commit 3ff7e07

Please sign in to comment.