Open Ruin0x11 opened 5 years ago
CC Mode is tricky. Fontification should happen inside a narrowing (where (bobp)
returns t), but maybe some of CC Mode's functions populates the same cache and is called outside of a narrowing. It might take a fair amount of work to track it down, and honestly I would not recommend it, because IME even c-mode
doesn't work well with MMM. So if it does work, maybe it's good enough.
You can try to report this problem to the csharp-mode
devevloper, though. If c-mode
doesn't use bobp
, why should csharp-mode
do that?
I'm trying to use
mmm-mode
in a language with embedded C# blocks. Sincecsharp-mode
is derived fromc-mode
it fails to parse because it callsc-state-pp-to-literal
which depends on the value of(bobp)
. But(bobp)
returnsnil
even though the fontify function starts at the beginning of the C# region. If there is a C#using
directive at the beginning of the embedded region thenmmm-mode-idle-reparse
will constantly throw errors on every edit command and nothing gets fontified. It also prevents insertion of text sometimes, eventually forcing me to disable it.Also
mmm-derived-c-modes
doesn't containcsharp-mode
, but adding it doesn't seem to change anything. Strangelyc-mode
itself doesn't throw any errors so I'll use it in the meantime.This example is enough to reproduce the error.