@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2016 Free Software
@c Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@node Syntax Tables
Usually, this designator character is one that is often assigned that
class; however, its meaning as a designator is unvarying and
independent of what syntax that character currently has. Thus,
-@samp{\} as a designator character always means ``escape character''
+@samp{\} as a designator character always stands for escape character
syntax, regardless of whether the @samp{\} character actually has that
syntax in the current syntax table.
@ifnottex
The Lisp modes have two string quote characters: double-quote (@samp{"})
and vertical bar (@samp{|}). @samp{|} is not used in Emacs Lisp, but it
is used in Common Lisp. C also has two string quote characters:
-double-quote for strings, and single-quote (@samp{'}) for character
+double-quote for strings, and apostrophe (@samp{'}) for character
constants.
Human text has no string quote characters. We do not want quotation
@end table
@item
-@samp{p} identifies an additional ``prefix character'' for Lisp syntax.
+@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 classes.
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
+parenthetical grouping, a string, or a symbol (i.e., a sequence
of characters whose syntax is either word constituent or symbol
constituent). However, characters in the expression prefix syntax
class (@pxref{Syntax Class Table}) are treated as part of the sexp if
A character's syntax controls how it 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 syntax of characters does not
+in-string and in-code, but the syntax of characters does not
directly say whether they are inside a string. For example (note that
15 is the syntax code for generic string delimiters),
expected, with nothing except whitespace between them, it returns
@code{t}; otherwise it returns @code{nil}.
-This function cannot tell whether the ``comments'' it traverses are
+This function cannot tell whether the comments it traverses are
embedded within a string. If they look like comments, it treats them
as comments.
The behavior of @code{parse-partial-sexp} is also affected by
@code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}).
+@defvar comment-end-can-be-escaped
+If this buffer local variable is non-@code{nil}, a single character
+which usually terminates a comment doesn't do so when that character
+is escaped. This is used in C and C++ Modes, where line comments
+starting with @samp{//} can be continued onto the next line by
+escaping the newline with @samp{\}.
+@end defvar
+
You can use @code{forward-comment} to move forward or backward over
one comment or several comments.
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:
+and using it in a special category table. To obtain the information
+about the directionality of characters, the example code uses the
+@samp{bidi-class} Unicode property (@pxref{Character Properties,
+bidi-class}).
@example
(defvar special-category-table-for-bidi
+ ;; Make an empty category-table.
(let ((category-table (make-category-table))
- (uniprop-table (unicode-property-table-internal 'bidi-class)))
+ ;; Create a char-table which gives the 'bidi-class' Unicode
+ ;; property for each character.
+ (uniprop-table (unicode-property-table-internal 'bidi-class)))
(define-category ?R "Characters of bidi-class R, AL, or RLO"
category-table)
+ ;; Modify the category entry of each character whose 'bidi-class'
+ ;; Unicode property is R, AL, or RLO -- these have a
+ ;; right-to-left directionality.
(map-char-table
#'(lambda (key val)
- (if (memq val '(R AL RLO))
- (modify-category-entry key ?R category-table)))
+ (if (memq val '(R AL RLO))
+ (modify-category-entry key ?R category-table)))
uniprop-table)
category-table))
@end example