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: Honesty with parse-partial-sexp Date: Sat, 09 Dec 2006 15:30:09 -0500 Message-ID: References: <20061207185738.GA1607@muc.de> <457A8620.9090602@gmx.at> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1165696236 15611 80.91.229.10 (9 Dec 2006 20:30:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 20:30:36 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org, acm@muc.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 21:30:34 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gt8q4-0007IE-JP for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 21:30:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt8q4-0008Lf-36 for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 15:30:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gt8pq-0008Kb-9o for emacs-devel@gnu.org; Sat, 09 Dec 2006 15:30:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gt8po-0008Jz-25 for emacs-devel@gnu.org; Sat, 09 Dec 2006 15:30:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt8pn-0008Jw-TS for emacs-devel@gnu.org; Sat, 09 Dec 2006 15:30:11 -0500 Original-Received: from [209.226.175.4] (helo=tomts16-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gt8pm-0008Jz-MG; Sat, 09 Dec 2006 15:30:10 -0500 Original-Received: from pastel.home ([70.55.82.193]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061209203009.DXOK12977.tomts16-srv.bellnexxia.net@pastel.home>; Sat, 9 Dec 2006 15:30:09 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 84786846D; Sat, 9 Dec 2006 15:30:09 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat\, 09 Dec 2006 13\:26\:16 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63529 Archived-At: > Finally, if you really want to document the 9th return value you shou= ld > talk about all its elements. > Not necessarily. > The really clean thing to do would be to store ONLY the position > of the outermost paren in elt 9, and move the rest to a new elt 10. > But I'd rather not do that at this late stage. > For now, let's define a defsubst to access it. Would someone please do s= o? Would the definition below be good? Stefan --- syntax.el 07 mai 2006 10:09:22 -0400 1.18 +++ syntax.el 09 d=E9c 2006 15:28:50 -0500=09 @@ -52,6 +52,14 @@ (defsubst syntax-ppss-depth (ppss) (nth 0 ppss)) =20 +(defun syntax-ppss-toplevel-pos (ppss) + "Return the closest preceding position at toplevel. +\"At toplevel\" means that it is outside of any syntactic entity: +outside of any parentheses, or comments or strings. +Returns nil iff PPSS itself corresponds to a toplevel position." + (or (car (nth 9 ppss)) + (nth 8 ppss))) + (defsubst syntax-ppss-context (ppss) (cond ((nth 3 ppss) 'string)