开发者

Good workflow with emacs+swank+slime+clojure?

开发者 https://www.devze.com 2023-01-03 03:20 出处:网络
I just wanted opinion on good workflow using the emacs environment with clojure+swank+slime. I often find myself doing very repetitive keycommands and wonder if there is an obvious better way.

I just wanted opinion on good workflow using the emacs environment with clojure+swank+slime. I often find myself doing very repetitive keycommands and wonder if there is an obvious better way.

I include swank with lein and start my project using lein swank from shell. Then I connect with emacs and do the correct use commands so that I can start to use (run-tests ). Then I do some coding and then want to test.

To run the test I need to change buffer in emacs to the swank-repl C-x o, then I need to go to the prompt M->, then repeat the command M-p, then enter, maybe with an exception, then back to the code buffer and continue all over again with all the emacs commands. I find it a bit repetitive.

I guess the solution would be to start hac开发者_如何学Pythonk on emacs and maybe add a shortcut for doing this repetitive task, but I would love to hear some suggestions because I can't be the only one who find this tedious?


The clojure-test mode allows almost instantaneous test-edit-test :

  • C-c t : will swap between test code and the implementation code
  • C-c C-, : runs the tests and highlights the line with the failing error
  • C-c C-l : reloads the current file after an edit

For this to work, your tests must follow a convention :

src/name/space/file_under_test.clj

and the testcases in

test/name/space/test/file_under_test.clj

0

精彩评论

暂无评论...
验证码 换一张
取 消