1

I would like to ignore certain folders turning up via ido-dired when changing buffers in Emacs. These folders are system folders on a Mac and should not be removed otherwise, so at least I would like to hide them (especially annoying is, for example, ~/Documents which is suggested when one wants to change to ~/Downloads and thus starts to type Do...).

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")))

The problem is, that they are still suggested when I use ido-dired.

How can the folders be hidden on ido-dired?

Update

When setting ido-ignore-directories as suggested by npostavs, the folder still appear: enter image description here

Marius Hofert
  • 6,546
  • 10
  • 48
  • 102
  • Do you mean `ido-switch-buffer`? For this you need to set `ido-ignore-buffers`. Notice that it needs to be a regex or a function, so a plain string will not do. I'm afraid `ido-dired` does not have such a variable. – pmr May 27 '15 at 21:47
  • Hi, yes, I meant `ido-switch-buffer` (I'll correct it, thanks). `ido-ignore-buffers` is only for ignoring files, but not *folders* (as far as I have understood). I mainly use `ido-dired`... it's unfortunate that it's not possible for that. – Marius Hofert May 27 '15 at 21:53
  • I'm lost. You talk about `ido-switch-buffer` and then about directories. That makes no sense. `ido-switch-buffer` switches between buffers, it does not care what the buffer represents. – pmr May 28 '15 at 09:06
  • ahh, right, `ido-switch-buffer` is probably wrong... if the folder doesn't appear as a buffer, it should not appear. I updated the question accordingly. – Marius Hofert May 28 '15 at 10:25

1 Answers1

1

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 is the correct variable, but it matches just the directory name itself, not the full path.

(setq ido-ignore-directories
      '("Applications/" "Documents/" "Library/" "Movies/" "Music/" "Pictures/" "Public/"))
Community
  • 1
  • 1
npostavs
  • 4,877
  • 1
  • 24
  • 43
  • Hi, thanks for helping. I tried that, deleted all the buffers (just in case), but if I want to change to `Downloads`, then still `Documents` is suggested first, for example (see my screenshot). Hmmm... – Marius Hofert May 28 '15 at 10:26
  • sorry, I realize now that what I tested to work for myself, was slightly different than what I posted, because I misinterpreted the reason for your settings not working. Updated with an actual working setting now. – npostavs May 28 '15 at 15:45