all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: An idea: combine-change-calls
Date: Sat, 24 Mar 2018 18:18:05 -0400	[thread overview]
Message-ID: <jwvy3ihp2ik.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 20180324135024.GA6319@ACM

> The motivation is bug #30735,

[ Not surprised: I told you CC-mode's change-functions are too costly,
  because they presumes that before&after-change-functions are called at
  a "human" rate (comparable to pre/post-command-hook).
  before&after-change-functions should be handled a bit like POSIX
  signals: do as little work as possible there, and handle them
  later elsewhere.  `comment-region` is not the only command that can
  make many small changes.  ]

> What do people think?

I actually do like the idea of combining such things, tho it's risky:
e.g. if the code within combine-change-calls uses syntax-ppss it might
get wrong results since syntax-ppss-flush-cache is triggered via
before-change-functions.  The same problem would affect
syntax-propertize, of course.

Grepping for `add-hook.*before-change-functions` indicates that similar
problem could appear elsewhere.  Not sure what to do about it other than
to say "don't over-use it, it might bite you".

Also we'd need such a system to check that the bounds
are indeed obeyed.

One more thing: with the sample code you showed, undoing will still be
just as slow since it won't benefit from combine-change-calls.
Maybe combine-change-calls should also combine all those changes on the
undo-list into a big "delete+insert" (of course, it could also try and
keep the undo granularity but mark those undo entries so that they're
undone within their own combine-change-calls).


        Stefan




  reply	other threads:[~2018-03-24 22:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-24 13:50 An idea: combine-change-calls Alan Mackenzie
2018-03-24 22:18 ` Stefan Monnier [this message]
2018-03-25 19:14   ` Alan Mackenzie
2018-03-25 20:05     ` Stefan Monnier
2018-03-26 20:17       ` Alan Mackenzie
2018-03-26 21:07         ` Stefan Monnier
2018-03-27 16:58           ` Alan Mackenzie
2018-03-27 18:30             ` Stefan Monnier
2018-03-27 19:45               ` Alan Mackenzie
2018-03-27 20:24                 ` Stefan Monnier
2018-03-28 20:42                   ` Alan Mackenzie
2018-03-28 21:26                     ` Stefan Monnier
2018-03-29 15:10                       ` Alan Mackenzie
2018-03-29 15:40                         ` Stefan Monnier
2018-03-29 17:11                           ` Alan Mackenzie
2018-03-29 19:10                             ` Stefan Monnier
2018-03-30 11:46                               ` Alan Mackenzie
2018-03-30 15:05                                 ` Stefan Monnier
2018-03-31 21:00                                   ` Alan Mackenzie
2018-03-31 23:38                                     ` Stefan Monnier
2018-04-01 14:24                                       ` Alan Mackenzie
2018-04-01 19:22                                         ` Stefan Monnier
2018-03-30  9:12           ` Johan Bockgård
2018-03-30 13:04             ` Stefan Monnier
2018-04-02 16:25               ` Alan Mackenzie
2018-04-02 17:52                 ` Johan Bockgård
2018-04-03  0:41                 ` Stefan Monnier
2018-04-03  1:43                 ` Clément Pit-Claudel
2018-04-03  3:15                 ` Richard Stallman
2018-03-26 21:09         ` Stefan Monnier
2018-03-27  0:36         ` Stefan Monnier
2018-03-27 17:00           ` Alan Mackenzie

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=jwvy3ihp2ik.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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 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.