From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii Subject: =?UTF-8?B?YnVnIzIzOTE3OiBQbGVhc2UgY29uc2lkZXIgbWFraW5nIEJ1ZyAj?= =?UTF-8?B?MjM5MTcgYSBibG9ja2VyIGZvciAyNS4xICh3YXMgUmU6IG9yZy1jYXB0dXJl?= =?UTF-8?B?OiBDYXB0dXJlIHRlbXBsYXRlIOKAmGfigJk6IE1hdGNoIGRhdGEgY2xvYmJl?= =?UTF-8?B?cmVkIGJ5IGJ1ZmZlciBtb2RpZmljYXRpb24gaG9va3Mp?= Date: Thu, 21 Jul 2016 05:43:53 +0300 Message-ID: <83h9bjzp5i.fsf__13351.0428750471$1469069178$gmane$org@gnu.org> References: <87vb066ejv.fsf@linaro.org> <87bn1yyaui.fsf@linaro.org> <87mvlhmv0x.fsf_-_@moondust.awandering> <837fcl5zs9.fsf@gnu.org> <87a8hgkwcb.fsf@linaro.org> <8360s42mcb.fsf@gnu.org> <87eg6rgmlg.fsf@gmail.com> <83lh0y24y6.fsf@gnu.org> <83eg6q1hbo.fsf@gnu.org> <83a8hd1vzi.fsf@gnu.org> <834m7l1u8u.fsf@gnu.org> <83shv4z7e8.fsf@gnu.org> <83inw0yw9q.fsf@gnu.org> <87bn1rdd1f.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ3z4-00087K-1x for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 22:45:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ3z2-00075H-5h for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 22:45:09 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87bn1rdd1f.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: npostavs@users.sourceforge.net Cc: nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, monnier@iro.umontreal.ca, alex.bennee@linaro.org > From: npostavs@users.sourceforge.net > Cc: Eli Zaretskii , 23917@debbugs.gnu.org, nljlistbox2@gmail.com, jwiegley@gmail.com, rpluim@gmail.com, alex.bennee@linaro.org > Date: Wed, 20 Jul 2016 20:56:28 -0400 > > >> Maybe there's a misunderstanding. What Noam suggested was just to > >> move the code which adjusts search_regs.start[i] and .end[i] to before > >> the call to replace_range. > > > > Oh, right, that's also an option. It might suffer from another problem, > > which is that the match-data will be broken while the > > before-change-functions are run, so if there's a save-match-data there > > we're back to square one. > > Solution: adjust in between the before and after change functions. > Patch below. I think there shouldn't be performance problems, although > it does add yet another flag to replace_range (by the way, I noticed > that the MARKERS flags is never 0, so it's redundant). I tested with > the attached bug-23917-match-data-buffer-modhook.el. Thanks. Please also make sure bug#23869 is still fixed after this.