以下是在Snow Leopard 10.6.8上使用通过macports安装的coreutils运行Emacs的步骤:
注意:我的macports安装不同于通用的(
/opt/...
)--即,我使用
/macports
作为根目录。更改根设置并非必需,这只是我的个人偏好。对于原始的macport安装或其他设置,请相应调整路径。
sudo /macports/bin/port install coreutils
这段代码需要放在.emacs
或init.el
文件中:
(setq insert-directory-program "/macports/bin/gls")
(setq dired-listing-switches "-aBhl --group-directories-first")
注意:不建议为gls/ls使用符号链接,因为它会破坏macports安装的功能,可能还会影响其他东西。
对于希望获得更多控制权的用户,可以尝试以下替代安装方法:
下载:coreutils-8.21.tar.xz,下载链接:http://ftp.gnu.org/gnu/coreutils/
如果您没有解压缩*.xz文件的工具,可以使用TheUnarchiver3.9.1等工具。
以下是快速参考指南,可将coreutils安装在自定义位置,而非默认位置:
./configure \
--prefix=/Users/HOME/.0.data/.0.emacs/elpa
make
sudo make install
将以下内容插入到你的 .emacs
或 init.el
文件中 -- 根据实际情况调整路径:
(setq insert-directory-program "/Users/HOME/.0.data/.0.emacs/elpa/bin/ls")
(setq dired-listing-switches "-aBhl --group-directories-first")
ls does not support --dired; see
dired-use-ls-dired' for more details`找到了这个问题。所以,我看到/同意符号链接不是一个好主意。我已经安装了coreutils(感谢Homebrew,如果我没记错的话)(包括gls)。因此,ls-lisp解决方案很有趣,我认为@Marius列出的命令_单独_也应该可以工作。我很好奇@hatmatrix的解决方案是否有优势。试一下... - WHO's NoToOldRx4CovidIsMurder(setq dired-listing-switches "-al --human-readable --group-directories-first");
- WHO's NoToOldRx4CovidIsMurder