Subject: bug#44023: dired-allow-duplicate-buffers

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 19 Oct 2020 10:11:42 +0200

Boruch Baum <[email-masked]> writes:

>> > Dired internally (in the very line being modified by my
>> > patch) actively subverts having several buffers visiting the same
>> > directory,
>>
>> What line are you referring to?
>
> -         (buffer (dired-find-buffer-nocreate dirname mode))
>
> It's the only line changed in the patch file, at the beginning of
> function dired-internal-noselect.

Ah, yes, it seems like dired is working the same as when visiting a
regular file here.  As find-file says:

---
Switch to a buffer visiting file FILENAME,
creating one if none already exists.
---

Dired buffers aren't "visiting" files in the same way that regular files
are, but it tries to keep the same semantics.

So renaming a dired buffer doesn't help at all, because Emacs will
always root out the already-existing buffer that points to that
directory.  I wonder whether that's on purpose, or whether it just
happens that way by accident.  Or is there a way to rename a dired
buffer so that you can have two of them pointing to the same directory?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no