Subject: Re: bug#68697: Add option to not always use *grep* buffer when executing `grep' or `vc-git-grep' command

From: Eli Zaretskii <[email-masked]>
Date: Thu, 25 Jan 2024 09:24:50 +0200

> From: Nafiz Islam <[email-masked]>
> Date: Wed, 24 Jan 2024 15:16:12 -0500
> 
> The way `grep' and `vc-git-grep' works right now is that it will always output its result to a buffer called
> `*grep*'. So, if I perform another `grep' command, it will overwrite the previous grep result (unless I
> rename the buffer beforehand).
> 
> I would like, at least, an option to create a new buffer each time a `grep' command is executed.
> Maybe each new buffer could be given the name based on the regexp or the grep shell command
> used.

Did you try to define a compilation-buffer-name-function that would do
what you want?  Such a function can produce any buffer name you want.