Skip to content

Commit 76a644a

Browse files
benedekfazekasbbatsov
authored andcommitted
Fix cider-repl-handle-shortcut not handling plain lambdas
The function expects values in `cider-repl-shortcuts` to be commands (interactively callable functions). For some cases (currently `browse-ns`, `test-all-with-selector` and `test-project-with-selector`) this is not true that causes the `,` command to fail. For these cases make the lambdas interactive too.
1 parent 9187893 commit 76a644a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cider-repl.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ constructs."
14171417
(cider-repl-add-shortcut "clear-help-banner" #'cider-repl-clear-help-banner)
14181418
(cider-repl-add-shortcut "ns" #'cider-repl-set-ns)
14191419
(cider-repl-add-shortcut "toggle-pretty" #'cider-repl-toggle-pretty-printing)
1420-
(cider-repl-add-shortcut "browse-ns" (lambda () (cider-browse-ns (cider-current-ns))))
1420+
(cider-repl-add-shortcut "browse-ns" (lambda () (interactive) (cider-browse-ns (cider-current-ns))))
14211421
(cider-repl-add-shortcut "classpath" #'cider-classpath)
14221422
(cider-repl-add-shortcut "history" #'cider-repl-history)
14231423
(cider-repl-add-shortcut "trace-ns" #'cider-toggle-trace-ns)
@@ -1428,8 +1428,8 @@ constructs."
14281428
(cider-repl-add-shortcut "test-all" #'cider-test-run-loaded-tests)
14291429
(cider-repl-add-shortcut "test-project" #'cider-test-run-project-tests)
14301430
(cider-repl-add-shortcut "test-ns-with-selector" #'cider-test-run-ns-tests-with-selector)
1431-
(cider-repl-add-shortcut "test-all-with-selector" (lambda () (cider-test-run-loaded-tests 'prompt-for-selector)))
1432-
(cider-repl-add-shortcut "test-project-with-selector" (lambda () (cider-test-run-project-tests 'prompt-for-selector)))
1431+
(cider-repl-add-shortcut "test-all-with-selector" (lambda () (interactive) (cider-test-run-loaded-tests 'prompt-for-selector)))
1432+
(cider-repl-add-shortcut "test-project-with-selector" (lambda () (interactive) (cider-test-run-project-tests 'prompt-for-selector)))
14331433
(cider-repl-add-shortcut "test-report" #'cider-test-show-report)
14341434
(cider-repl-add-shortcut "run" #'cider-run)
14351435
(cider-repl-add-shortcut "conn-info" #'cider-display-connection-info)
@@ -1471,7 +1471,7 @@ constructs."
14711471
(if (not (equal command ""))
14721472
(let ((command-func (gethash command cider-repl-shortcuts)))
14731473
(if command-func
1474-
(call-interactively (gethash command cider-repl-shortcuts))
1474+
(call-interactively command-func)
14751475
(error "Unknown command %S. Available commands: %s"
14761476
command-func
14771477
(mapconcat 'identity (cider-repl--available-shortcuts) ", "))))

0 commit comments

Comments
 (0)