6

When I open a directory using dired and there is already the same directory opened in dired, a second one is opened with <2>. How can I inhibit this creation of the duplicate window and switch to the existing one?

I know that I can set dired to use only one window, but I just do not want to have two dired windows for the same directory.

Dired naturally does this when I open the same path twice. But I access the same directory via different paths (via symlinked paths), I seem to have the duplicates. How can I reuse the same window when I access the same directory through different paths because of symbolic links?

  • 1
    Pressing RET runs dired-find-file, which opens another buffer. dired-find-alternate-file reuses the current buffer, is that what you want? – T. Verron Sep 24 '14 at 9:20
  • Is fired a package? Or did you do the same typo 3 times? – Malabarba Sep 24 '14 at 10:51
  • This was the spellchecker...... fired=dired. – Rainer Sep 24 '14 at 11:03
  • I'm confused, isn't this the default behaviour? When you say When I open a directory, what method are you using? – Malabarba Sep 24 '14 at 11:48
  • Have you customized any setting related to display-buffer or display-buffer-alist ? – Vamsi Sep 24 '14 at 18:32
4

Using dired+, which brings other cool improvements to dired, you only need to set the toggle-diredp-find-file-reuse-dir var to t.

  • 1
    I think the OP is asking to keep multiple dired windows, but not allow multiple dired windows visiting the same directory. – nispio Sep 24 '14 at 17:47
  • Yup - multiple dired windows, but only one per directory. – Rainer Sep 25 '14 at 7:28
0

You can try out the dired-single package from Melpa.

This package, though, does more than what you asked for. It creates a dired-single-magic-buffer; it always updates the same buffer whether or not you opened the same dired directory.

You can read more about it on this emacswiki page.

  • 1
    Yes - true. But I would like to keep one buffer per directory, but just not duplicates. – Rainer Sep 24 '14 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.