help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to revert buffer from "Save file?" prompt?


From: Eli Zaretskii
Subject: Re: How to revert buffer from "Save file?" prompt?
Date: Tue, 08 Jun 2021 18:41:27 +0300

> From: Sergey Organov <sorganov@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> Date: Tue, 08 Jun 2021 18:18:46 +0300
> 
> > Why do you need to revert?  If you answer 'n' (= NO), the compilation
> > will use the version on disk, without saving your edits.  You can
> > later revert the buffer, but that's a separate operation.
> 
> Yes, and that's exactly the problem. It will ask me again and again
> every time I compile. Annoying as hell.

Do you want to compile the file, or do you want to revert it?  These
are two orthogonal things, so it sounds strange to me that you seem to
use "M-x compile" as the means to find all the changes buffers and
revert them.

> > IOW, if all you want is to revert the buffer _without_ compiling, just
> > type C-g to abort "M-x compile" and then revert.
> 
> No, I want to compile, and I don't need the changes in some buffer(s)
> anymore.

Then how come you left those buffers modified?  And what does that
have to do with compilation?

> Probably something like revert-some-buffers (similar to
> save-some-buffer) would help as well, but a feature to discard changes
> from the "save file" prompt would be definitely more helpful.

Then this isn't about "M-x compile", right?  It's about being able to
revert some of the modified buffers, either as a separate command, or
as part of "C-x s".  Right?

> As I've asked in another mail: is there a practical way to add
> keybindings to this prompt? I'd then opt for adding "C-M-g: revert the
> buffer" and be finally done with it.

See save-some-buffers-action-alist.

> Also, while we are at this, emacs is extremely modal when at this
> prompt, not allowing me to switch to the buffer (to revert it) even when
> I view it using 'C-r'. This feels rather unnatural and too limiting for
> otherwise very non-modal design.

Some commands are modal for a reason.  Whether this is one of them,
I'm not sure; file a feature-request bug report to see what the Emacs
developers think about that.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]