Skip to content

Commit 91b320b

Browse files
committed
Bind missing eval commands under the C-c C-v prefix
Five eval commands existed in the codebase but had no entry in cider-eval-commands-map: - j / C-j cider-eval-last-sexp-to-repl - p / C-p cider-eval-print-last-sexp - : cider-read-and-eval - ; cider-eval-defun-to-comment - f j e cider-pprint-eval-last-sexp-to-repl (in the pprint submap; uses 'j' as the 'to REPL' qualifier, mirroring 'c' for 'to comment') cider-pprint-eval-last-sexp-to-repl previously had no binding at all and was only reachable via M-x. The other four were bound under the top-level C-c M-x chords (C-c M-e, C-c M-:, C-c M-;) but absent from the C-c C-v eval prefix, breaking the prefix's claim to be a comprehensive eval entry point.
1 parent 7e6e19c commit 91b320b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
- The editor-level `cider-make-eval-handler` wraps it with CIDER's UI behavior (ns tracking, default error handler, need-input prompt, "Evaluation interrupted." / "Namespace not found." messages). In-tree callers all use it.
2121
- New nREPL message log commands: `nrepl-show-messages` pops up the messages buffer (prompting when there are multiple connections), and `c` in `nrepl-messages-mode` runs the new `nrepl-clear-messages` to wipe the buffer. Auto-follow on new entries now leaves windows alone if you've scrolled back to read history; only windows already at end-of-buffer get scrolled to the latest message.
2222

23+
### New features
24+
25+
- `cider-eval-commands-map` (`C-c C-v` prefix) now binds five long-existing eval commands that previously had no presence under the prefix: `cider-eval-last-sexp-to-repl` (`j`/`C-j`), `cider-eval-print-last-sexp` (`p`/`C-p`), `cider-read-and-eval` (`:`), `cider-eval-defun-to-comment` (`;`), and `cider-pprint-eval-last-sexp-to-repl` (`f j e`). Existing chords (`C-c M-e`, `C-c M-:`, `C-c M-;`) are unchanged.
26+
2327
### Bugs fixed
2428

2529
- `cider-browse-spec-mode`, `cider-browse-spec-view-mode`, and `cider-browse-spec-example-mode` each have an `easy-menu` now, exposing the drill/browse-all/generate-example commands that previously had no menu affordance.

lisp/cider-eval.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@ passing arguments."
998998
(define-key map (kbd "d") #'cider-pprint-eval-defun-at-point)
999999
(define-key map (kbd "c e") #'cider-pprint-eval-last-sexp-to-comment)
10001000
(define-key map (kbd "c d") #'cider-pprint-eval-defun-to-comment)
1001+
(define-key map (kbd "j e") #'cider-pprint-eval-last-sexp-to-repl)
10011002

10021003
;; duplicates with C- for convenience
10031004
(define-key map (kbd "C-e") #'cider-pprint-eval-last-sexp)
@@ -1006,6 +1007,8 @@ passing arguments."
10061007
(define-key map (kbd "C-c C-e") #'cider-pprint-eval-last-sexp-to-comment)
10071008
(define-key map (kbd "C-c d") #'cider-pprint-eval-defun-to-comment)
10081009
(define-key map (kbd "C-c C-d") #'cider-pprint-eval-defun-to-comment)
1010+
(define-key map (kbd "C-j e") #'cider-pprint-eval-last-sexp-to-repl)
1011+
(define-key map (kbd "C-j C-e") #'cider-pprint-eval-last-sexp-to-repl)
10091012
map))
10101013

10111014
(defvar cider-eval-commands-map
@@ -1027,6 +1030,10 @@ passing arguments."
10271030
(define-key map (kbd "c") #'cider-eval-last-sexp-in-context)
10281031
(define-key map (kbd "b") #'cider-eval-sexp-at-point-in-context)
10291032
(define-key map (kbd "k") #'cider-kill-last-result)
1033+
(define-key map (kbd "j") #'cider-eval-last-sexp-to-repl)
1034+
(define-key map (kbd "p") #'cider-eval-print-last-sexp)
1035+
(define-key map (kbd ":") #'cider-read-and-eval)
1036+
(define-key map (kbd ";") #'cider-eval-defun-to-comment)
10301037
(define-key map (kbd "f") 'cider-eval-pprint-commands-map)
10311038

10321039
;; duplicates with C- for convenience
@@ -1046,6 +1053,8 @@ passing arguments."
10461053
(define-key map (kbd "C-c") #'cider-eval-last-sexp-in-context)
10471054
(define-key map (kbd "C-b") #'cider-eval-sexp-at-point-in-context)
10481055
(define-key map (kbd "C-k") #'cider-kill-last-result)
1056+
(define-key map (kbd "C-j") #'cider-eval-last-sexp-to-repl)
1057+
(define-key map (kbd "C-p") #'cider-eval-print-last-sexp)
10491058
(define-key map (kbd "C-f") 'cider-eval-pprint-commands-map)
10501059
map))
10511060

0 commit comments

Comments
 (0)