[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: disabling undo boundaries
From: |
Phillip Lord |
Subject: |
Re: disabling undo boundaries |
Date: |
Fri, 07 Aug 2015 14:40:13 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> I think that the current undo-boundary behaviour wrt a single buffer
>> makes sense. It's the fact that inserting content into *that* buffer
>> forces an undo-boundary into *this* buffer. I don't know why Emacs
>> does this.
>
> I think the reason is not very deep: for reasons of efficiency (back in
> the days when 8MB was a lot of memory), Emacs keeps track of a few
> undo-related pieces of information in global variables, so it can only
> handle a single buffer at a time. If a command touches some other
> buffer, the C code has to choose between "just switch" and "push
> a boundary and then switch", and the choice it makes is to err on the
> "safe" side of adding a potentially unnecessary undo-boundary rather
> than risking to let the undo-log grow without intervening boundaries.
I meant "deep" in the sense of "deep in version control history" -- or
in this case, before the version control system. Still, I didn't know
this was the reason.
Arguing against this are my experiments which suggest that
undo-boundaries are, in practice, rarely inserted in this way (about 1%
of times these functions are called, although, of course, it will depend
on how you are using Emacs).
> In your cases, this is complicated by the fact that you're concerned
> about self-insert-command which is very special in that it was the only
> command that doesn't push a boundary every time, but only once every
> N repetitions.
I am slightly concerned about this, but not overly concerned. The main
thing that I am worried about is here:
https://github.com/phillord/lentic/issues/20
where, for example, a single "fill-paragraph" command takes many undos
to undo because of multiple changes in *another* buffer.
Anyway, the patch is there. Any chance? If not, anything (further) that
I can add (or remove!) to the branch to make it happen?
Failing that, I will have to think about how to remove the undo-boundary
post-hoc, or give up and accept that lentic will interfere with undo.
Haven't decided which yet.
BTW, I did a demonstration at a conference last, which pitted Emacs
(lagging badly on a badly overloaded netbook) with CIDER, and lentic
against several slick websites. We won the best demo prize. You have to
laugh...
Phil
- Re: disabling undo boundaries, Phillip Lord, 2015/08/04
- Re: disabling undo boundaries, Stefan Monnier, 2015/08/07
- Re: disabling undo boundaries, Stefan Monnier, 2015/08/08
- Re: disabling undo boundaries, Phillip Lord, 2015/08/09
- Re: disabling undo boundaries, Stefan Monnier, 2015/08/09
- Re: disabling undo boundaries, Phillip Lord, 2015/08/09
- Re: disabling undo boundaries, Stefan Monnier, 2015/08/09