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: Wed, 20 Jul 2016 21:55:29 +0300 Message-ID: <83inw0yw9q.fsf__13557.0704857402$1469041141$gmane$org@gnu.org> References: <87vb066ejv.fsf@linaro.org> <8360s67qcp.fsf@gnu.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> 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]:35778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPwg9-0007Oe-E4 for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 14:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPwg7-0001Rx-G0 for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 14:57:08 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: (message from Stefan Monnier on Wed, 20 Jul 2016 14:19:59 -0400) 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: Stefan Monnier Cc: nljlistbox2@gmail.com, npostavs@users.sourceforge.net, jwiegley@gmail.com, rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org > From: Stefan Monnier > Cc: rpluim@gmail.com, 23917@debbugs.gnu.org, alex.bennee@linaro.org, jwiegley@gmail.com, nljlistbox2@gmail.com, npostavs@users.sourceforge.net > Date: Wed, 20 Jul 2016 14:19:59 -0400 > > > Is it OK to adjust the match data before actually making the > > replacement? If so, I think it's a simpler solution. > >> PS: I can think of one (theoretical) other/better way to fix this > >> problem: move the match-data adjustment so it's done within > >> replace_range before running the after-change-functions. > > Isn't that almost the same as what Noam suggested? > > Yes, it's the same. And yes, I like the idea, but I just don't know > what it would look like as a patch. I have the impression that it could > prove either expensive in CPU time and backward incompatible > (e.g. adjust markers for every buffer modification), or require > extensive code surgery and/or breaking some abstractions. > > This is just an impression, tho. I think it'd definitely be the better > solution, so it's worth investigating anyway, if only for "master" rather > than for "emacs-25". 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. The above values are not markers, and no other markers are involved, so I'm not sure which markers did you allude to. Or why it would be CPU intensive. What did I miss?