Ralf Angeli <[EMAIL PROTECTED]> writes: > The font locking code in the multiline-font-lock branch currently > marks stuff like > \newcommand\foo{\bar} > as erroneous because the syntax of \newcommand is specified as > "*{}[][]{}" (meaning there is a starred version of the command and the > macro expects a mandatory argument followed by to optional arguments > followed by a mandatory argument) and the first mandatory argument is > not braced in the example. > > Are braces generally not necessary if only a single macro is > concerned? That means for font locking, can we treat the forms > \newcommand{\foo}{\bar} > \newcommand{\foo}\bar > \newcommand\foo{\bar} > \newcommand\foo\bar > as being equivalent and correct?
Correct? No. Happens to work though, but more by accident than by design. \def needs a braced replacement text (I would have expected \newcommand not to scan the replacement text as a macro argument but leave this to \def which is not a macro but a primitive). But since \newcommand has not been defined as I would have expected, indeed the latter version works. The difference between {\foo} and \foo gets ignored all the time: we need to deal with it. Switching \bar and {\bar} is almost always the result of a mistake rather than on purpose, in contrast. Still, the manual only recommends the braced versions, and in both instances leaving the braces off happens to work, even though this is used only for \foo in practice. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum _______________________________________________ auctex-devel mailing list auctex-devel@gnu.org http://lists.gnu.org/mailman/listinfo/auctex-devel