Greetings,
My apologies if this is not the proper forum for this; it seemed the
most appropiate at first glance.
I've been using XEmacs for some time, having transitioned from FSF
Emacs about a year ago. While I very much prefer it overall, the one
thing I've missed is correct handling of Perl code.
As far as I've been able to make out, the primary feature preventing
XEmacs from correctly dealing with Perl code (due to its general
hairyness) is the concept of attaching overriding syntax-tables to
specific characters in a buffer. This functionality was introduced in
FSF Emacs between v19.33 and v20.2. I've been told that some effort was
made to introduce this feature to the XEmacs folks, but that there was
little interest.
I'm willing to do the work required to incorporate this functionality,
but I wanted to be sure that my changes would be accepted, and would be
in line with the general philosophies of XEmacs development (which seem
to differ from FSF's in a number of ways).
The changes I'm proposing (as taken from FSF Emacs) are essentially:
1. A new text property 'syntax-table, which is one of:
- a syntax table
Used instead of the buffer's to determine the syntax for this
character
- (syntax-code . matching-char)
Specifies the syntax for this occurence of the character
I'm assuming 'matching-char' would be the balancing character,
although I haven't been able to determine whether this is the
case from the FSF code/documentation
- nil
Equivalent to the property not existing: default to the buffer's
syntax table
2. Two new syntax classes:
- generic comment delimiter
Starts or ends a special kind of comment. Any generic comment
delimiter matches any other comment delimiter, but not a comment
starter or comment ender. Intended for use in the syntax-table
text property.
- generic string delimiter
Analagous to the generic comment delimiter, for strings.
These are the classes added in FSF Emacs, presumably to account for the
case where the language could allow one type of comment embedded within
another type. One would not want the embedded comment to end the
enclosing one. But it also seems like 'generic-*-starter' and
'generic-*-ender' would be required to avoid ambiguity.
An example of this sort of situation in Perl would be the string:
qq(This string shouldn't be terminated by the apostrophe.);
3. Modifications to the syntax handling routines to honor occurrences
of the syntax-table property for characters which have it set. Any code
which currently requests the syntax type for a given character would
have to first examine that character's 'syntax-table property before
defaulting to the buffer's table.
FSF Emacs uses the concept of a 'global syntax state' which is
maintained and updated as the pointer is moved through the buffer by
the syntax handling routines. This seems overkill to me, since the
correct syntax type could simply be determined for any given character
position on demand.
I would appreciate any comments anyone might have on this. Please CC
me, as I'm not subscribed to the list.