Is there a way in emacs to open a file (or a dired
directory) in a new buffer, even if there's a buffer with the same file (or directory)?
find-file
and find-alternate-file
always return the open buffer instead of creating a new one.
EDIT: The use case I have is that I am using dired-single
to navigate through directories using a single buffer (so that new directories are opened in the same buffer using find-alternate-file
).
However, if I have two separate buffers for two different directories (which I do when copying files from directory to another, for example) and I navigate in one buffer to the directory of the other, I end up with a single buffer and two frames. I would instead like to have two separate buffers showing the same directory. Much like what happens when I explore directories in my file explorer.
dired
buffers one at/A/B
and one at/A
. I want to copy a file from/A/C
to/A
. So I use the first buffer starting from/A/B
and I hit up (callingdired-single-up-directory
) to go to/A
, intending to navigate toC
withinA
. However, since I have/A
already open, that buffer is just brought up I end with a single buffer. A file explorer allows multiple independent views of the same directory and I am trying to a achieve that withdired
.A/C
then why don't you just do that directly fromA/B
instead of first going up (^
) toA
? JustC-x d
, remove theB
from the inserted default directory nameA/B
, and hitRET
. Or, if you also want to keep bufferA/B
and its window, useC-x 4 d
and do the same thing. It sounds like you are complicating things for yourself.