如何省略 ido-switch-buffers 和 ido-dired 上的某些文件夹?

How to omit certain folders on ido-switch-buffers and ido-dired?

我想在 Emacs 中更改缓冲区时忽略通过 ido-dired 出现的某些文件夹。这些文件夹是 Mac 上的系统文件夹,否则不应删除,所以至少我想隐藏它们(特别烦人的是,例如 ~/Documents,当有人想更改为~/Downloads 并因此开始键入 Do...)。

为此,我找到了 ido-ignore-directories 并在 .emacs 中使用了以下行来省略这些文件夹:

(setq ido-ignore-directories (quote ("~/Applications" "~/Documents" "~/Library" "~/Movies" "~/Music" "~/Pictures" "~/Public")))

问题是,当我使用 ido-dired 时仍然会提示它们。

如何在 ido-dired 上隐藏文件夹?

更新

按照npostavs的建议设置ido-ignore-directories时,文件夹仍然出现:

To this end, I found ido-ignore-directories and I used the following line in .emacs to omit these folders:

(setq ido-ignore-directories (quote ("~/Applications" "~/Documents" "~/Library" "~/Movies" "~/Music" "~/Pictures" "~/Public")))

ido-ignore-directories 是正确的变量,但它只匹配目录名称本身,而不匹配完整路径。

(setq ido-ignore-directories
      '("Applications/" "Documents/" "Library/" "Movies/" "Music/" "Pictures/" "Public/"))