gpt4 book ai didi

emacs 错误 'ls does not support --dired'

转载 作者:行者123 更新时间:2023-12-03 23:35:29 25 4
gpt4 key购买 nike

自从升级到 emacs 24.x每当我打开目录时,我都会看到此错误。整个错误是:

ls does not support --dired; see `dired-use-ls-dired' for more details.

查看变量,可以发现:
dired-use-ls-dired is a variable defined in `dired.el'.
Its value is nil
Original value was unspecified

Documentation:
Non-nil means Dired should pass the "--dired" option to "ls".
The special value of `unspecified' means to check explicitly, and
save the result in this variable. This is performed the first
time `dired-insert-directory' is called.

Note that if you set this option to nil, either through choice or
because your "ls" program does not support "--dired", Dired
will fail to parse some "unusual" file names, e.g. those with leading
spaces. You might want to install ls from GNU Coreutils, which does
support this option. Alternatively, you might want to use Emacs's
own emulation of "ls", by using:
(setq ls-lisp-use-insert-directory-program nil)
(require 'ls-lisp)
This is used by default on MS Windows, which does not have an "ls" program.
Note that `ls-lisp' does not support as many options as GNU ls, though.
For more details, see Info node `(emacs)ls in Lisp'.

You can customize this variable.

我在 FreeBSD 上运行;所以默认 ls不是 GNU'ish 并且不提供 --dired选项。我真的不想麻烦在我所有的服务器上安装 GNU coreutilities。

任何人都对 lisp 有任何经验 ls上面提到的替代方案?

大概是 dired.el正在设置 dired-use-ls-dired加载时非零的东西,我第一次查看目录时经常破坏它?并设置 dired-use-ls-dired在我的 .emacs 中为零会安静的消息?

有没有人认为不急于工作可能代表安全问题?即由空格组成的文件名会保持不可见吗?

也许我应该测试上面的一些......

最佳答案

在 macOS 上,ls不支持 --dired在 Linux 上支持该选项。

(when (string= system-type "darwin")       
(setq dired-use-ls-dired nil))

关于emacs 错误 'ls does not support --dired',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25125200/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com