From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22983: [ Patch ] Re: bug#22983: syntax-ppss returns wrong result. Date: Mon, 18 Sep 2017 19:08:47 +0000 Message-ID: <20170918190847.GB4536@ACM> References: <20170907204502.GC4488@ACM> <69e034d3-7a52-cc81-dc56-e5308ad5dce0@yandex.ru> <20170910113626.GB3588@ACM> <20170911201204.GC3605@ACM> <20170917102956.GA4519@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1505762241 31666 195.159.176.226 (18 Sep 2017 19:17:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Sep 2017 19:17:21 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: John Wiegley , Philipp Stephani , 22983@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 18 21:17:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1du1Xg-00081U-Jg for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 21:17:16 +0200 Original-Received: from localhost ([::1]:38477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du1Xo-0002N3-0v for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 15:17:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du1WX-0001Tg-QJ for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 15:16:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du1WU-0005mG-LO for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 15:16:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1du1WU-0005m9-I8 for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 15:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1du1WU-00072M-Ct for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 15:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2017 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22983 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22983-submit@debbugs.gnu.org id=B22983.150576211426982 (code B ref 22983); Mon, 18 Sep 2017 19:16:02 +0000 Original-Received: (at 22983) by debbugs.gnu.org; 18 Sep 2017 19:15:14 +0000 Original-Received: from localhost ([127.0.0.1]:46822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1du1Vi-000717-5K for submit@debbugs.gnu.org; Mon, 18 Sep 2017 15:15:14 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:10183 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1du1Vg-00070x-Te for 22983@debbugs.gnu.org; Mon, 18 Sep 2017 15:15:13 -0400 Original-Received: (qmail 50605 invoked by uid 3782); 18 Sep 2017 19:15:10 -0000 Original-Received: from acm.muc.de (p548C6666.dip0.t-ipconnect.de [84.140.102.102]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 Sep 2017 21:15:09 +0200 Original-Received: (qmail 4886 invoked by uid 1000); 18 Sep 2017 19:08:47 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137075 Archived-At: Hello, Dmitry On Mon, Sep 18, 2017 at 02:43:05 +0300, Dmitry Gutov wrote: > Hi Alan, > On 9/17/17 1:29 PM, Alan Mackenzie wrote: > > I don't know anything about these things. But seeing as how syntax.el is > > preloaded, the definition of structs would need to be preloaded earlier. > OK, let's do without that for now. The result doesn't look too bad to my > eyes, at least. > >>>> Would you like to see the code? > >>> Yes, why not? > >> Please give me until the end of the week. > > The end of the week has arrived. Are you still intending to propose an > > alternative formulation of the new cache manipulation for syntax-ppss? > Thanks for the reminder. The patch is attached. I've tested it > minimally, any feedback is welcome. Thanks for this. I'm impressed. Your syntax-ppss--data is far more elegant than my syntax-ppss-set-cache. The burden of carrying around the caches in cons cells is much less than I had feared. The amendments to syntax-ppss are also less than I had feared, amounting to little more than substituting "syntax-ppss-cache" with "ppss-cache" etc., and making a few bindings to support that. I notice you flush both caches eagerly, as you said you would. No harm in that. So, I'm willing to go with your version. I haven't tried actually running it, yet. But there's one small change I would ask you to consider making - that is, in the cache conses, to put ppss-last in the car and ppss-cache in the cdr. That way, while debugging, ppss-last will be easy to find (it's the first element of the list) and ppss-cache will also be easy to find (the second element onwards). > (It reads much better in Emacs with diff-auto-refine-mode). [ .... ] -- Alan Mackenzie (Nuremberg, Germany).