From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: New hook before-region-change-functions wanted Date: Mon, 11 Sep 2017 16:45:05 +0000 Message-ID: <20170911164505.GA3605@ACM> References: <20170908144657.GA3463@ACM> <20170909083326.GA5194@ACM> <20170910073729.GA3588@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1505326728 13876 195.159.176.226 (13 Sep 2017 18:18:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2017 18:18:48 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 11 18:50:32 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drRuk-0001Zo-Us for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2017 18:50:27 +0200 Original-Received: from localhost ([::1]:59053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drRus-0000Nf-8D for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2017 12:50:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drRuh-0000Le-Uc for emacs-devel@gnu.org; Mon, 11 Sep 2017 12:50:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drRue-0002bA-Ne for emacs-devel@gnu.org; Mon, 11 Sep 2017 12:50:23 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:16808 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1drRue-0002aV-H9 for emacs-devel@gnu.org; Mon, 11 Sep 2017 12:50:20 -0400 Original-Received: (qmail 74765 invoked by uid 3782); 11 Sep 2017 16:50:18 -0000 Original-Received: from acm.muc.de (p548C7BC7.dip0.t-ipconnect.de [84.140.123.199]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 11 Sep 2017 18:50:17 +0200 Original-Received: (qmail 3629 invoked by uid 1000); 11 Sep 2017 16:45:05 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218209 Hello, Richard. On Sun, Sep 10, 2017 at 21:17:57 -0400, Richard Stallman wrote: > > > The other approach has the virtue of being entirely internal. It will > > > not require an announcement, or adding to the Lisp manual. > > Yes. This other approach is slightly more difficult to debug with, but > > not unreasonably so. > Just from curiosity, why is it more difficult to debug with? > Since it has no effect on behavior, and its only effect is to speed > up some cases, I'd expect it to have no effect on debugging. > Is there something I am missing? As I said, the difference was small. With the hook in place, the filling and use of the cache was entirely disjoint from swapping the caches in and out - the former occurred on calling syntax-ppss, the latter on the hook called from widen/narrow-to-region. Using the actual solution, the swapping in and out of the caches occurred at the beginning of syntax-ppss (if needed), and NOT on widen/n-t-r. So until I got used to it, I was calling n-t-r, then forgetting a token invocation of syntax-ppss, and wondering why the caches hadn't been swapped. In that sense, the hook would have been a cleaner solution. A pity about its overwhelming disadvantages. > -- > Dr Richard Stallman > President, Free Software Foundation (gnu.org, fsf.org) > Internet Hall-of-Famer (internethalloffame.org) > Skype: No way! See stallman.org/skype.html. -- Alan Mackenzie (Nuremberg, Germany).