【问题标题】:run sml console at emacs - searching for program: no such file or directory?在 emacs 上运行 sml 控制台 - 搜索程序:没有这样的文件或目录?
【发布时间】:2013-09-27 14:01:17
【问题描述】:

我在 Ubuntu 12.04 上安装了 SML。

这里有更多信息:

nazar_art@nazar-desctop:~$ sml -version
Standard ML of New Jersey v110.75 [built: Mon Sep  2 23:36:16 2013]

并将这个包添加到emacs:

M x list-packages  + Enter

找到sml-mode并通过鼠标点击安装。 但是当我尝试编写简单的.sml 文件时,我想在 emacs 上打开 sml 控制台。

我按C c + C s => 我看到SML command: sml 然后按Enter

看到这条消息:

Searching for program: no such file or directory

而不是打开 sml 控制台。

我不明白为什么会这样?

  • 如何解决这个问题?

更新:

这是我的which sml

/usr/local/SML/bin/sml

和 emacs 版本 - GNU Emacs 24.3.1here 安装,但仅适用于 emacs24,不适用于 emacs-snapshot。

【问题讨论】:

  • 对我来说很好。你的 Emacs 版本是多少?还要确保which sml(getenv "PATH") 兼容。
  • @abo-abo 我更新了问题。 which sml and (getenv "PATH") are compatible - 你能解释一下如何检查这个声明吗?
  • (getenv "PATH") 您应该使用M-: 进行评估。或者只需将此代码粘贴到*scratch* 中,然后在语句结束时按C-j。这告诉你 Emacs 对 $PATH 的看法。您的问题可能是 /usr/local/SML/bin/ 不在 $PATH 上。您可以将此添加到~/.profile 或其他内容。

标签: emacs installation sml


【解决方案1】:

您的问题是 sml 可执行文件不在 Emacs 看到的 PATH 上。 你可以从bash 启动sml 可能是因为你修改了路径 在~/.bashrc

  1. 选项 1:修改 PATH 在~/.profile(您需要注销一次):

    导出 PATH=$PATH:/usr/local/SML/bin/

  2. 选项 2:创建链接

    sudo ln -s /usr/local/SML/bin/sml /usr/bin/sml

  3. 选项 3:apt 为我安装 sml 到 /usr/bin/(Emacs 知道这个路径)

    sudo apt-get install smlnj

【讨论】:

    【解决方案2】:

    选项 4:使用以下命令评估以下内容:CM-: (setq exec-path (cons "/usr/local/SML/bin" exec-path)) return/enter 或将其放入 $home/.emacs 以使其在所有会话中持续存在。

    【讨论】:

      【解决方案3】:

      只是详细说明出血手指提到的步骤:

      第一步:从终端启动emacs。

      第二步:按 ctrl+x+f。

      第 3 步:你会在底部看到“查找文件:~/”,然后写“/.emacs”。

      第四步:将这一行“setq exec-path (cons "/usr/local/SML/bin" exec-path))”粘贴进去。

      step5:按 Ctrx+x+s 保存更改,然后重新启动 emacs。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-17
        • 2016-08-15
        • 2013-12-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多