From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: disabling undo boundaries
Date: Fri, 15 May 2015 20:49:42 +0100 [thread overview]
Message-ID: <87siaxk4dl.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <jwvh9rdlnsc.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 15 May 2015 14:08:56 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> That doesn't really make sense to me. Say I am editing a file in this
>> buffer while compiling something in that buffer. Why would I want an
>> update in the compilation buffer to force an undo-boundary in this buffer?
>
> It probably won't make any difference in "this buffer" because the
> process filter will be run *between* commands (at which point the
> read-eval command loop already inserts undo-boundaries anyway).
>
> The difference is in the compilation buffer where it'll insert undo
> boundaries every time you run a command in "this buffer".
Yes, I can see that. Although iff this is the reason for the
undo-boundary, it would still make more sense to me to have the process
code insert this. Aside from being a more discrete effect, it would also
avoid the current "do nothing now, but insert an undo-boundary before
the next change where ever that is" semantics.
>
>> Sorry to be persistant about this, but at the moment, changing the code
>> in undo.c is the only good solution I can see to my problem. It would be
>> different if explicitally called and automatic boundaries were
>> distinguishable, but they aren't.
>
> We could make them distinguishable, OTOH (e.g. using a (weak) hash-table where
> we insert every explicitly added undo-boundary).
I don't understand how that would that work. undo-boundaries are nil, so
surely they are all the same object?
Using symbols like:
'(boundary . user)
'(boundary . internal)
would enable this, I think. But it would break code like this:
(while (or (null (car buffer-undo-list))
(and discard-pos (integerp (car buffer-undo-list))))
(setq buffer-undo-list (cdr buffer-undo-list)))
from undo-tree, and I would guess quite a lot of other places.
I have thought of a partial solution -- which is to add a symbol to
b-u-l in the pre-command-hook, the delete all the boundaries added since
that in the post-command-hook. That gets me to a clean "boundary at
every command" semantics. I couldn't work out how to do this before,
again, because boundaries are all the same object.
Phil
next prev parent reply other threads:[~2015-05-15 19:49 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-10 21:43 disabling undo boundaries Phillip Lord
2015-05-11 1:42 ` Stefan Monnier
2015-05-11 11:46 ` Phillip Lord
2015-05-11 14:45 ` Stefan Monnier
2015-05-11 16:31 ` Phillip Lord
2015-05-11 19:30 ` Stefan Monnier
2015-05-11 20:42 ` Phillip Lord
2015-05-11 22:23 ` Stefan Monnier
2015-05-12 11:52 ` Phillip Lord
2015-05-12 20:15 ` Stefan Monnier
2015-05-12 20:59 ` Phillip Lord
2015-05-13 12:32 ` Stefan Monnier
2015-05-13 15:40 ` Phillip Lord
2015-05-14 15:28 ` Stefan Monnier
2015-05-15 12:27 ` Phillip Lord
2015-05-15 18:08 ` Stefan Monnier
2015-05-15 19:49 ` Phillip Lord [this message]
2015-05-15 23:45 ` Stefan Monnier
2015-05-16 13:31 ` Phillip Lord
2015-05-19 11:59 ` Phillip Lord
2015-05-19 19:42 ` Stefan Monnier
2015-05-19 21:48 ` Phillip Lord
2015-05-20 2:00 ` Stefan Monnier
2015-05-20 7:45 ` Phillip Lord
2015-05-20 12:53 ` Stefan Monnier
2015-05-21 11:15 ` Phillip Lord
2015-05-21 15:44 ` Stefan Monnier
2015-05-21 17:03 ` Phillip Lord
2015-05-27 11:46 ` Phillip Lord
2015-06-29 0:46 ` Stefan Monnier
2015-08-04 14:18 ` Phillip Lord
2015-08-06 21:02 ` Phillip Lord
2015-08-06 22:20 ` Stefan Monnier
2015-08-07 13:40 ` Phillip Lord
2015-08-07 13:59 ` David Kastrup
2015-08-07 21:10 ` Phillip Lord
2015-08-08 5:39 ` David Kastrup
2015-08-08 9:58 ` Phillip Lord
2015-08-07 17:10 ` Stefan Monnier
2015-08-08 21:28 ` Stefan Monnier
2015-08-09 15:39 ` Phillip Lord
2015-08-09 16:30 ` Stefan Monnier
2015-08-09 16:50 ` Phillip Lord
2015-08-09 17:40 ` Stefan Monnier
2015-08-10 9:27 ` Phillip Lord
2015-08-10 21:21 ` Phillip Lord
2015-08-12 21:15 ` Stefan Monnier
2015-08-12 22:34 ` Phillip Lord
2015-08-13 2:23 ` Stefan Monnier
2015-08-21 9:40 ` Phillip Lord
2015-08-07 23:49 ` Davis Herring
2015-08-08 10:01 ` Phillip Lord
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=87siaxk4dl.fsf@newcastle.ac.uk \
--to=phillip.lord@newcastle.ac.uk \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.