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: Tue, 19 Sep 2017 20:47:53 +0000 Message-ID: <20170919204753.GD19168@ACM> References: <20170907204502.GC4488@ACM> <69e034d3-7a52-cc81-dc56-e5308ad5dce0@yandex.ru> <20170910113626.GB3588@ACM> <20170911201204.GC3605@ACM> <20170917102956.GA4519@ACM> <20170918190847.GB4536@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1505854520 18849 195.159.176.226 (19 Sep 2017 20:55:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 20:55:20 +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 Tue Sep 19 22:55:12 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 1duPXz-0004Iu-Ov for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 22:55:11 +0200 Original-Received: from localhost ([::1]:45402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duPY3-0007aX-Ib for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 16:55:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duPXt-0007ZA-M7 for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duPXr-0006Yt-3n for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duPXr-0006Xw-0k for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1duPXq-0006EX-JF for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:55: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: Tue, 19 Sep 2017 20:55: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.150585447423923 (code B ref 22983); Tue, 19 Sep 2017 20:55:02 +0000 Original-Received: (at 22983) by debbugs.gnu.org; 19 Sep 2017 20:54:34 +0000 Original-Received: from localhost ([127.0.0.1]:48696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duPXO-0006Dn-Ba for submit@debbugs.gnu.org; Tue, 19 Sep 2017 16:54:34 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:31358 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1duPXM-0006Df-Qw for 22983@debbugs.gnu.org; Tue, 19 Sep 2017 16:54:33 -0400 Original-Received: (qmail 58669 invoked by uid 3782); 19 Sep 2017 20:54:27 -0000 Original-Received: from acm.muc.de (p548C6659.dip0.t-ipconnect.de [84.140.102.89]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 19 Sep 2017 22:54:26 +0200 Original-Received: (qmail 21838 invoked by uid 1000); 19 Sep 2017 20:47:53 -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:137150 Archived-At: Hello, Dmitry. On Tue, Sep 19, 2017 at 03:02:06 +0300, Dmitry Gutov wrote: > On 9/18/17 10:08 PM, Alan Mackenzie wrote: [ .... ] > > So, I'm willing to go with your version. I haven't tried actually > > running it, yet. > Please do. I have done now, without the slightest cause for concern (see below). > > 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). > Sure, that makes a lot of sense, since ppss-last is a smaller structure. > The modified patch is attached. Thanks. I've done some semi-formal testing on it. My semi-formal test log is: (ii) Do some testing, using xdisp.c as test file. A file.c will not have other calls to syntax-ppss interfering with the tests. o - 1. Normal working: check both caches stay empty. They don't, because syntax-ppss is used, I think, by font locking. o - 2. Normal work in a narrowed buffer. Seems OK. o - 3. Switch back to widened. Seems OK. o - 4. Switch back to narrowed, same point-min. Check the caches. They look OK. o - 5. Switch to a different narrowing and (syntax-ppss (point-min)). This does indeed empty the syntax-ppss-narrow, as it should. s-p-wide looks unchanged. Good. o - 6. Get well filled caches for both narrow and wide regions. With the buffer wide, make a buffer change early in the buffer. Check both caches are properly trimmed. They are. o - 7. Repeat 6, but trim with the buffer narrow. Both caches look OK, the narrow cache being (nil). Maybe I should also try some heavy hacking in, say, Emacs Lisp mode as a kind of soak test, since elisp mode uses syntax-ppss quite a bit, I believe. -- Alan Mackenzie (Nuremberg, Germany).