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?

7
  • 1
    Pressing RET runs dired-find-file, which opens another buffer. dired-find-alternate-file reuses the current buffer, is that what you want? Commented Sep 24, 2014 at 9:20
  • Is fired a package? Or did you do the same typo 3 times? Commented Sep 24, 2014 at 10:51
  • This was the spellchecker...... fired=dired. Commented Sep 24, 2014 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? Commented Sep 24, 2014 at 11:48
  • Have you customized any setting related to display-buffer or display-buffer-alist ? Commented Sep 24, 2014 at 18:32

2 Answers 2

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.

2
  • 1
    I think the OP is asking to keep multiple dired windows, but not allow multiple dired windows visiting the same directory. Commented Sep 24, 2014 at 17:47
  • Yup - multiple dired windows, but only one per directory. Commented Sep 25, 2014 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
  • 1
    Yes - true. But I would like to keep one buffer per directory, but just not duplicates. Commented Sep 24, 2014 at 11:10

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.