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: syntax-ppss returns wrong result. Date: Sun, 10 Sep 2017 11:42:34 +0000 Message-ID: <20170910114234.GC3588@ACM> References: <83h8wlz1kf.fsf@gnu.org> <20170902174027.GB4267@ACM> <20170907204502.GC4488@ACM> <69e034d3-7a52-cc81-dc56-e5308ad5dce0@yandex.ru> <20170909102027.GB5194@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1505044103 8823 195.159.176.226 (10 Sep 2017 11:48:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2017 11:48:23 +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 Sun Sep 10 13:48: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 1dr0ic-0001OX-9u for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 13:48:06 +0200 Original-Received: from localhost ([::1]:52546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr0ih-0004U7-TJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 07:48:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr0ic-0004Tn-Lr for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 07:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr0iY-0001lQ-MJ for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 07:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dr0iY-0001lC-IV for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 07:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dr0iY-0004zN-CS for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 07:48: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: Sun, 10 Sep 2017 11:48: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.150504406119150 (code B ref 22983); Sun, 10 Sep 2017 11:48:02 +0000 Original-Received: (at 22983) by debbugs.gnu.org; 10 Sep 2017 11:47:41 +0000 Original-Received: from localhost ([127.0.0.1]:58500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dr0iC-0004yn-9p for submit@debbugs.gnu.org; Sun, 10 Sep 2017 07:47:41 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:23500 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dr0i9-0004yd-Tb for 22983@debbugs.gnu.org; Sun, 10 Sep 2017 07:47:38 -0400 Original-Received: (qmail 81620 invoked by uid 3782); 10 Sep 2017 11:47:34 -0000 Original-Received: from acm.muc.de (p548C6F29.dip0.t-ipconnect.de [84.140.111.41]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Sep 2017 13:47:34 +0200 Original-Received: (qmail 5594 invoked by uid 1000); 10 Sep 2017 11:42:34 -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:136727 Archived-At: Hello, Dmitry. On Sat, Sep 09, 2017 at 15:18:11 +0300, Dmitry Gutov wrote: > On 9/9/17 1:20 PM, Alan Mackenzie wrote: > > In the implementation, I have left the function `syntax-ppss' untouched > > except for adding a function call to set up the cache right at the > > start. I have refactored syntax-ppss-flush-cache, extracting a function > > which is called directly from the cache-selecting code. Other than > > that, there is one new function (which switches the current cache in > > use) and a few new variables to keep track of the caches. > Not sure I understand. If you call (syntax-ppss) with significantly > different narrowings without flushing the cache (e.g. without modifying > the buffer), sounds like it'll have to return the same results under the > described implementation. > If so, it doesn't sound strict enough. On changing from one narrowing to another narrowing (more precisely, when point-min is changed, neither value being 1), the cache is flushed, even though the buffer has not been modified. Anyhow, I've posted a patch elsewhere on this thread. Comments on it would be welcome. [ .... ] -- Alan Mackenzie (Nuremberg, Germany).