[Top][All Lists]

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

confusion over undocumented syntax-table features, font-lock and syntax-

From: Luc Teirlinck
Subject: confusion over undocumented syntax-table features, font-lock and syntax-tables
Date: Sat, 15 Feb 2003 17:37:26 -0600 (CST)

Matthew Smith wrote:

    One question remains, which may yet be bug of some kind:

    What is the meaning of assigning a matching char to chars in syntax
    class comment-starter (`<') or string-quote (`"')?  Several packages,
    including sh-script.el, make such an assignment, but I do not see that
    the meaning of matching chars is documented except for syntax classes
    open-parenthesis and close-parenthesis.

The Elisp manual indeed says:

   A syntax descriptor is a Lisp string that specifies a syntax class,
   a matching character (used only for the parenthesis classes) and flags.

Hence there indeed is either an inaccuracy in the Elisp manual and the
various documentation strings you alluded to in your prior posting or
the usage in the packages you mentioned is inappropriate.

I do not know which of the two alternatives applies.  However, use of
a matching character for comment starter and ender seems to make at
least some sense to me.  For string quote, it seems really strange.
The Elisp manual says:

 - Syntax class: string quote
     "String quote characters" (designated by `"') are used in many
     languages, including Lisp and C, to delimit string constants.
     The same string quote character appears at the beginning and the
     end of a string.  Such quoted strings do not nest.

Thus, if a package mentions the identical character as a matcher, then
this seems totally redundant.  If it mentions another character, it
seems dangerous (at least to me), since plenty of Lisp code might
expect the identical character to match, relying on the above quote.



reply via email to

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