Skip to content

Silence common byte-compile warnings on MELPA install#3901

Merged
bbatsov merged 3 commits into
masterfrom
fix-compile-warnings
May 9, 2026
Merged

Silence common byte-compile warnings on MELPA install#3901
bbatsov merged 3 commits into
masterfrom
fix-compile-warnings

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented May 9, 2026

A few warnings show up when end users install the latest CIDER from MELPA. Most are real source-side issues that we masked locally because Eldev sets byte-compile-docstring-max-column to 100 and pre-loads files before compiling them.

Three commits, one issue each:

  1. Add the missing explicit nrepl-client / nrepl-dict requires in cider-eval.el. It was relying on a transitive chain through cider-client → cider-session → nrepl-client, which the byte compiler doesn't always follow, leading to "function not known to be defined" warnings for nrepl-make-eval-handler etc.
  2. Rename the server-buffer parameter (one defun + four lambdas in cider.el) to server-buf, since server-buffer is a defvar in built-in server.el and the lexical binding shadows it.
  3. Trim a handful of docstrings down to ≤80 columns so end users compiling with the default 80-col limit don't get warnings.
  • All tests are passing (eldev test) — 547 specs, 0 failed
  • Compiles clean with eldev compile --warnings-as-errors, and also clean when re-run with the strict byte-compile-docstring-max-column 80
  • No CHANGELOG entry — these are compile-warning fixes, not user-visible behavior changes

bbatsov added 3 commits May 9, 2026 11:40
The file uses nrepl-make-eval-handler, nrepl-dbind-response, and
nrepl-dict-get directly but was relying on a transitive require chain
through cider-client -> cider-session -> nrepl-client. The byte
compiler doesn't always trace transitive requires, leading to
"function not known to be defined" warnings on installs where the
chain wasn't resolved at compile time.
server.el (the built-in Emacs server) defines server-buffer as a
defvar, so any function or lambda taking server-buffer as a lexical
argument shadows it within that scope.  The byte compiler warns about
this because dynamic-variable shadowing is a frequent source of
subtle bugs.  Rename to server-buf to sidestep the conflict.
End users compiling CIDER from MELPA see "docstring wider than 80
characters" warnings because the byte compiler defaults to a 80-col
limit (the project's Eldev sets it to 100 internally, which masked
these locally).  Reword or wrap the offending lines so they're
clean for end users too.
@bbatsov bbatsov merged commit cf8d695 into master May 9, 2026
12 checks passed
@bbatsov bbatsov deleted the fix-compile-warnings branch May 9, 2026 08:51
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