comparison lispref/syntax.texi @ 63291:e7539bdc68d1

(Parsing Expressions): Document syntax-ppss.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 10 Jun 2005 22:20:25 +0000
parents eea6ec994be4
children 8d95ae44a1a4
comparison
equal deleted inserted replaced
63290:01f269fcca4c 63291:e7539bdc68d1
254 @end deffn 254 @end deffn
255 255
256 @deffn {Syntax class} @w{inherit} 256 @deffn {Syntax class} @w{inherit}
257 This syntax class does not specify a particular syntax. It says to look 257 This syntax class does not specify a particular syntax. It says to look
258 in the standard syntax table to find the syntax of this character. The 258 in the standard syntax table to find the syntax of this character. The
259 designator for this syntax code is @samp{@@}. 259 designator 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}
263 A @dfn{generic comment delimiter} (designated by @samp{!}) starts 263 A @dfn{generic comment delimiter} (designated by @samp{!}) starts
264 or ends a special kind of comment. @emph{Any} generic comment delimiter 264 or ends a special kind of comment. @emph{Any} generic comment delimiter
383 @item 383 @item
384 @c Emacs 19 feature 384 @c Emacs 19 feature
385 @samp{p} identifies an additional ``prefix character'' for Lisp syntax. 385 @samp{p} identifies an additional ``prefix character'' for Lisp syntax.
386 These characters are treated as whitespace when they appear between 386 These characters are treated as whitespace when they appear between
387 expressions. When they appear within an expression, they are handled 387 expressions. When they appear within an expression, they are handled
388 according to their usual syntax codes. 388 according to their usual syntax classes.
389 389
390 The function @code{backward-prefix-chars} moves back over these 390 The function @code{backward-prefix-chars} moves back over these
391 characters, as well as over characters whose primary syntax class is 391 characters, as well as over characters whose primary syntax class is
392 prefix (@samp{'}). @xref{Motion and Syntax}. 392 prefix (@samp{'}). @xref{Motion and Syntax}.
393 @end itemize 393 @end itemize
564 This section describes functions for moving across characters that 564 This section describes functions for moving across characters that
565 have certain syntax classes. 565 have certain syntax classes.
566 566
567 @defun skip-syntax-forward syntaxes &optional limit 567 @defun skip-syntax-forward syntaxes &optional limit
568 This function moves point forward across characters having syntax 568 This function moves point forward across characters having syntax
569 classes mentioned in @var{syntaxes} (a string of syntax code 569 classes mentioned in @var{syntaxes} (a string of syntax class
570 characters). It stops when it encounters the end of the buffer, or 570 characters). It stops when it encounters the end of the buffer, or
571 position @var{limit} (if specified), or a character it is not supposed 571 position @var{limit} (if specified), or a character it is not supposed
572 to skip. 572 to skip.
573 573
574 If @var{syntaxes} starts with @samp{^}, then the function skips 574 If @var{syntaxes} starts with @samp{^}, then the function skips
726 @var{state}. 726 @var{state}.
727 727
728 @cindex indenting with parentheses 728 @cindex indenting with parentheses
729 This function is most often used to compute indentation for languages 729 This function is most often used to compute indentation for languages
730 that have nested parentheses. 730 that have nested parentheses.
731 @end defun
732
733 @defun syntax-ppss &optional pos
734 This 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
736 beginning 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,
739 the 2nd value (previous complete subexpression) and 6th value (minimum
740 parenthesis depth) of the returned state are not meaningful.
731 @end defun 741 @end defun
732 742
733 @defun scan-lists from count depth 743 @defun scan-lists from count depth
734 This function scans forward @var{count} balanced parenthetical groupings 744 This function scans forward @var{count} balanced parenthetical groupings
735 from position @var{from}. It returns the position where the scan stops. 745 from position @var{from}. It returns the position where the scan stops.