Subject: bug#36122: A second find-dired clobbers the first's buffer

From: Juri Linkov <[email-masked]>
Date: Tue, 09 Jul 2019 23:18:22 +0300

>> Do find-dired on directory A.
>> Then do find-dired on directory B.
>> A second find-dired clobbers the first's buffer!
>> Imagine if there could only be one Dired buffer in emacs.
>> Well, the same goes for find-dired.
>
> That's how the kinda related commands like M-x grep work -- if you want
> more than one, you have to rename them.  So I think this works as
> advertised.

Yes, there are many ways to do this:

(add-hook 'dired-after-readin-hook 'rename-uniquely)

(add-hook 'compilation-mode-hook 'rename-uniquely)

or better

(setq compilation-buffer-name-function
      (lambda (mode-name)
        (generate-new-buffer-name
         (concat "*" (downcase mode-name) "*"))))
...