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: Wed, 20 May 2015 08:45:50 +0100 [thread overview]
Message-ID: <87mw0zk7yp.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <jwv1ticnh58.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 19 May 2015 22:00:12 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Could you describe the exact case that bothers you, so we could start by
>>> thinking what should be the ideal behavior for that one?
>> Yes. Any after-change-function that changes another buffer breaks undo.
>> My "noisy-change" package which just logs the before and
>> after-change-function args is an example of this.
>> https://raw.githubusercontent.com/phillord/lentic/master/noisy-change.el
>> My real use case is lentic.
>> Ideal behaviour: is just not to do it. Uncommenting all the
>> "undo_boundary" calls in undo.c seems to achieve this for me, although
>> obviously that's a blunt fix.
>
> Could you be more specific. Give a very concrete example of a sequence
> of commands, and then explain which the undo-boundaries end up being and
> what they should be instead.
Yes, okay.
So, in *scratch* I remove comments from the second and third line and
put everything onto one line.
;; This buffer is for notes you don't want to save, and for Lisp evaluation. If you want to create a file, visit that file with C-x C-f, then enter the text in that file's own buffer.
I load noisy-change.el (but not enable it).
(setq buffer-undo-list nil)
M-x fill-paragraph (with point on the one line)
(nil
(156 . 159)
(#(" " 0 1
(fontified nil face
(whitespace-line font-lock-comment-face)))
. -156)
(nil face nil 155 . 156)
(155 . 156)
(78 . 81)
(#(" " 0 1
(fontified nil face font-lock-comment-face))
. -78)
(#<marker
(moves after insertion)
at 81 in *scratch*> . 1)
(#<marker
(moves after insertion)
at 81 in *scratch*> . 1)
(#<marker
(moves after insertion)
at 81 in *scratch*> . 1)
(#<marker
(moves after insertion)
at 81 in *scratch*> . 1)
(nil face nil 77 . 78)
(77 . 78))
M-x undo
(setq noisy-change-undo t)
(setq buffer-undo-list nil)
M-x fill-paragraph
(nil
(156 . 159)
nil
(#(" " 0 1
(fontified nil face
(whitespace-line font-lock-comment-face)))
. -156)
nil
(nil face nil 155 . 156)
nil
(155 . 156)
nil
(78 . 81)
nil
(#(" " 0 1
(fontified nil face font-lock-comment-face))
. -78)
nil
(nil face nil 77 . 78)
nil
(77 . 78))
At my count it takes 8 undo operations to undo "fill-paragraph".
Obviously, a longer paragraph will take more operations.
Phil
next prev parent reply other threads:[~2015-05-20 7:45 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mw0zk7yp.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).