【问题标题】:Emacs Dired not working - Searching for program: no such file or directory, lsEmacs Dired 不工作 - 搜索程序:没有这样的文件或目录,ls
【发布时间】:2016-06-16 07:41:49
【问题描述】:

当我打开 emacs 并输入 C-x C-f RET 时,迷你缓冲区会显示

Searching for program: no such file or directory, ls

当我在输入任何目录名称后按回车键时也会发生这种情况。当我使用C-x d 时,Dired 也不起作用。查找文件工作正常。

我使用的是 mac os x 10.11 和 GNU Emacs 24.5.1。有什么东西可以放在.emacs 中导致这种情况吗?此外,在我重新启动计算机之前,它似乎工作正常。

【问题讨论】:

  • getenvPATH 返回什么?
  • /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Racket v6.5/bin 我正在使用使emacs感知的插件你们的环境变量。
  • 我刚刚重新安装了 emacs。大约第四次重新安装后,它似乎工作了。
  • 您的问题毫无疑问是ls 程序不在您的PATH 中。
  • 我可以在 bash 中使用 ls。

标签: emacs dired


【解决方案1】:

您可以在 bash 中使用which ls 来查找ls 的位置,例如在/bin/ls 中。然后您需要使用以下代码将目录/bin 添加到PATHexec-path

(setenv "PATH" (concat (getenv "PATH") ":/bin"))
(setq exec-path (append exec-path '("/bin")))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-10
    • 1970-01-01
    • 2013-09-27
    • 2013-03-31
    • 2019-09-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多