[Top][All Lists]

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

Re: Why doesn't emacs yield more?

From: Eli Zaretskii
Subject: Re: Why doesn't emacs yield more?
Date: Thu, 29 Aug 2019 21:46:04 +0300

> From: ndame <>
> Date: Thu, 29 Aug 2019 17:39:20 +0200 (CEST)
> > Assuming it was redisplay that took most of the time: you cannot
> > interrupt it, not by default.  What would be the purpose of that?
> > Emacs cannot allow the display to be left in a state that is
> > inconsistent with the contents of the buffer, so it will immediately
> > reenter another redisplay cycle.
> If I e.g. do a C-y and consquently emacs starts a long operation then
> if I interrupt then emacs could simply restore the buffer/display state
> from before the C-y state.

Emacs doesn't support transactional operations, not in general.  Once
you yank some text, the global state could be modified to the degree
that rolling it back may not be possible; and Emacs doesn't know how

> I didn't see my C-y operation finish because of the redisplay, so I
> wouldn't mind if a C-g would cancel that too.

Most use cases are different.  What if, e.g., the command that hangs
sends some material over a network connection, or writes it to a file,
or passes it to a subprocess?

You can always undo manually, of course, and that could be one more
way of stopping a prolonged redisplay (assuming this is what caused
the delay in your case; you still haven't described enough detail for
me to know what are we talking about).

> I don't know if a snapshot can be made of the current buffer/display
> state, but if emacs can do that then it could simply restore the
> previous snapshot instantly, so there would be no issue of inconsistent
> buffer/display after interrupting.

That's a far cry from how Emacs was designed and implemented.  It
isn't a transactional system.

reply via email to

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