From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: forward-comment and syntax-ppss Date: Wed, 07 Dec 2016 21:32:50 -0500 Message-ID: References: <20161204123434.GB2791@acm.fritz.box> <20161206195507.GA2996@acm.fritz.box> <83fd1db0-7362-6117-c5cd-715398c0dea4@gmail.com> <20161207220447.GA4503@acm.fritz.box> 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 1481164418 12102 195.159.176.226 (8 Dec 2016 02:33:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Dec 2016 02:33:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 08 03:33:34 2016 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 1cEoWb-00028a-UU for ged-emacs-devel@m.gmane.org; Thu, 08 Dec 2016 03:33:34 +0100 Original-Received: from localhost ([::1]:43692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEoWg-00015J-0I for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2016 21:33:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEoW6-000153-J9 for emacs-devel@gnu.org; Wed, 07 Dec 2016 21:33:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEoW3-00067h-DH for emacs-devel@gnu.org; Wed, 07 Dec 2016 21:33:02 -0500 Original-Received: from [195.159.176.226] (port=53663 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cEoW3-00066K-7M for emacs-devel@gnu.org; Wed, 07 Dec 2016 21:32:59 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cEoVx-0004ZC-5l for emacs-devel@gnu.org; Thu, 08 Dec 2016 03:32:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:tfbyx6DZFQvMdMnFfYsD5dvJqeI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:210124 Archived-At: > Read up on bug #22983. Basically, syntax-ppss is fundamentally broken. > It won't work with narrowing of buffers, and delivers inconsistent > results which aren't in accordance with what the function's doc says it > does. This breakage isn't anything that can be fixed. > The only way to deal with it seems to be to remove syntax-ppss and > replace it with a new function. And how would the new function not face the same breakage that can't be fixed? As you should know, your comment-cache code suffers from the exact same problem. It's a fundamental problem in caching parsing data in the face of narrowing, given the fact that our narrowing primitive don't say what is the intention behind it. If you think your comment-cache works well (i.e. you consider its failures to be caused by inappropriate use of narrow-to-region), then it's trivial to "fix" syntax-ppss in the same way: just put a `widen` in it and voilą: "fundamentally broken" solved. Stefan