0

I am using emacs for clojure development.

So after using: C-u M-x cider-jack-in (in my test file). Followed by lein repl followed by M-x cider-connect I get a strange, partially working repl at the root of my project where I have to provide the fully qualified path of every function complete with its namespace.

How can I provide cider a custom entry point (e.g. a test file)? How can I preload parts of the namespace, or halt execution at a specific point in the program?

Sam Estep
  • 12,974
  • 2
  • 37
  • 75
Abraham P
  • 15,029
  • 13
  • 58
  • 126

2 Answers2

2

Preloading namespaces can be done with C-c C-k in the namespace.

You can place a debug point with C-u C-M-x. When you run code and hit a breakpoint you can follow the keybindings that appear to step in or over lines et cetera. You can use C-c C-c to remove the breakpoint.

See https://github.com/clojure-emacs/cider/blob/master/doc/debugging.md for more information on debugging.

Example from above link: An image of debugging commands

user2609980
  • 10,264
  • 15
  • 74
  • 143
1

you can change your repl namespace by entering (in-ns 'some.namespace) in repl. Or otherwise cider allows you to switch to open file's namespace: open the file in emacs and execute cider-repl-set-ns (or C-c M-n).

To load the whole file into the repl use cider-load-buffer (C-c C-k), or cider-load-file (C-c C-l), and to load single s-expression use cider-eval-last-sexp (placing the cursor after sexp you want to exec and C-x C-e) or cider-eval-sexp-at-point.

leetwinski
  • 17,408
  • 2
  • 18
  • 42