2

Recently I have started dabbling in the sml-mode Emacs package for running SML code. The problem I'm facing is when I try to send across a region of my SML code/file to the REPL (which I think is the only logical way of writing multi-line functions in SML without getting troubled by the primitive REPL). Here is my workflow:

  • Open up an SML file (the SML mode shows in the bottom part of the window)
  • Open up the REPL if it isn't already running (C-c C-s)
  • Again get back to the SML file and write a function
  • Select the entire function and then press C-C C-r. I get an error "Not a `sml-prog-proc` buffer"
  • Now instead of selecting a region, just try to send the entire file to the REPL using C-C C-l; again the same error in the mini-buffer

Can someone please help me out in understand why this occurs and how to actually send across code from a script/file to the REPL when using SML? If it matters, I'm using SML/NJ.

TIA, sasuke

4

1 回答 1

4

这也困扰着我,因为它在某些情况下有效,但在其他情况下无效。

如果sml进程被终止C-d(如发出“use”命令时所建议的那样)并立即从同一缓冲区(C-c C-s)重新启动,则无论何时执行任何“发送到复制”操作都会发生错误。

正确的方法(在杀死 repl 之后)是切换回包含正在编辑的 .sml 文件的缓冲区,然后从那里 ( C-c C-s) 或通过 ( C-c C-r) 或 ( C-c C-l) 重新启动 repl。

HTH。

于 2013-01-20T01:28:00.630 回答