From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance. Date: Tue, 15 Mar 2016 10:15:21 +0000 Message-ID: <20160315101521.GB2263@acm.fritz.box> References: <20160315091355.GA2263@acm.fritz.box> <56E7D74C.4070805@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1458036809 2640 80.91.229.3 (15 Mar 2016 10:13:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2016 10:13:29 +0000 (UTC) Cc: 23019@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 Tue Mar 15 11:13:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aflyW-0002z3-Dq for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2016 11:13:16 +0100 Original-Received: from localhost ([::1]:47066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflyQ-000738-PI for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2016 06:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflyL-00070R-Bl for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aflyI-0008HR-69 for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflyI-0008HN-34 for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aflyH-0004bL-Ta for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Mar 2016 10:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23019 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.145803677517675 (code B ref -1); Tue, 15 Mar 2016 10:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Mar 2016 10:12:55 +0000 Original-Received: from localhost ([127.0.0.1]:48544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aflyA-0004b1-Og for submit@debbugs.gnu.org; Tue, 15 Mar 2016 06:12:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afly9-0004ak-3A for submit@debbugs.gnu.org; Tue, 15 Mar 2016 06:12:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afly3-0008DK-00 for submit@debbugs.gnu.org; Tue, 15 Mar 2016 06:12:47 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afly2-0008DG-TQ for submit@debbugs.gnu.org; Tue, 15 Mar 2016 06:12:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afly1-0006bo-Vd for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:12:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aflxy-00088F-LC for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:12:45 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:20852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflxy-00087x-CR for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 06:12:42 -0400 Original-Received: (qmail 21107 invoked by uid 3782); 15 Mar 2016 10:12:41 -0000 Original-Received: from acm.muc.de (p548A54E8.dip0.t-ipconnect.de [84.138.84.232]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 15 Mar 2016 11:12:38 +0100 Original-Received: (qmail 3502 invoked by uid 1000); 15 Mar 2016 10:15:21 -0000 Content-Disposition: inline In-Reply-To: <56E7D74C.4070805@easy-emacs.de> User-Agent: Mutt/1.5.24 (2015-08-30) 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 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:114934 Archived-At: Hello, Andreas. On Tue, Mar 15, 2016 at 10:35:08AM +0100, Andreas Röhler wrote: > On 15.03.2016 10:13, Alan Mackenzie wrote: > > Hello, Emacs. > > When parse-partial-sexp finishes a parse, it fails to record whether or > > not its end point is just after the first character of a two character > > comment starter or ender. When the resulting state is used as an > > argument to resume the parse, p-p-s will be unaware that the comment has > > started or ended and produce false results. > > Proposed solution: Add an extra element to the parser state, recording the > > syntax of the last character passed over before the end of the parse. > > This would be used by parse-partial-sexp to initialise its parse. > > Also: the existing element 9 (the list of currently open parens) and the > > new element should be explicitly documented in the Elisp manual, together > > with a statement that there may be further elements in the parse state > > used internally by parse-partial-sexp (for future expansion). > a comment start might be composed not just by two characters, but by > three or more. What then? We'd have to start thinking about extending parse-partial-sexp, or invent some workaround. Maybe. There must be some languages (?html) where this is the case. What is done in these? > Cheers, > Andreas -- Alan Mackenzie (Nuremberg, Germany).