Search code examples
emacsframedired

How to stick Dired-mode buffer to a separate frame in Emacs?


I want files navigation via dired to be made in a separate frame but all files to be open in another frame. So how can I stick dired-mode buffers to a standalone-frame? Thanks.

I am interested in solution w/o using extra-packages.


Solution

  • Put something like this in your init file (.emacs):

        (defadvice dired (after dedicate activate)
          "Make this Dired window dedicated."
          (set-window-dedicated-p (selected-window) t))
    

    That makes Dired's window be dedicated, meaning that it cannot be reused for another buffer. You can do the same thing for other Dired commands -- e.g. dired-other-window.