Skip to content

Extract Clojure compilation error handling into cider-compilation.el#3912

Merged
bbatsov merged 1 commit into
masterfrom
extract-compilation
May 14, 2026
Merged

Extract Clojure compilation error handling into cider-compilation.el#3912
bbatsov merged 1 commit into
masterfrom
extract-compilation

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented May 14, 2026

Pull the ~500-line compilation-error handling subsystem out of cider-eval.el into its own module. cider-compilation sits below cider-eval in the layering: it turns nREPL eval-error / stacktrace responses into the *cider-error* buffer, source overlays, and inline messages.

Moved:

  • User-tunable knobs: cider-show-error-buffer, cider-auto-jump-to-error, cider-auto-select-error-buffer, cider-error-highlight-face, cider-warning-highlight-face, cider-inline-error-message-function, cider-clojure-compilation-error-phases (+ its default).
  • Parsing and rendering: cider-clojure-compilation-regexp, cider-module-info-regexp, cider-compilation-regexp, cider-extract-error-info, cider-handle-compilation-errors, cider--display-error-unobtrusively, cider--handle-stacktrace-response, cider--analyze-last-stacktrace, the cider-default-err-*-handler family, cider--handle-err-eval-response, cider--clojure-{1.10-error,1.10-location,warning}, cider--render-stacktrace-causes, cider--find-last-error-location, cider--goto-expression-start, cider--show-error-buffer-p, cider-new-error-buffer, cider-emit-into-color-buffer, cider-jump-to-compilation-error, cider-find-property.
  • Highlight-clearing helpers from the old "Utilities" section (cider--clear-compilation-highlights, cider-clear-compilation-highlights, cider--quit-error-window).
  • cider--shorten-error-message (only used as the default of cider-inline-error-message-function).

Coupling:

  • cider-eval.el now requires cider-compilation and drops compile from its requires.
  • Two consumers that don't go through cider-eval (cider-log.el, cider-test.el) get an explicit require for cider-auto-select-error-buffer.
  • The new file forward-declares only cider-repl-mode (used in a derived-mode-p check); no other shims needed.

cider-eval.el: 1650 → 1156 lines. cider-compilation.el: 562 lines (new).

  • Compiles clean with `eldev compile --warnings-as-errors`
  • All 547 tests pass (`eldev test`)
  • No CHANGELOG entry — pure refactor, no user-visible change

Move the ~500-line compilation-error handling subsystem out of
cider-eval.el into its own module.  Sits below cider-eval.el in the
layering: turns nREPL eval-error / stacktrace responses into the
*cider-error* buffer, source overlays, and inline messages.

Moved:

- The user-tunable knobs: cider-show-error-buffer, cider-auto-jump-to-error,
  cider-auto-select-error-buffer, cider-error-highlight-face,
  cider-warning-highlight-face, cider-inline-error-message-function,
  cider-clojure-compilation-error-phases (plus its default value).
- The compilation/error parsing and rendering subsystem:
  cider-clojure-compilation-regexp, cider-module-info-regexp,
  cider-compilation-regexp, cider-extract-error-info,
  cider-handle-compilation-errors, cider--display-error-unobtrusively,
  cider--handle-stacktrace-response, cider--analyze-last-stacktrace,
  cider-default-err-{handler,op-handler,eval-handler,eval-print-handler},
  cider--handle-err-eval-response, cider--clojure-1.10-{error,location},
  cider--clojure-warning, cider--render-stacktrace-causes,
  cider--find-last-error-location, cider--goto-expression-start,
  cider--show-error-buffer-p, cider-new-error-buffer,
  cider-emit-into-color-buffer, cider-jump-to-compilation-error,
  cider-find-property.
- Highlight-clearing helpers from the old "Utilities" section
  (cider--clear-compilation-highlights, cider-clear-compilation-highlights,
  cider--quit-error-window).
- cider--shorten-error-message (only used as the default of
  cider-inline-error-message-function).

cider-eval.el requires cider-compilation and drops compile from its
requires (no longer needed there).  Two consumers that don't go through
cider-eval (cider-log.el and cider-test.el) add an explicit require for
cider-auto-select-error-buffer.

The new file forward-declares only `cider-repl-mode' (used in a
derived-mode-p check); no other shims needed.

cider-eval.el drops from 1650 to 1156 lines.
@bbatsov bbatsov merged commit ff570fc into master May 14, 2026
13 checks passed
@bbatsov bbatsov deleted the extract-compilation branch May 14, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant