From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= 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 14:38:54 +0100 Message-ID: <56E8106E.7020402@easy-emacs.de> References: <20160315091355.GA2263@acm.fritz.box> <56E7D74C.4070805@easy-emacs.de> <20160315101521.GB2263@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1458049111 18822 80.91.229.3 (15 Mar 2016 13:38:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2016 13:38:31 +0000 (UTC) Cc: 23019@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 15 14:38:19 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 1afpAu-0000YZ-DY for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2016 14:38:16 +0100 Original-Received: from localhost ([::1]:48255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpAt-00069X-Ge for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2016 09:38:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpAl-00069K-BA for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:38:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afpAg-0005y0-9a for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:38:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpAg-0005xw-6S for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1afpAg-0002pY-1u for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Mar 2016 13:38:02 +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.145804906210855 (code B ref -1); Tue, 15 Mar 2016 13:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Mar 2016 13:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:48656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afpAM-0002p1-Fv for submit@debbugs.gnu.org; Tue, 15 Mar 2016 09:37:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afpAK-0002oo-FD for submit@debbugs.gnu.org; Tue, 15 Mar 2016 09:37:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afpAE-0005nO-91 for submit@debbugs.gnu.org; Tue, 15 Mar 2016 09:37:35 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpAE-0005nJ-5z for submit@debbugs.gnu.org; Tue, 15 Mar 2016 09:37:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpAD-00064o-4y for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:37:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afpA8-0005m9-4q for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:37:33 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.13]:57292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpA7-0005lv-Rs for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2016 09:37:28 -0400 Original-Received: from [192.168.178.35] ([77.3.14.174]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MJU4Z-1aeSeT0aEN-0033by; Tue, 15 Mar 2016 14:37:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.5.0 In-Reply-To: <20160315101521.GB2263@acm.fritz.box> X-Provags-ID: V03:K0:0OssIvbLDFs9Sm9ODr6Xnnj2ICLhpZa/9z+IBo0XuEUOH/VuTIV b6lunIyg3oYTlo1ZbjODv8gIOLY1ldbXXFYFVNe6lmLCYPnvl3WyTnE7AeTaHFZqfqrqNLc 0aEmyBdOIrPslltj2VOwINhrJpCXOBtZV1qZSji6hopfadrYGnp9rNa6ym06Y57zlFR2Xv5 Ba4k6LyNXoE+4mb5RXKdQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:pbUgErAZ0p8=:YiMK5v/6S1iwKxJLMVSgvj G6pjzjgj1aE7w+fFFQ0jf23O2kvp8LFLv/nrDayeQTXLoG8yL/jx8P/jVtbEjdjAMN1ZBQAF2 PHeS7GNb9WVgG/hPt5ANUD8n2/zfm06cwZj6VOupxvhA5NeJvQx6uuhxIgdq/ArD8P7kQWg33 ZjohCKwmVWHA0cgFdxtJi96PgR9pmVskndmJyNhglRjv7UktAlveT6pOh6fdY5U6Craau9Kll qOqW0BwHfKAy/0iewzbj9VappJ0RBXURoMZ7VtQHRiH1pPuR8zY9ntcnsHBWFyO/Fm97/eJ9d MR6lSEw6EeSPs5mGcIlWNArlg57OhvDTKut2wnYeSnxaVu6gk2a1Kr94vEBbVkh2IJ4NPskvU vj97CH4rl2Os7U3DYLI/vUTFCU5VUqu3M4yrUUcYKCrR0jiMy7GD63cob9j2wh5fCrWFwQu/U AaABwF6tbPYheZys3qz8OjakXN/7D996pFuuqVBTS7fqyJvpse8UJfwnpYzYtYDwENADsPn86 mBC2gzNsokvqjfqyT8JLJUUgzb6oZVHegx0vbohEvwpNakh9wBNOsDc2yw3WxhzZQ+yiR3FIs e3d5sdXe6aED0JWgEugdc7Cn6dyNL68etjz7qEih4hxeHFfwykeeF195MKlESDRvVsTH8cLKJ UN/t3H5W5trMZk7lFeXsNaLbxG/qmrWlAAWpyGVSqxuEj8L9eCaich6LxwE1zNZS1e+BDj9ee COP/UuukiS+DOw/m X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:114940 Archived-At: On 15.03.2016 11:15, Alan Mackenzie wrote: > 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? May you send me this (or more) example use-cases? Couldn't find the one already given, sorry. Addressed this issue in my generic beg-end.el https://github.com/andreas-roehler/werkstatt/blob/master/subroutines/beg-end.el In case beg-end forms used a start-string, look if the char-at-point would match this string. Then look if the char-before is before in string, etc.