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: Sergey Organov
Subject: Re: How to revert buffer from "Save file?" prompt?
Date: Tue, 08 Jun 2021 18:18:46 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Sergey Organov <sorganov@gmail.com>
>> Date: Mon, 07 Jun 2021 17:24:14 +0300
>> 
>> When I have a modified buffer and run, say "compile", emacs asks to:
>> 
>> Save file /home/osv/f/firm/make/defaults.make? (y, n, !, ., q, C-r, d or C-h)
>> 
>> and the set of choices doesn't seem to include "discard changes", or
>> "revert buffer" in emacs terminology.
>> 
>> What is the most convenient way to revert this particular buffer once
>> I'm there at this prompt?
>
> 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.

>
> 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. With current design I need to remember the buffer(s), maybe
answer a few more questions until compilation is finally being run,
switch to every buffer I rarely still remembered in turn, and revert
it(them). The latter activity is also often superseded by compilation
errors that get my attention and I forget about the changed buffer(s).
Make fixes to the code, save, run compile and... boom! The prompt is
back. Isn't that *a lot* of trouble that'd be solved by a simple option
for discarding changes?

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.

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.

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.

Thanks,
-- Sergey Organov



reply via email to

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