Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [#3909](https://github.com/clojure-emacs/cider/issues/3909): `cider--sesman-friendly-session-p` is more robust at attaching buffers to existing sessions. The classpath and namespace caches are now populated eagerly at connection time instead of lazily on first sesman call (previously a nil/empty result was indistinguishable from "not cached" and was re-fetched on every check). The matcher is now a pure path comparison and never blocks on the REPL. Beyond the caching fix, it also falls back to the connection's `nrepl-project-dir` when classpath matching fails, uses `file-in-directory-p` for classpath-root boundary checks (avoiding spurious prefix matches like `/foo/bar` against `/foo/barber/...`), and short-circuits to the chosen session when `cider-default-session` is set.
- `nrepl-bencode` no longer crashes when handed a non-string scalar (symbol, float, etc.). The documented fallback ("everything else is encoded as string") used `string-bytes` directly, which errors on non-string input; values are now coerced via `format' before measuring byte length.
- [#3915](https://github.com/clojure-emacs/cider/issues/3915): Fix `cider-repl-history` failing with "Unmatched bracket or quote" on its second invocation in a session when the user's history contained an entry with unbalanced parens. `cider-repl-history-setup` now erases the reused `*cider-repl-history*` buffer before re-entering `cider-repl-history-mode`, so any user-configured `clojure-mode-hook` (e.g. one that runs `check-parens') runs on an empty buffer instead of stale content from the previous render.
- `cider--completing-read-port` now defaults to `7888` when no running nREPL port can be inferred.

### Changes

Expand Down
6 changes: 5 additions & 1 deletion lisp/cider-endpoint.el
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Sub-match 1 must be the project path.")
(defvar cider-host-history nil
"Completion history for connection hosts.")

(defconst cider-default-nrepl-port "7888"
"Use this port number when we couldn't infer a port.
See also https://github.com/nrepl/nREPL/issues/6.")

;;; Endpoint selection

Expand Down Expand Up @@ -158,7 +161,8 @@ of remote SSH hosts."
"Interactively select port for HOST from PORTS."
(let* ((ports (cider-join-into-alist ports))
(sel-port (completing-read (format "Port for %s: " host) ports
nil nil nil nil (caar ports)))
nil nil nil nil (or (caar ports)
cider-default-nrepl-port)))
(port (or (cdr (assoc sel-port ports)) sel-port))
(port (if (listp port) (cadr port) port)))
(if (stringp port) (string-to-number port) port)))
Expand Down