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

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

问题描述

我希望设置 slime+lein-swank 以在保存文件时重新加载从 repl 引用的源文件.目前我这样做:

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:

  • 编辑文件
  • 保存文件
  • 切换到复制
  • (使用 :reload-all 'com.package.namespace)
  • 测试内容

我不想记住做第 4 步.

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

推荐答案

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

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天全站免登陆