Subject: bug#55310: 27.2; vc-revert: unhelpful error message when modified buffers exist

From: Sean Whitton <[email-masked]>
Date: Mon, 10 Mar 2025 15:06:30 +0800

Hello,

On Mon 09 May 2022 at 11:38am +02, Lars Ingebrigtsen wrote:

> "Alfred M. Szmidt" <[email-masked]> writes:
>
>>    I don't think we want to have an interface that offers to kill buffers
>>    in a loop -- it sounds like something that's really error-prone, which
>>    is why that code is the way it is, I think.  (To make the user make the
>>    decision themselves explicitly.)
>>
>> We already support such mechanism I think in several other places,
>> like ibuffer, etc.
>
> Sure, but that's a mode to list and act on buffers -- having vc-revert
> kill buffers (even after querying the user) would be surprising.

Currently C-x v u from an individual file's buffer does prompt you to
save it, so it would be good to extend it to this case in VC-Dir.

>> My main problem is really that it is impossible to know _which_
>> buffers are modified, if you have several hundred open in several
>> different projects -- in addition to the fact that the error message
>> is just wrong ("all buffers" -- it is just some buffers, that are
>> marked).
>
> Yes, it would be nice if it actually said which buffers it's talking
> about.
>
>> Idea (ideas are cheap): maybe if one could add some sort of
>> high-light, or something in vc-dired that shows that this or that file
>> has a open buffer that is unmodified, and then the error could be the
>> same but just saying that one should check the highlighted buffers.
>
> I think that's a good idea -- perhaps Dmitry has some comments; added to
> the CCs.

ISTM that a project-save-some-buffers is what's wanted here.

Dmitry, has there been a discussion about having something like that?

-- 
Sean Whitton