emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispref/syntax.texi


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lispref/syntax.texi
Date: Fri, 21 Jun 2002 06:01:59 -0400

Index: emacs/lispref/syntax.texi
diff -c emacs/lispref/syntax.texi:1.24 emacs/lispref/syntax.texi:1.25
*** emacs/lispref/syntax.texi:1.24      Mon Dec 24 13:01:56 2001
--- emacs/lispref/syntax.texi   Fri Jun 21 06:01:58 2002
***************
*** 594,628 ****
  @section Parsing Balanced Expressions
  
    Here are several functions for parsing and scanning balanced
! expressions, also known as @dfn{sexps}, in which parentheses match in
! pairs.  The syntax table controls the interpretation of characters, so
! these functions can be used for Lisp expressions when in Lisp mode and
! for C expressions when in C mode.  @xref{List Motion}, for convenient
! higher-level functions for moving over balanced expressions.
  
! A syntax table only describes how each character changes the state of
! the parser, rather than describing the state itself.  For example, a string
! delimiter character toggles the parser state between ``in-string'' and
! ``in-code'' but the characters inside the string do not have any particular
! syntax to identify them as such.
  
! For example (note: 15 is the syntax-code of generic string delimiters):
  
  @example
  (put-text-property 1 9 'syntax-table '(15 . nil))
  @end example
  
  does not tell Emacs that the first eight chars of the current buffer
! are a string, but rather that they are all string delimiters and thus
! Emacs should treat them as four adjacent empty strings.
  
! The state of the parser is transient (i.e. not stored in the buffer for
! example).  Instead, every time the parser is used, it is given not just
! a starting position but a starting state.  If the starting state is not
! specified explicitly, Emacs assumes we are at the top level of parenthesis
! structure, such as the beginning of a function definition (this is the case
! for @code{forward-sexp} which blindly assumes that the starting point is in
! such a state.)
  
  @defun parse-partial-sexp start limit &optional target-depth stop-before 
state stop-comment
  This function parses a sexp in the current buffer starting at
--- 594,632 ----
  @section Parsing Balanced Expressions
  
    Here are several functions for parsing and scanning balanced
! expressions, also known as @dfn{sexps}.  Basically, a sexp is either a
! balanced parenthetical grouping, or a symbol name (a sequence of
! characters whose syntax is either word constituent or symbol
! constituent).  However, characters whose syntax is expression prefix
! are treated as part of the sexp if they appear next to it.
  
!   The syntax table controls the interpretation of characters, so these
! functions can be used for Lisp expressions when in Lisp mode and for C
! expressions when in C mode.  @xref{List Motion}, for convenient
! higher-level functions for moving over balanced expressions.
  
!   A syntax table only describes how each character changes the state
! of the parser, rather than describing the state itself.  For example,
! a string delimiter character toggles the parser state between
! ``in-string'' and ``in-code'' but the characters inside the string do
! not have any particular syntax to identify them as such.  For example
! (note that 15 is the syntax code for generic string delimiters),
  
  @example
  (put-text-property 1 9 'syntax-table '(15 . nil))
  @end example
  
+ @noindent
  does not tell Emacs that the first eight chars of the current buffer
! are a string, but rather that they are all string delimiters.  As a
! result, Emacs treats them as four consecutive empty string constants.
  
!   Every time you use the parser, you specify it a starting state as
! well as a starting position.  If you omit the starting state, the
! default is ``top level in parenthesis structure,'' as it would be at
! the beginning of a function definition.  (This is the case for
! @code{forward-sexp}, which blindly assumes that the starting point is
! in such a state.)
  
  @defun parse-partial-sexp start limit &optional target-depth stop-before 
state stop-comment
  This function parses a sexp in the current buffer starting at



reply via email to

[Prev in Thread] Current Thread [Next in Thread]