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

From: Sean Whitton <[email-masked]>
Date: Sat, 15 Mar 2025 15:37:19 +0800

Hello,

On Sat 15 Mar 2025 at 04:18am +02, Dmitry Gutov wrote:

> Re-reading the discussion again, maybe Lars's original suggestion - from
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55310#8 - is better?

Yes, this is exactly what I was suggesting :)  I'll go ahead and do that.

> This way we'd only require that the buffers to be reverted, are saved. And
> abort otherwise.
>
> Also probably change the error to something like
>
>   "Please kill or save all affected buffers before reverting"
>
> If we can't print all the buffer names, which we also could try, though.
>
> Requiring all buffers across the project (never mind the session) to be saved
> before any can be vc-reverted, would be a more disruptive change.
>
>> (2) Add a project-save-some-buffers which just binds
>>      save-some-buffers-default-predicate around a call to
>>      save-some-buffers, bind is to 'C-x p C-x s' (useful anyway, I think)
>>      and change the message to suggest using it:
>>        "Use C-x p C-x s to save or kill modified buffers before reverting"
>
> Adding a new command with a binding sounds good to me, irrespective of this
> issue.

Okay, I'll send you a patch.

-- 
Sean Whitton