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: Sat, 10 Dec 2016 19:24:46 -0500 Message-ID: References: <20161206195507.GA2996@acm.fritz.box> <83fd1db0-7362-6117-c5cd-715398c0dea4@gmail.com> <20161207220447.GA4503@acm.fritz.box> <20161208201517.GB3120@acm.fritz.box> <20161209190747.GC2203@acm.fritz.box> <5a70902f-882e-f616-74b2-df6eb81fc70c@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481415907 27122 195.159.176.226 (11 Dec 2016 00:25:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 00:25:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 01:25:01 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 1cFrwq-0005lI-MS for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 01:25:00 +0100 Original-Received: from localhost ([::1]:53562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFrwu-0002XJ-Dz for ged-emacs-devel@m.gmane.org; Sat, 10 Dec 2016 19:25:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFrwn-0002XC-CQ for emacs-devel@gnu.org; Sat, 10 Dec 2016 19:24:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFrwk-00049g-8P for emacs-devel@gnu.org; Sat, 10 Dec 2016 19:24:57 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:56063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFrwk-00048O-2s for emacs-devel@gnu.org; Sat, 10 Dec 2016 19:24:54 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id uBB0Ol0s027804; Sat, 10 Dec 2016 19:24:48 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id F3271AE4E2; Sat, 10 Dec 2016 19:24:46 -0500 (EST) In-Reply-To: <5a70902f-882e-f616-74b2-df6eb81fc70c@yandex.ru> (Dmitry Gutov's message of "Sat, 10 Dec 2016 01:30:24 +0200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5884=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5884> : inlines <5560> : streams <1724114> : uri <2339046> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:210252 Archived-At: > It's better in one sense and worse in another. Since parse-partial-sexp > can't parse backwards, you're leaving a whole range of values of POS on > which syntax-ppss will have to just raise an error. I don't think it's a big deal: such a situation would necessarily be an error elsewhere, so signaling an error would be the right thing to do anyway. Admittedly, an alternative would be to provide syntax-ppss with a bunch of "forced data", i.e. an alist of (POS . STATE) where syntax-ppss should start parsing from the nearest earlier POS and use the corresponding STATE as starting state. But it's probably not worth the trouble (and might even be slightly problematic for (syntax-ppss POS) since some callers would want it to return STATE while others might like to know "the state computed from the earlier POS&STATE"). Stefan