From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Musings: Supposed places of safety, guaranteed by parse-partial-sexp are not safe. Date: Sun, 04 Dec 2011 18:06:16 +0100 Message-ID: <4EDBA888.2060202@gmx.at> References: <20111203232301.GD4566@acm.acm> <4EDB4E50.1060202@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323018392 4854 80.91.229.12 (4 Dec 2011 17:06:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Dec 2011 17:06:32 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 04 18:06:27 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXFWB-0007rd-Py for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2011 18:06:23 +0100 Original-Received: from localhost ([::1]:55493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXFWB-0003Jx-4b for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2011 12:06:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXFW8-0003JS-FV for emacs-devel@gnu.org; Sun, 04 Dec 2011 12:06:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXFW7-0001cV-4s for emacs-devel@gnu.org; Sun, 04 Dec 2011 12:06:20 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:47555) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RXFW6-0001cC-Nd for emacs-devel@gnu.org; Sun, 04 Dec 2011 12:06:19 -0500 Original-Received: (qmail invoked by alias); 04 Dec 2011 17:06:16 -0000 Original-Received: from 62-47-42-45.adsl.highway.telekom.at (EHLO [62.47.42.45]) [62.47.42.45] by mail.gmx.net (mp026) with SMTP; 04 Dec 2011 18:06:16 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19+mgUhBzB+AtAGetADUmupnxsfAY1r9Hq9OBCaai OQrMvXjHwQQ3bx User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 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:146480 Archived-At: >> If you change (nth 5 ppss) you would still have to say that (nth 4 ppss) >> is unreliable in this special case. > > Not if (nth 5 ppss) says that the buffer position is the one *after* the > "/*" sequence. Of course for "*/" we'd conversely want to use the state > *before* "*/". What I meant was that the caller would have to care about (nth 5 ppss) too, wherever she now looked only at (nth 3 ppss) and (nth 4 ppss). If we say that a comment is everything in between and including both delimiters she won't have to care about (nth 5 ppss) in the first place. Admittedly, it's not entirely trivial to implement. But the fact that between "/" and "*" we are not in a comment whilst between "*" and "/" we are doesn't strike me as very intuitive. martin