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 18:26:13 +0000 Message-ID: <20170910182613.GD3588@ACM> References: <9fc66395-045c-1984-f530-033c2ff706f6@yandex.ru> <83h8wlz1kf.fsf@gnu.org> <20170902174027.GB4267@ACM> <20170907204502.GC4488@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1505068341 7958 195.159.176.226 (10 Sep 2017 18:32:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2017 18:32:21 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 22983@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 10 20:32:14 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 1dr71a-0001O7-HJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 20:32:06 +0200 Original-Received: from localhost ([::1]:53888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr71h-0006SD-Ta for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Sep 2017 14:32:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr71c-0006Qq-Lb for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:32:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr71Z-0005Op-HL for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:32:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dr71Z-0005OO-D2 for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:32:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dr71W-0006Bo-4d for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:32: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 18:32: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: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150506829423759 (code B ref -1); Sun, 10 Sep 2017 18:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Sep 2017 18:31:34 +0000 Original-Received: from localhost ([127.0.0.1]:59636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dr712-0006B7-Mn for submit@debbugs.gnu.org; Sun, 10 Sep 2017 14:31:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dr710-0006Ar-LL for submit@debbugs.gnu.org; Sun, 10 Sep 2017 14:31:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr70u-0004mS-DQ for submit@debbugs.gnu.org; Sun, 10 Sep 2017 14:31:25 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dr70u-0004mO-9N for submit@debbugs.gnu.org; Sun, 10 Sep 2017 14:31:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr70s-0006L8-Sj for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:31:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr70p-0004lO-PR for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:31:22 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:19956 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1dr70p-0004jy-E3 for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2017 14:31:19 -0400 Original-Received: (qmail 5837 invoked by uid 3782); 10 Sep 2017 18:31:14 -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 20:31:13 +0200 Original-Received: (qmail 12818 invoked by uid 1000); 10 Sep 2017 18:26:13 -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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:136736 Archived-At: Hello, Andreas. On Fri, Sep 08, 2017 at 18:04:37 +0200, Andreas Röhler wrote: > On 07.09.2017 22:45, Alan Mackenzie wrote: > > The solution I propose is to introduce a second cache into syntax-ppss, > > and this cache would be used whenever (not (eq (point-min) 1)). > > Whenever point-min changes, and isn't 1, this second cached would be > > calculated again from scratch. > > This proposal has these advantages: > > (i) It would make the function deliver what its unchanged doc string > > says. This is important, given that syntax-ppss has been very widely > > used within Emacs, and likely by external packages too; these will > > typically have assumed the advertised behaviour of the function, without > > having tested it in narrowed buffers. > > (i) In the case which currently works, namely a non-narrowed buffer, > > there would be only a minute slow-down (basically, there would be extra > > code to check point-min and select the cache to use). > > (ii) The cache for use in a narrowed buffer might well be sufficiently > > fast in normal use. If it is not, it could be enhanced readily. > Hi Alan and all, > assume a complex matter behind, a bunch of bugs resp. design issues, not > a single one. I don't think this bug is _that_ complex, and even if it has associated bugs, I think we can fix it on its own. > Fixing this would affect syntax-propertize, parse-partial-sexp, > syntax-ppss and font-lock stuff at once. I'll give you one out of four. ;-) syntax-ppss will definitely be affected, parse-partial-sexp definitely not, and the other two possibly in corner cases, but hopefully not. > http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01576.html > points at some spot. There should be more. I think, at least I hope, that is an orthoganol issue. > As a first step listing referential tests including benchmarks should be > helpful. -- Alan Mackenzie (Nuremberg, Germany).