如何使用swank + leiningen + emacs保存时重新加载文件 [英] How to Reload files upon save when using swank+leiningen+emacs

查看:213
本文介绍了如何使用swank + leiningen + emacs保存时重新加载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置slime + lein-swank重新加载源文件引用从我保存文件的repl。目前我这样做:




  • 编辑文件

  • 保存文件

  • 切换到repl

  • (使用:reload-all'com.package.namespace)

  • 测试内容



我不想记得做第4步。

解决方案

对于 slime-compile-and-load-file ,您可以在切换到REPL之前使用SLIME的 Cc Ck 。它将提示您保存文件(如果您尚未保存)。完成后,您重新定义的内容应在SLIME REPL的新版本中提供。然后你可以使用 C-c C-z 来打开REPL(当你不再需要它时,用 C-x 0 关闭它)。


I'm looking to set up slime+lein-swank to reload source files referenced from the repl when i save the file. currently i do this:

  • edit file
  • save file
  • switch to repl
  • (use :reload-all 'com.package.namespace)
  • test stuff

I want to not have to remember to do step 4.

解决方案

You can use SLIME's C-c C-k before switching to the REPL, for slime-compile-and-load-file. It will prompt you to save the file if you haven't already. When it's done, the things which you've redefined should be available at the SLIME REPL in their new versions. Then you could use C-c C-z to bring up the REPL (close it with C-x 0 when you don't need it anymore).

这篇关于如何使用swank + leiningen + emacs保存时重新加载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆