aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/syntax.texi
diff options
context:
space:
mode:
Diffstat (limited to 'lispref/syntax.texi')
-rw-r--r--lispref/syntax.texi38
1 files changed, 34 insertions, 4 deletions
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index a9df79e9f57..e8707709fe2 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -256,7 +256,7 @@ English text has no comment characters. In Lisp, the semicolon
256@deffn {Syntax class} @w{inherit} 256@deffn {Syntax class} @w{inherit}
257This syntax class does not specify a particular syntax. It says to look 257This syntax class does not specify a particular syntax. It says to look
258in the standard syntax table to find the syntax of this character. The 258in the standard syntax table to find the syntax of this character. The
259designator for this syntax code is @samp{@@}. 259designator for this syntax class is @samp{@@}.
260@end deffn 260@end deffn
261 261
262@deffn {Syntax class} @w{generic comment delimiter} 262@deffn {Syntax class} @w{generic comment delimiter}
@@ -385,7 +385,7 @@ nestable.
385@samp{p} identifies an additional ``prefix character'' for Lisp syntax. 385@samp{p} identifies an additional ``prefix character'' for Lisp syntax.
386These characters are treated as whitespace when they appear between 386These characters are treated as whitespace when they appear between
387expressions. When they appear within an expression, they are handled 387expressions. When they appear within an expression, they are handled
388according to their usual syntax codes. 388according to their usual syntax classes.
389 389
390The function @code{backward-prefix-chars} moves back over these 390The function @code{backward-prefix-chars} moves back over these
391characters, as well as over characters whose primary syntax class is 391characters, as well as over characters whose primary syntax class is
@@ -566,7 +566,7 @@ have certain syntax classes.
566 566
567@defun skip-syntax-forward syntaxes &optional limit 567@defun skip-syntax-forward syntaxes &optional limit
568This function moves point forward across characters having syntax 568This function moves point forward across characters having syntax
569classes mentioned in @var{syntaxes} (a string of syntax code 569classes mentioned in @var{syntaxes} (a string of syntax class
570characters). It stops when it encounters the end of the buffer, or 570characters). It stops when it encounters the end of the buffer, or
571position @var{limit} (if specified), or a character it is not supposed 571position @var{limit} (if specified), or a character it is not supposed
572to skip. 572to skip.
@@ -730,6 +730,36 @@ This function is most often used to compute indentation for languages
730that have nested parentheses. 730that have nested parentheses.
731@end defun 731@end defun
732 732
733@defun syntax-ppss &optional pos
734This function returns the state that the parser would have at position
735@var{pos}, if it were started with a default start state at the
736beginning of the buffer. Thus, it is equivalent to
737@code{(parse-partial-sexp (point-min) @var{pos})}, except that
738@code{syntax-ppss} uses a cache to speed up the computation. Also,
739the 2nd value (previous complete subexpression) and 6th value (minimum
740parenthesis depth) of the returned state are not meaningful.
741@end defun
742
743@defun syntax-ppss-flush-cache beg
744This function flushes the cache used by @code{syntax-ppss}, starting at
745position @var{beg}.
746
747When @code{syntax-ppss} is called, it automatically hooks itself
748to @code{before-change-functions} to keep its cache consistent.
749But this can fail if @code{syntax-ppss} is called while
750@code{before-change-functions} is temporarily let-bound, or if the
751buffer is modified without obeying the hook, such as when using
752@code{inhibit-modification-hooks}. For this reason, it is sometimes
753necessary to flush the cache manually.
754@end defun
755
756@defvar syntax-begin-function
757If this is non-nil, it should be a function that moves to an earlier
758buffer position where the parser state is equivalent to @code{nil},
759i.e., a position outside of any comment, string, or parenthesis.
760@code{syntax-ppss} uses it to supplement its cache.
761@end defvar
762
733@defun scan-lists from count depth 763@defun scan-lists from count depth
734This function scans forward @var{count} balanced parenthetical groupings 764This function scans forward @var{count} balanced parenthetical groupings
735from position @var{from}. It returns the position where the scan stops. 765from position @var{from}. It returns the position where the scan stops.
@@ -779,7 +809,7 @@ whitespace by the functions in this section and by @code{forward-sexp}.
779@end defopt 809@end defopt
780 810
781@vindex parse-sexp-lookup-properties 811@vindex parse-sexp-lookup-properties
782The behaviour of @code{parse-partial-sexp} is also affected by 812The behavior of @code{parse-partial-sexp} is also affected by
783@code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). 813@code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}).
784 814
785You can use @code{forward-comment} to move forward or backward over 815You can use @code{forward-comment} to move forward or backward over