Re: xemacs syntax highlighting problem [message #33572] |
Thu, 16 January 2003 07:32  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Carsten Dominik wrote:
>
>>>> >> "s" == s <Sebastian> writes:
>
> s> Hi all,
> s> I have a little syntax highlighting problem with my xemacs IDLWAVE mode:
> s> When using linebreaks like
> s> wBase = WIDGET_BASE( /COLUMN, $
> s> TITLE=('Mytitle'), $
> s> GROUP_LEADER= myLeader)
> s> the keywords in the continued lines (TITLE and GROUPLEADER) are
> s> highlighted correctly when I open the file.
> s> But once I edit something in these lines (e.g. change 'Mytitle' to
> s> 'AnotherTitle'), the highlight goes away.
> s> When I move the comma from the end of the lines to the start of the next
> s> lines, like:
> s> wBase = WIDGET_BASE( /COLUMN $
> s> ,TITLE=('Mytitle') $
> s> ,GROUP_LEADER= myLeader)
> s> everything works fine.
>
> s> Any idea whats wrong and how I can fix it?
>
> It cannot be fixed. When editing, [X]Emacs looks only at the current
> line to update syntax highlighting. This is mainly an efficiency
> question - you don't want to scan the whole buffer after every
> character typed.
>
> When there is no comma before the keyword, there is no way to tell (by
> looking at the current line only) if it is a keyword or a variable
> assignment.
>
> On the other hand, when opening a new file, the whole buffer is
> fontified in one go, and in this case the engine notices
> continuation lines and highlights correctly.
Why can't the fontification be based on a "context" buffer (dunno what the proper term
would be). That is, you update syntax highlighting based on the immediate context of what
surrounds the line in question? I have no idea how one would specify the extent of the
context, though.
The efficiency issue Carsten mentions can be a real bugger. I use nedit and it checks the
entire buffer every keystroke. Not usually a problem unless you have a lot of lines of
code and you type in a string near the top of the file. The first use of ' causes all the
following 's to be redefined and the character string syntax highlighting "flips". The
closing ' in the line I'm typing corrects the situation but it can take a couple of
seconds while nedit cogitates over the matter. Can be a real pain in the rear.
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7274
Fax:(301)763-8545
|
|
|