]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/syntax.texi
More doc for debug-on-event.
[gnu-emacs] / doc / lispref / syntax.texi
index 89fa440068e2503d69fc6b9e2cabf03b72d09cdb..3d153e43b2d810c57d7e58abd36d054a7b5e7d58 100644 (file)
@@ -1,7 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2012
 @c   Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/syntax
@@ -109,7 +108,7 @@ Then come the characters for any desired flags.  If no matching
 character or flags are needed, one character is sufficient.
 
   For example, the syntax descriptor for the character @samp{*} in C
-mode is @samp{@w{. 23}} (i.e., punctuation, matching character slot
+mode is @code{". 23"} (i.e., punctuation, matching character slot
 unused, second character of a comment-starter, first character of a
 comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e.,
 punctuation, matching character slot unused, first character of a
@@ -129,10 +128,10 @@ their meanings, and examples of their use.
 @deffn {Syntax class} @w{whitespace character}
 @dfn{Whitespace characters} (designated by @w{@samp{@ }} or @samp{-})
 separate symbols and words from each other.  Typically, whitespace
-characters have no other syntactic significance, and multiple whitespace
-characters are syntactically equivalent to a single one.  Space, tab,
-newline and formfeed are classified as whitespace in almost all major
-modes.
+characters have no other syntactic significance, and multiple
+whitespace characters are syntactically equivalent to a single one.
+Space, tab, and formfeed are classified as whitespace in almost all
+major modes.
 @end deffn
 
 @deffn {Syntax class} @w{word constituent}
@@ -375,7 +374,7 @@ character, @samp{/}, does not have the @samp{b} flag.
 
 @item @samp{*/}
 This is a comment-end sequence for ``b'' style because the first
-character, @samp{*}, does have the @samp{b} flag.
+character, @samp{*}, has the @samp{b} flag.
 
 @item newline
 This is a comment-end sequence for ``a'' style, because the newline
@@ -607,11 +606,13 @@ expression prefix syntax class, and characters with the @samp{p} flag.
 @section Parsing Expressions
 
   This section describes functions for parsing and scanning balanced
-expressions, also known as @dfn{sexps}.  Basically, a sexp is either a
-balanced parenthetical grouping, a string, 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.
+expressions.  We will refer to such expressions as @dfn{sexps},
+following the terminology of Lisp, even though these functions can act
+on languages other than Lisp.  Basically, a sexp is either a balanced
+parenthetical grouping, a string, or a ``symbol'' (i.e.@: 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
@@ -831,10 +832,6 @@ The value is @code{nil} if @var{state} represents a parse which has
 arrived at a top level position.
 @end defun
 
-  We have provided this access function rather than document how the
-data is represented in the state, because we plan to change the
-representation in the future.
-
 @node Low-Level Parsing
 @subsection Low-Level Parsing
 
@@ -1085,6 +1082,24 @@ defaults to the current buffer's category table.
 @defun define-category char docstring &optional table
 This function defines a new category, with name @var{char} and
 documentation @var{docstring}, for the category table @var{table}.
+
+Here's an example of defining a new category for characters that have
+strong right-to-left directionality (@pxref{Bidirectional Display})
+and using it in a special category table:
+
+@example
+(defvar special-category-table-for-bidi
+  (let ((category-table (make-category-table))
+       (uniprop-table (unicode-property-table-internal 'bidi-class)))
+    (define-category ?R "Characters of bidi-class R, AL, or RLO"
+                     category-table)
+    (map-char-table
+     #'(lambda (key val)
+        (if (memq val '(R AL RLO))
+            (modify-category-entry key ?R category-table)))
+     uniprop-table)
+    category-table))
+@end example
 @end defun
 
 @defun category-docstring category &optional table
@@ -1192,7 +1207,3 @@ category table.  It inserts the descriptions in a buffer, and then
 displays that buffer.  If @var{buffer-or-name} is non-@code{nil}, it
 describes the category table of that buffer instead.
 @end deffn
-
-@ignore
-   arch-tag: 4d914e96-0283-445c-9233-75d33662908c
-@end ignore