unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Problem with undo and text properties.
Date: Thu, 9 Apr 2015 11:10:40 +0000	[thread overview]
Message-ID: <20150409111040.GA3337@acm.fritz.box> (raw)

Hello, Emacs.

I noticed the following problem whilst solving bug #20266.  In that bug,
in a ~1500 line file.h, mark the entire buffer and yank it to the end of
itself, doubling its size, with C-x h, M-w, M->, C-y.  This went slowly,
and will soon go at a reasonable speed.

However, if you then undo this with C-x u, it takes almost forever to
complete.  The reason is that in the undo list there are lots (~6500) of
text property entries like

    (nil fontified nil 92222 . 92237)

which get individually undone.  Each such undoing is a buffer change, and
so triggers \(before\|after\)-change-functions.  This makes the operation
SLOW.

Perhaps it would be better to amend undo such that the removal (?and
re-application?) of text properties doesn't trigger the change hooks.  Or
perhaps a means could be devised of informing the change hooks that such
a change is what is being done.

What do you think?

-- 
Alan Mackenzie (Nuremberg, Germany).



             reply	other threads:[~2015-04-09 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 11:10 Alan Mackenzie [this message]
2015-04-09 11:19 ` Problem with undo and text properties João Távora
2015-04-09 13:17 ` Stefan Monnier
2015-04-13 19:10   ` Alan Mackenzie
2015-04-13 21:23     ` 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

  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=20150409111040.GA3337@acm.fritz.box \
    --to=acm@muc.de \
    --cc=emacs-devel@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 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).