From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Why doesn't emacs yield more?
Date: Thu, 29 Aug 2019 21:46:04 +0300 [thread overview]
Message-ID: <83woevajyr.fsf@gnu.org> (raw)
In-Reply-To: <Ax0Qlg.buzneAF4FD.L5U5XgxNDVnRzicgfcIq@freemail.hu> (message from ndame on Thu, 29 Aug 2019 17:39:20 +0200 (CEST))
> From: ndame <emacsuser@freemail.hu>
> 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
anyway.
> 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.
next prev parent reply other threads:[~2019-08-29 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 15:39 Why doesn't emacs yield more? ndame
2019-08-29 18:46 ` Eli Zaretskii [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-08-29 9:33 ndame
2019-08-29 12:30 ` Eli Zaretskii
2019-08-29 13:00 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83woevajyr.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.