Subject: Re: bug#78890: 31.0.50; Messy vc-annotate buffer names

From: Jim Porter <[email-masked]>
Date: Wed, 25 Jun 2025 08:35:09 -0700

On 6/25/2025 2:48 AM, Sean Whitton wrote:
> On Tue 24 Jun 2025 at 11:02pm -07, Jim Porter wrote:
> 
>> Here's another possible patch for this. It uses 'vc-parent-buffer', which
>> might be nil when first annotating a file, but that works out nicely, since
>> '(buffer-name nil)' gets the buffer name of the current buffer (i.e. the
>> original source file). I think this should be safe, though I'm not an expert
>> on the VC internals.
> 
> Thanks.  We could use vc-parent-buffer somehow, but not unconditionally
> -- it's not always set, but only in certain interactive calls.

I *think* it should always get set buffer-locally by 'vc-setup-buffer' 
once we actually run a command, since 'vc-do-command' calls that 
function. So it should be safe to use 'vc-parent-buffer', though we 
could add another call to 'vc-setup-buffer' if it's not guaranteed to be 
called by all backends or in all corner cases.