From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.] Date: Thu, 10 Mar 2016 11:45:10 -0500 Message-ID: References: <20160308200753.GC6269@acm.fritz.box> <20160309104900.GA3948@acm.fritz.box> <20160309141930.GC3948@acm.fritz.box> <20160309193758.GH3948@acm.fritz.box> <20160310130156.GA4831@acm.fritz.box> <20160310152949.GB4831@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457628342 8461 80.91.229.3 (10 Mar 2016 16:45:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Mar 2016 16:45:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 10 17:45:33 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ae3iN-0001ZS-5r for ged-emacs-devel@m.gmane.org; Thu, 10 Mar 2016 17:45:31 +0100 Original-Received: from localhost ([::1]:49600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae3iM-00038C-OK for ged-emacs-devel@m.gmane.org; Thu, 10 Mar 2016 11:45:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae3i8-00037y-Mb for emacs-devel@gnu.org; Thu, 10 Mar 2016 11:45:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ae3i5-0004XK-Ah for emacs-devel@gnu.org; Thu, 10 Mar 2016 11:45:16 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:56223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae3i5-0004XE-69 for emacs-devel@gnu.org; Thu, 10 Mar 2016 11:45:13 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYDQA731xV/0a6+M5cgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJgcLFBgNJC6ICQjPIwEBCAIBH4s6hQUHhC0FjDCEBI5ji2SGMIIUgUUjgWZVgVsggngBAQE X-IPAS-Result: A0CYDQA731xV/0a6+M5cgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJgcLFBgNJC6ICQjPIwEBCAIBH4s6hQUHhC0FjDCEBI5ji2SGMIIUgUUjgWZVgVsggngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="195871769" Original-Received: from 206-248-186-70.dsl.teksavvy.com (HELO pastel.home) ([206.248.186.70]) by ironport2-out.teksavvy.com with ESMTP; 10 Mar 2016 11:45:10 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 798B960420; Thu, 10 Mar 2016 11:45:10 -0500 (EST) In-Reply-To: <20160310152949.GB4831@acm.fritz.box> (Alan Mackenzie's message of "Thu, 10 Mar 2016 15:29:49 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201403 Archived-At: >> > Well, given that syntax-ppss is not suitable for fixing back_comment, >> On the contrary I think it's perfectly suitable. > You're wrong. I assume this is an opinion ;-) > I pointed out several reasons for this in two posts yesterday around > lunch time (European time). None of these point to it being unsuitable. At best they indicate that it may require some tweaks/bugfixes. > You've failed to respond in detail to the most serious points, beyond > saying you haven't encountered them in your testing (so far). What else do you expect me to say? In most of those cases, it's difficult to know what the right/best fix would be before encountering a concrete problem case. So I'm not going to "fix" those problems in advance. > If syntax-ppss were to be amended to be rigorously correct, and hence > usable from back_comment, I would be delighted. There's no such thing as rigorously correct. Your code is not rigorously correct either, and for the exact same underlying reasons: the best behavior either depends on the underlying intent or is assumed to be too costly to be worth the trouble. Your code faces the exact same problems as syntax-ppss, because they are fairly fundamental. You took extra measures to address some of those problems, and I took extra measures to address some others, that's all, so the weaknesses of our respective solutions aren't exactly the same. > But while we have the prospect of infinite recursion, Trivial to resolve, in my experience. > and the prospect of the cache being useless (because point-min is > inside a comment or string), Trivial to resolve as well. > the prospects for using syntax-ppss in back_comment don't look bright. Who's talking about prospects. I have sent a patch and I'm using it right now. > Can you fix these (and other) faults of syntax_ppss? Go right ahead, if you want to fix them. Personally I won't bother until I get a concrete example exposing those problems, so I can decide what's the best way to fix it. > Pending such a fix, I take it you wouldn't object to me merging the > comment-cache branch with master? I definitely would. Stefan