m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/doc/m4.texinfo,v


From: Eric Blake
Subject: Changes to m4/doc/m4.texinfo,v
Date: Sat, 23 Dec 2006 00:02:22 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      06/12/23 00:02:21

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- doc/m4.texinfo      22 Dec 2006 21:42:42 -0000      1.84
+++ doc/m4.texinfo      23 Dec 2006 00:02:20 -0000      1.85
@@ -3663,18 +3663,22 @@
 
 @cindex changing the quote delimiters
 @cindex quote delimiters, changing the
address@hidden {Builtin (m4)} changequote (@ovar{start}, @ovar{end})
 The default quote delimiters can be changed with the builtin
address@hidden, where @var{start} is the new start-quote delimiter
-and @var{end} is the new end-quote delimiter.  If any of the arguments
-are missing, the default quotes (@code{`} and @code{'}) are used instead
-of the void arguments.
address@hidden:
+
address@hidden {Builtin (m4)} changequote (@dvar{start, `}, @dvar{end, '})
+This sets @var{start} as the new begin-quote delimiter and @var{end} as
+the new end-quote delimiter.  If both arguments are missing, the default
+quotes (@code{`} and @code{'}) are used.  If @var{start} is void, then
+quoting is disabled.  Otherwise, if @var{end} is missing or void, the
+default end-quote delimiter (@code{'}) is used.  The quote delimiters
+can be of any length.
 
 The expansion of @code{changequote} is void.
 @end deffn
 
 @example
-changequote([, ])
+changequote(`[', `]')
 @result{}
 define([foo], [Macro [foo].])
 @result{}
@@ -3682,34 +3686,50 @@
 @result{}Macro foo.
 @end example
 
+The quotation strings can safely contain eight-bit characters.
 If no single character is appropriate, @var{start} and @var{end} can be
-of any length.
+of any length.  Other implementations cap the delimiter length to five
+characters, but @acronym{GNU} has no inherent limit.
 
 @example
-changequote([[, ]])
+changequote(`[[[', `]]]')
 @result{}
-define([[foo]], [[Macro [[[foo]]].]])
+define([[[foo]]], [[[Macro [[[[[foo]]]]].]]])
 @result{}
 foo
address@hidden [foo].
address@hidden [[foo]].
 @end example
 
-Changing the quotes to the empty strings will effectively disable the
-quoting mechanism, leaving no way to quote text.
+Calling @code{changequote} with @var{start} as the empty string will
+effectively disable the quoting mechanism, leaving no way to quote text.
+However, using an empty string is not portable, as some other
+implementations of @code{m4} revert to the default quoting, while others
+preserve the prior non-empty delimiter.  If @var{start} is not empty,
+then an empty @var{end} will use the default end-quote delimiter of
address@hidden'}, as otherwise, it would be impossible to end a quoted string.
+Again, this is not portable, as some other @code{m4} implementations
+reuse @var{start} as the end-quote delimiter, while others preserve the
+previous non-empty value.  Omitting both arguments restores the default
+begin-quote and end-quote delimiters; fortunately this behavior is
+portable to all implementations of @code{m4}.
 
 @example
 define(`foo', `Macro `FOO'.')
 @result{}
-changequote(, )
+changequote(`', `')
 @result{}
 foo
 @result{}Macro `FOO'.
 `foo'
 @result{}`Macro `FOO'.'
+changequote(`,)
address@hidden
+foo
address@hidden FOO.
 @end example
 
 There is no way in @code{m4} to quote a string containing an unmatched
-left quote, except using @code{changequote} to change the current
+begin-quote, except using @code{changequote} to change the current
 quotes.
 
 If the quotes should be changed from, say, @samp{[} to @samp{[[},
@@ -3717,25 +3737,126 @@
 calls of @code{changequote} must be made, one for the temporary quotes
 and one for the new quotes.
 
-Neither quote string should start with a letter or @samp{_} (underscore),
-as they will be confused with names in the input.  Doing so disables
-the quoting mechanism.
+Macros are recognized in preference to the begin-quote string, so if a
+prefix of @var{start} can be recognized as part of a potential macro
+name, the quoting mechanism is effectively disabled.  Unless you use
address@hidden (@pxref{Changesyntax}), this means that @var{start}
+should not begin with a letter, digit, or @samp{_} (underscore).
+However, even though quoted strings are not recognized, the quote
+characters can still be discerned in macro expansion and in trace
+output.
+
address@hidden
+define(`echo', `$@@')
address@hidden
+define(`hi', `HI')
address@hidden
+changequote(`q', `Q')
address@hidden
+q hi Q hi
address@hidden HI Q HI
+echo(hi)
address@hidden
+changequote
address@hidden
+changequote(`-', `EOF')
address@hidden
+- hi EOF hi
address@hidden hi  HI
+changequote
address@hidden
+changequote(`1', `2')
address@hidden
+hi1hi2
address@hidden
+hi 1hi2
address@hidden hi
address@hidden example
+
+Quotes are recognized in preference to argument collection.  In
+particular, if @var{start} is a single @samp{(}, then argument
+collection is effectively disabled.  For portability with other
+implementations, it is a good idea to avoid @samp{(}, @samp{,}, and
address@hidden)} as the first character in @var{start}.
+
address@hidden
+define(`echo', `$#:$@@:')
address@hidden
+define(`hi', `HI')
address@hidden
+changequote(`(',`)')
address@hidden
+echo(hi)
address@hidden::hi
+changequote
address@hidden
+changequote(`((', `))')
address@hidden
+echo(hi)
address@hidden:HI:
+echo((hi))
address@hidden::hi
+changequote
address@hidden
+changequote(`,', `)')
address@hidden
+echo(hi,hi)bye)
address@hidden:HIhibye:
address@hidden example
+
+If @var{end} is a prefix of @var{start}, the end-quote will be
+recognized in preference to a nested begin-quote.  In particular,
+changing the quotes to have the same string for @var{start} and
address@hidden disables nesting of quotes.  When quote nesting is disabled,
+it is impossible to double-quote strings across macro expansions, so
+using the same string is not done very often.
+
address@hidden
+define(`hi', `HI')
address@hidden
+changequote(`""', `"')
address@hidden
+""hi"""hi"
address@hidden
+""hi" ""hi"
address@hidden hi
+""hi"" "hi"
address@hidden" "HI"
+changequote
address@hidden
+`hi`hi'hi'
address@hidden'hi
+changequote(`"', `"')
address@hidden
+"hi"hi"hi"
address@hidden
address@hidden example
+
+It is an error if the end of file occurs within a quoted string.
+
address@hidden status: 1
address@hidden
+`hello world'
address@hidden world
+`dangling quote
+^D
address@hidden:stdin:2: end of file in string
address@hidden example
 
 @node Changecom
 @section Changing the comment delimiters
 
 @cindex changing comment delimiters
 @cindex comment delimiters, changing
address@hidden {Builtin (m4)} changecom (@ovar{start}, @ovar{end})
 The default comment delimiters can be changed with the builtin
-macro @code{changecom}, where @var{start} is the new start-comment
-delimiter and @var{end} is the new end-comment delimiter.  If any of the
-arguments are void, the default comment delimiters (@code{#} and
-newline) are used instead of the void arguments.  The comment delimiters
-can be of any length.
+macro @code{changecom}:
 
-Calling @code{changecom} without any arguments disables the commenting
-mechanism completely.
address@hidden {Builtin (m4)} changecom (@ovar{start}, @dvar{end, @key{NL}})
+This sets @var{start} as the new begin-comment delimiter and @var{end}
+as the new end-comment delimiter.  If both arguments are missing, or
address@hidden is void, then comments are disabled.  Otherwise, if
address@hidden is missing or void, the default end-comment delimiter of
+newline is used.  The comment delimiters can be of any length.
 
 The expansion of @code{changecom} is void.
 @end deffn
@@ -3758,6 +3879,15 @@
 strings.  If you want the text inside a comment expanded, quote the
 start comment delimiter.
 
+Calling @code{changecom} without any arguments, or with @var{start} as
+the empty string, will effectively disable the commenting mechanism.  To
+restore the original comment start of @samp{#}, you must explicitly ask
+for it.  If @var{start} is not empty, then an empty @var{end} will use
+the default end-comment delimiter of newline, as otherwise, it would be
+impossible to end a comment.  However, this is not portable, as some
+other @code{m4} implementations preserve the previous non-empty
+delimiters instead.
+
 @example
 define(`comment', `COMMENT')
 @result{}
@@ -3765,41 +3895,126 @@
 @result{}
 # Not a comment anymore
 @result{}# Not a COMMENT anymore
+changecom(`#', `')
address@hidden
+# comment again
address@hidden comment again
 @end example
 
address@hidden Changeresyntax
address@hidden Changing the regular expression syntax
+The comment strings can safely contain eight-bit characters.
+If no single character is appropriate, @var{start} and @var{end} can be
+of any length.  Other implementations cap the delimiter length to five
+characters, but @acronym{GNU} has no inherent limit.
 
address@hidden regular expression syntax, changing
address@hidden GNU extensions
address@hidden {Builtin (gnu)} changeresyntax (@var{resyntax})
-By default, the @acronym{GNU} extensions @code{patsubst}, @code{regexp} and
-more recently @code{renamesyms} continue to use emacs style regular
-expression syntax (@pxref{Regular expression syntax}).
-
-The @code{changeresyntax} macro expands to nothing, but changes the
-default regular expression syntax used by M4 according to the value of
address@hidden, equivalent to passing @var{resyntax} as the argument to
address@hidden when invoking @code{m4}.  @xref{Operation
-modes, , Invoking m4}, for more details.  If @var{resyntax} is empty or
-omitted the default settings are reverted to emacs style.
address@hidden deffn
-
-Any one of the values below, case is not important, and optionally
-with @kbd{-} or @kbd{ } substituted for @kbd{_} in the given names,
-will set the default regular expression syntax as described in the
-table below.  For example the following are all equivalent to
address@hidden:
+Macros and quotes are recognized in preference to comments, so if a
+prefix of @var{start} can be recognized as part of a potential macro
+name, or confused with a quoted string, the comment mechanism is
+effectively disabled.  Unless you use @code{changesyntax}
+(@pxref{Changesyntax}), this means that @var{start} should not begin
+with a letter, digit, or @samp{_} (underscore), and that neither the
+start-quote nor the start-comment string should be a prefix of the
+other.
 
 @example
-changeresyntax(`gnu m4')
+define(`hi', `HI')
 @result{}
-changeresyntax(`GNU-m4')
+define(`hi1hi2', `hello')
 @result{}
-changeresyntax(`Gnu_M4')
+changecom(`q', `Q')
address@hidden
+q hi Q hi
address@hidden HI Q HI
+changecom(`1', `2')
address@hidden
+hi1hi2
address@hidden
+hi 1hi2
address@hidden 1hi2
+changecom(`[[', `]]')
address@hidden
+changequote(`[[[', `]]]')
address@hidden
+[hi]
address@hidden
+[[hi]]
address@hidden
+[[[hi]]]
address@hidden
+changequote
address@hidden
+changecom(`[[[', `]]]')
address@hidden
+changequote(`[[', `]]')
address@hidden
+[[hi]]
address@hidden
+[[[hi]]]
address@hidden
address@hidden example
+
+Comments are recognized in preference to argument collection.  In
+particular, if @var{start} is a single @samp{(}, then argument
+collection is effectively disabled.  For portability with other
+implementations, it is a good idea to avoid @samp{(}, @samp{,}, and
address@hidden)} as the first character in @var{start}.
+
address@hidden
+define(`echo', `$#:$@@:')
address@hidden
+define(`hi', `HI')
address@hidden
+changecom(`(',`)')
address@hidden
+echo(hi)
address@hidden::(hi)
+changecom
 @result{}
+changecom(`((', `))')
address@hidden
+echo(hi)
address@hidden:HI:
+echo((hi))
address@hidden::((hi))
+changecom(`,', `)')
address@hidden
+echo(hi,hi)bye)
address@hidden:HI,hi)bye:
 @end example
 
+It is an error if the end of file occurs within a comment.
+
address@hidden status: 1
address@hidden
+changecom(`/*', `*/')
address@hidden
+/*dangling comment
+^D
address@hidden:stdin:2: end of file in comment
address@hidden example
+
address@hidden Changeresyntax
address@hidden Changing the regular expression syntax
+
address@hidden regular expression syntax, changing
address@hidden @acronym{GNU} extensions
+The @acronym{GNU} extensions @code{patsubst}, @code{regexp}, and more
+recently, @code{renamesyms} each deal with regular expressions.  There
+are multiple flavors of regular expressions, so the
address@hidden builtin exists to allow choosing the default
+flavor:
+
address@hidden {Builtin (gnu)} changeresyntax (@var{resyntax})
+Changes the default regular expression syntax used by M4 according to
+the value of @var{resyntax}, equivalent to passing @var{resyntax} as the
+argument to the command line option @option{--regexp-syntax}
+(@pxref{Operation modes, , Invoking m4}).  If @var{resyntax} is empty,
+the default flaver is reverted to emacs style.
+
address@hidden can be any one of the values in the table below.  Case is
+not important, and @kbd{-} or @kbd{ } can be substituted for @kbd{_} in
+the given names.  If @var{resyntax} is unrecognized, a warning is
+issued and the default flavor is not changed.
+
 @table @dfn
 @item AWK
 @xref{awk regular expression syntax}, for details.
@@ -3811,12 +4026,6 @@
 @xref{posix-basic regular expression syntax}, for details.
 
 @item BSD_M4
address@hidden regular expression syntax}, for details.
-
address@hidden EMACS
address@hidden GNU_EMACS
address@hidden regular expression syntax}, for details.
-
 @item EXTENDED
 @itemx POSIX_EXTENDED
 @xref{posix-extended regular expression syntax}, for details.
@@ -3830,7 +4039,10 @@
 @xref{egrep regular expression syntax}, for details.
 
 @item GNU_M4
address@hidden regular expression syntax}, for details.
address@hidden EMACS
address@hidden GNU_EMACS
address@hidden regular expression syntax}, for details.  This is the
+default regular expression flavor.
 
 @item GREP
 @xref{grep regular expression syntax}, for details.
@@ -3847,13 +4059,52 @@
 @xref{posix-egrep regular expression syntax}, for details.
 @end table
 
+The expansion of @code{changeresyntax} is void.
+The macro @code{changeresyntax} is recognized only with parameters.
+This macro was added in M4 2.0.
address@hidden deffn
+
+For an example of how @var{resyntax} is recognized, the first three
+usages select the @samp{GNU_M4} regular expression flavor:
+
address@hidden
+changeresyntax(`gnu m4')
address@hidden
+changeresyntax(`GNU-m4')
address@hidden
+changeresyntax(`Gnu_M4')
address@hidden
+changeresyntax(`unknown')
address@hidden:stdin:4: Warning: changeresyntax: bad syntax-spec: `unknown'
address@hidden
address@hidden example
+
+Using @code{changeresyntax} makes it possible to omit the optional
address@hidden parameter to other macros, while still using a different
+regular expression flavor.
+
address@hidden
+patsubst(`ab', `a|b', `c')
address@hidden
+patsubst(`ab', `a\|b', `c')
address@hidden
+patsubst(`ab', `a|b', `c', `EXTENDED')
address@hidden
+changeresyntax(`EXTENDED')
address@hidden
+patsubst(`ab', `a|b', `c')
address@hidden
+patsubst(`ab', `a\|b', `c')
address@hidden
address@hidden example
+
 @node Changesyntax
 @section Changing the lexical structure of the input
 
 @cindex lexical structure of the input
 @cindex input, lexical structure of the
 @cindex syntax table
address@hidden GNU extensions
address@hidden @acronym{GNU} extensions
 @quotation
 The macro @code{changesyntax} and all associated functionality is
 experimental (@pxref{Experiments}).  The functionality might change in
@@ -3861,13 +4112,13 @@
 do for bugs.
 @end quotation
 
-The input to @code{m4} is read character per character, and these
+The input to @code{m4} is read character by character, and these
 characters are grouped together to form input tokens (such as macro
 names, strings, comments, etc.).
 
 Each token is parsed according to certain rules.  For example, a macro
-name starts with a letter or @kbd{_} and consists of the longest
-possible string of letters, @kbd{_} and digits.  But who is to decide
+name starts with a letter or @samp{_} and consists of the longest
+possible string of letters, @samp{_} and digits.  But who is to decide
 what characters are letters, digits, quotes, white space?  Earlier the
 operating system decided, now you do.
 
@@ -3875,81 +4126,107 @@
 
 @table @dfn
 @item Letters
-Characters that start a macro name.  The default is the letters as
-defined by the operating system and the character @kbd{_}.
+Characters that start a macro name.  Defaults to the letters as defined
+by the locale, and the character @samp{_}.
 
 @item Digits
 Characters that, together with the letters, form the remainder of a
-macro name.  The default is the ten digits @address@hidden@kbd{9}.
+macro name.  Defaults to the ten digits @address@hidden@samp{9}, and any
+other digits defined by the locale.
 
 @item White space
-Characters that should be trimmed from the beginning of each
-argument to a macro call.  The default is @kbd{SPC}, @kbd{TAB},
address@hidden and possibly others as defined by the operating system.
+Characters that should be trimmed from the beginning of each argument to
+a macro call.  The defaults are space, tab, newline, carriage return,
+form feed, and vertical tab, and any others as defined by the locale.
 
 @item Open parenthesis
-Characters that open the argument list of a macro call.  Default
-is @kbd{(}.
+Characters that open the argument list of a macro call.  The default is
+the single character @samp{(}.
 
 @item Close parenthesis
-Characters that close the argument list of a macro call.  Default is
address@hidden)}.
+Characters that close the argument list of a macro call.  The default
+is the single character @samp{)}.
 
 @item Argument separator
-Characters that separate the arguments of a macro call.  Default
-is @kbd{,}.
+Characters that separate the arguments of a macro call.  The default is
+the single character @samp{,}.
 
 @item Dollar
 Characters that can introduce an argument reference in the body of a
-macro.  Default is @kbd{$}.
+macro.  The default is the single character @samp{$}.
+
address@hidden Left quote
+The set of characters that can start a single-character quoted string.
+The default is the single character @samp{`}.  For multiple-character
+quote delimiters, use @code{changequote} (@pxref{Changequote}).
+
address@hidden Begin comment
+The set of characters that can start a single-character comment.  The
+default is the single character @samp{#}.  For multiple-character
+comment delimiters, use @code{changecom} (@pxref{Changecom}).
 
 @item Other
 Characters that have no special syntactical meaning to @code{m4}.
-Default is all characters except those in the categories above.
+Defaults to all characters except those in the categories above.
 
 @item Active
-Characters that themselves, alone, form macro names.  No default.
+Characters that themselves, alone, form macro names.  This is a
address@hidden extension, and active characters have lower precedence
+than comments.  By default, no characters are active.
 
 @item Escape
-Characters that must precede macro names for them to be recognized.  No
-default.
-
+Characters that must precede macro names for them to be recognized.
+This is a @acronym{GNU} extension.  When an escape character is defined,
+then macros are not recognized unless the escape character is present;
+however, the macro name, visible by @samp{$0} in macro definitions, does
+not include the escape character.  By default, no characters are
+escapes.
+
address@hidden FIXME - we should also consider supporting:
address@hidden @item Ignore - characters that are ignored if they appear in
address@hidden the input; perhaps defaulting to '\0', category 'I'.
address@hidden @item Assign -character used in macro definitions for default
address@hidden variables, category '='.
 @end table
 
 @noindent
 Each character can, besides the basic syntax category, have some syntax
-attributes.  These are:
+attributes.  One reason these are attributes rather than categories is
+that end delimiters are never recognized except when searching for the
+end of a token triggered by a start delimiter; the end delimiter can
+have syntax properties of its own when it appears in isolation.  These
+attributes are:
 
 @table @dfn
address@hidden Left quote
-The characters that start a quoted string.  Default is @kbd{`}.  Basic
-syntax category is `Other'.
-
 @item Right quote
-The characters that end a quoted string.  Default is @kbd{'}.  Basic
-syntax category is `Other'.
-
address@hidden Begin comment
-The characters that begin a comment.  Default is @kbd{#}.  Basic syntax
-category is `Other'.
+The set of characters that can end a single-character quoted string.
+The default is the single character @samp{'}.  For multiple-character
+quote delimiters, use @code{changequote} (@pxref{Changequote}).  Note
+that @samp{'} also defaults to the syntax category `Other', when it
+appears in isolation.
 
 @item End comment
-The characters that end a comment.  Default is @kbd{newline}.  Basic
-syntax category is `White space'.
+The set of characters that can end a single-character commet.  The
+default is the single character @kbd{newline}.  For multiple-character
+comment delimiters, use @code{changecom} (@pxref{Changecom}).  Note that
+newline also defaults to the syntax category `White space', when it
+appears in isolation.
 @end table
 
address@hidden
-
 The builtin macro @code{changesyntax} is used to change the way
 @code{m4} parses the input stream into tokens.
 
 @deffn {Builtin (gnu)} changesyntax (@var{syntax-spec}, @dots{})
-The @var{syntax-spec} is a string, whose first character determines the
-syntax category of the other characters.   Character ranges are expanded
-as for @ref{Translit}.  If there are no other
-characters, @emph{all} characters are given the syntax code.
-
-The characters for the syntax categories are:
+Each @var{syntax-spec} is a two-part string.  The first part is a
+command, consisting of a single character describing a syntax category,
+and an optional one-character action.  The action can be @samp{-} to
+remove the listed characters from that category and reassign them to the
+`Other' category, @samp{=} to set the category to the listed characters
+and reassign all other characters previously in that category to
+`Other', or @samp{+} to add the listed characters to the category
+without affecting other characters.  If an action is not specified, but
+additional characters are present, then @samp{=} is assumed.  The
+case-insensitive characters for the syntax categories are:
 
 @table @kbd
 @item W
@@ -3980,32 +4257,54 @@
 Begin comment
 @item E
 End comment
address@hidden
address@hidden @item I
address@hidden Ignore
address@hidden @item =
address@hidden Assign
 @end table
 
-The expansion of @code{changesyntax} is void.
+The remaining characters of each @var{syntax-spec} form the set of
+characters to perform the action on for that syntax category.  Character
+ranges are expanded as for @code{translit} (@pxref{Translit}).  To start
+the character set with @samp{-}, @samp{+}, or @samp{=}, an action must
+be specified.
+
+If @var{syntax-spec} is just a category, and no action or characters
+were specified, then all characters in that category are reset to their
+default state.  A warning is issued if the category character is not
+valid.  If @var{syntax-spec} is the empty string, then all categories
+are reset to their default state.
 
-The builtin macro @code{changesyntax} is recognized only when given
-arguments.
+The expansion of @code{changesyntax} is void.
+The macro @code{changesyntax} is recognized only with parameters.  Use
+this macro with caution, as it is possible to change the syntax in such
+a way that no further macros can be recognized by @code{m4}.
+This macro was added in M4 2.0.
 @end deffn
 
address@hidden
-With @code{changesyntax} we can modify the meaning of a word.
+With @code{changesyntax} we can modify what characters form a word.
 
 @example
 define(`test.1', `TEST ONE')
 @result{}
 __file__
 @result{}stdin
-changesyntax(`O_', `W.')
+test.1
address@hidden
+changesyntax(`W+.', `W-_')
 @result{}
 __file__
 @result{}__file__
 test.1
 @result{}TEST ONE
+changesyntax(`W')
address@hidden
+__file__
address@hidden
+test.1
address@hidden
 @end example
 
address@hidden
 Another possibility is to change the syntax of a macro call.
 
 @example
@@ -4013,7 +4312,7 @@
 @result{}
 test(a, b, c)
 @result{}3
-changesyntax(`(<', `,|', `)>', `O(,)')
+changesyntax(`(<', `,|', `)>')
 @result{}
 test(a, b, c)
 @result{}0(a, b, c)
@@ -4021,22 +4320,21 @@
 @result{}3
 @end example
 
address@hidden
 Leading spaces are always removed from macro arguments in @code{m4}, but
-by changing the syntax categories we can avoid it.
+by changing the syntax categories we can avoid it.  The use of
address@hidden is an alternative to using a literal tab character.
 
 @example
 define(`test', `$1$2$3')
 @result{}
 test(`a', `b', `c')
 @result{}abc
-changesyntax(`O         ')
+changesyntax(`O 'format(`%c', `9'))
 @result{}
 test(a, b, c)
 @result{}a b c
 @end example
 
address@hidden
 It is possible to redefine the @samp{$} used to indicate macro arguments
 in user defined macros.
 
@@ -4065,7 +4363,7 @@
 @end example
 
 Macro calls can be given a @TeX{} or Texinfo like syntax using an
-escape.  If one or more characters are defined as escapes macro names
+escape.  If one or more characters are defined as escapes, macro names
 are only recognized if preceded by an escape character.
 
 If the escape is not followed by what is normally a word (a letter
@@ -4118,35 +4416,37 @@
 There is obviously an overlap with @code{changecom} and
 @code{changequote}.  Comment delimiters and quotes can now be defined in
 two different ways.  To avoid incompatibilities, if the quotes are set
-with @code{changequote}, all characters marked in the syntax table as
-quotes will be unmarked, leaving only one set of defined quotes as
-before.  Since the quotes are syntax attributes rather than syntax
-categories, the old quotes simply revert to their old category.  If the
-quotes are set with @code{changesyntax}, other characters marked as
-quotes are left untouched, resulting in at least two sets of quotes.
-This applies to comment delimiters as well, @emph{mutatis mutandis}.
+with @code{changequote}, all other characters marked in the syntax table
+as quotes will revert to their normal syntax categories, leaving only
+one set of defined quotes as before.  If the quotes are set with
address@hidden, it is possible to result in multiple sets of
+quotes.  This applies to comment delimiters as well, @emph{mutatis
+mutandis}.
 
 @example
 define(`test', `TEST')
 @result{}
-changesyntax(`L<', `R>')
+changesyntax(`L+<', `R+>')
 @result{}
 <test>
 @result{}test
-`test>
+`test'
 @result{}test
+[test]
address@hidden
 changequote(<[>, `]')
 @result{}
 <test>
 @result{}<TEST>
+`test'
address@hidden'
 [test]
 @result{}test
 @end example
 
address@hidden
-If categories, that form single character tokens, contain several
-characters, all are treated as equal.  Any open parenthesis will match
-any close parenthesis, etc.
+If several characters are assigned to a category that forms single
+character tokens, all such characters are treated as equal.  Any open
+parenthesis will match any close parenthesis, etc.
 
 @example
 changesyntax(`(@{<', `)@}>', `,;:', `O(,)')
@@ -4155,9 +4455,9 @@
 @result{}00001111
 @end example
 
address@hidden
-This is not so for long quotes, which cannot be matched by single
-character quote and vice versa.  The same goes for comment delimiters.
+On the other hand, a multi-character start-quote sequence, which can
+only be created by @code{changequote}, will only be matched by the
+corresponding end-quote sequence.  The same goes for comment delimiters.
 
 @example
 define(`test', `==$1==')




reply via email to

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