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: syntax-ppss Date: Wed, 08 Jun 2005 18:37:50 -0400 Message-ID: <87zmu0eaqp.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118270828 20332 80.91.229.2 (8 Jun 2005 22:47:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 22:47:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 09 00:47:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg9Ii-0008Bg-To for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 00:45:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg9PW-0003oG-K4 for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 18:52:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dg9Lx-0001po-6O for emacs-devel@gnu.org; Wed, 08 Jun 2005 18:48:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dg9Lt-0001mR-0S for emacs-devel@gnu.org; Wed, 08 Jun 2005 18:48:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg9Lq-0001iY-C4 for emacs-devel@gnu.org; Wed, 08 Jun 2005 18:48:46 -0400 Original-Received: from [209.226.175.97] (helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dg9BI-0000DM-VC; Wed, 08 Jun 2005 18:37:53 -0400 Original-Received: from alfajor ([70.48.82.205]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050608223750.UIVF1799.tomts40-srv.bellnexxia.net@alfajor>; Wed, 8 Jun 2005 18:37:50 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id AA44FD73A3; Wed, 8 Jun 2005 18:37:50 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 04 Jun 2005 13:59:51 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (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:38386 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38386 >>>>> "Richard" == Richard Stallman writes: > Would someone please write documentation in the Lisp Manual for > syntax-ppss and friends? How 'bout the patch below? Stefan --- syntax.texi 05 mai 2005 10:32:01 -0400 1.40 +++ syntax.texi 08 jun 2005 18:37:08 -0400 @@ -256,7 +256,7 @@ @deffn {Syntax class} @w{inherit} This syntax class does not specify a particular syntax. It says to look in the standard syntax table to find the syntax of this character. The -designator for this syntax code is @samp{@@}. +designator for this syntax class is @samp{@@}. @end deffn @deffn {Syntax class} @w{generic comment delimiter} @@ -385,7 +385,7 @@ @samp{p} identifies an additional ``prefix character'' for Lisp syntax. These characters are treated as whitespace when they appear between expressions. When they appear within an expression, they are handled -according to their usual syntax codes. +according to their usual syntax classes. The function @code{backward-prefix-chars} moves back over these characters, as well as over characters whose primary syntax class is @@ -566,7 +566,7 @@ @defun skip-syntax-forward syntaxes &optional limit This function moves point forward across characters having syntax -classes mentioned in @var{syntaxes} (a string of syntax code +classes mentioned in @var{syntaxes} (a string of syntax classes characters). It stops when it encounters the end of the buffer, or position @var{limit} (if specified), or a character it is not supposed to skip. @@ -730,6 +730,15 @@ that have nested parentheses. @end defun +@defun syntax-ppss &optional pos +This function returns the state of the parser at position @var{pos} if +started with a default start state at the beginning of the buffer. +I.e., it is equivalent to @code(parse-partial-sexp (point-min) +@var{pos}). The difference is that @code{syntax-ppss} uses a cache to +speed up the computation. This has as a side-effect that the 2nd and +6th value of the returned state cannot be relied upon. +@end defun + @defun scan-lists from count depth This function scans forward @var{count} balanced parenthetical groupings from position @var{from}. It returns the position where the scan stops.