XEmacs 21.4.4:
[The following occurs in the upcoming, not yet released, awk-mode (part
of cc-mode) which I'm developing.]
Start a new buffer in a mode in which syntax-table properties are enabled
and with an after-change function which applies these properties in a
certain fashion (see below). Type:
/regexp/ {
The two /s bounding regexp now each have the syntax-table property
string. Place the cursor over the {, and do C-M-:
(buffer-syntactic-context). The value returned is 'string, though it
should be nil. This is a bug.
The precise working of the after-change function is as follows: At each
buffer change, the syntax-table properties are cleared from the entire
line. The line is then scanned. If there is a single / (i.e. an
unbalanced awk regexp delimiter), it and the \n (if any) at the line end
are given the string-fence [(15)] s-t property. If there is a matching
pair of /s (i.e. a syntactically complete awk regexp), the two /s are
each given the string [(7)] property. [The motivation behind this is to
have unbalanced strings fontified differently from valid strings.]
So in the above example, the / in column zero first got s-t property
string-fence, then subsequently string.
Observation: If the entire string is entered into the buffer by, e.g.
C-y, b-s-c returns the correct value. It would seem that the function
does some sort of cacheing, yet fails to take full account of s-t text
properties begin changed _before_ the insertion point.
A cc of followups to this email would be appreciated.
Many thanks,
--
Alan Mackenzie (Munich, Germany)