* Interfering fontification in C?
@ 2003-12-31 5:19 Douglas "Local Deity" Lewan
2003-12-31 11:51 ` Alan Mackenzie
0 siblings, 1 reply; 3+ messages in thread
From: Douglas "Local Deity" Lewan @ 2003-12-31 5:19 UTC (permalink / raw)
All,
On occasion, C-mode gets into a bad fontification state for me.
With every keystroke, I'll get an error like the following.
font-lock-fontify-keywords-region(162 687 nil)
font-lock-default-fontify-region(162 663 nil)
font-lock-fontify-region(162 663)
run-hook-with-args(font-lock-fontify-region 162 663)
jit-lock-fontify-now(162 662)
jit-lock-function(162)
sit-for(0.125)
jit-lock-stealth-fontify()
apply(jit-lock-stealth-fontify nil)
byte-code("...." [timer apply 5 6] 4)
timer-event-handler([t 0 3 0 3 jit-lock-stealth-fontify nil t])
There are also errors that claim emacs has tried something like
(font-lock-fontify-region (match-beginning 5)
(match-end 1))
which seems pretty darned odd to me. (Sorry if I've got the
real error here wrong. It happens inside an (eval) and I'm
not seeing it at the moment.)
Can anyone one help me understand what's going on? Or fix it?
Or avoid it?
--
,Doug
Douglas Lewan
d_lewan2000@yahoo.com
Logic: The art of being wrong with confidence...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interfering fontification in C?
2003-12-31 5:19 Interfering fontification in C? Douglas "Local Deity" Lewan
@ 2003-12-31 11:51 ` Alan Mackenzie
2003-12-31 15:58 ` Douglas "Local Deity" Lewan
0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2003-12-31 11:51 UTC (permalink / raw)
Douglas "Local Deity" Lewan <doug@toucan.emperorlinux.com> wrote on Wed,
31 Dec 2003 05:19:09 GMT:
> All,
> On occasion, C-mode gets into a bad fontification state for me.
What Emacs version are you using? (M-x emacs-version).
What CC Mode version have you got? (M-x c-version).
> With every keystroke, I'll get an error like the following.
> font-lock-fontify-keywords-region(162 687 nil)
> font-lock-default-fontify-region(162 663 nil)
> font-lock-fontify-region(162 663)
> run-hook-with-args(font-lock-fontify-region 162 663)
> jit-lock-fontify-now(162 662)
> jit-lock-function(162)
> sit-for(0.125)
> jit-lock-stealth-fontify()
> apply(jit-lock-stealth-fontify nil)
> byte-code("...." [timer apply 5 6] 4)
> timer-event-handler([t 0 3 0 3 jit-lock-stealth-fontify nil t])
OK. This is the back trace. What was the error message that was
signalled? (This message should appear in your *Messages* buffer.)
> There are also errors that claim emacs has tried something like
> (font-lock-fontify-region (match-beginning 5)
> (match-end 1))
> which seems pretty darned odd to me. (Sorry if I've got the real error
> here wrong. It happens inside an (eval) and I'm not seeing it at the
> moment.)
Not necessarily. In this case, match 1 probably _encloses_ matches 2, 3,
4 and 5.
> Can anyone one help me understand what's going on? Or fix it?
> Or avoid it?
Yes, maybe, and hopefully yes. My feel is that you've hit some nasty
interaction between CC Mode and Jit Lock mode. The backtrace you give
above shows that the error is happening during Jit Lock's "stealth
fontification" (i.e., the background fontification which happens after
you haven't typed a key for some time.)
One way forward could be to upgrade to the latest CC Mode (available from
<http://cc-mode.sourceforge.net/release.php>). This might help if your
current version (M-x c-version) is lower than 5.31. If you're already
using 5.31 (or 5.31.1, etc.) and are prepared to help debug the problem,
a bug report to the CC Mode mailing list (at bug-cc-mode@gnu.org) would
be most appreciated.
As a quick fix, you might try using Lazy Lock mode instead, by putting
the following early on in your .emacs:
(setq font-lock-support-mode 'lazy-lock-mode)
Happy New Year!
> Douglas Lewan
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interfering fontification in C?
2003-12-31 11:51 ` Alan Mackenzie
@ 2003-12-31 15:58 ` Douglas "Local Deity" Lewan
0 siblings, 0 replies; 3+ messages in thread
From: Douglas "Local Deity" Lewan @ 2003-12-31 15:58 UTC (permalink / raw)
Alan Mackenzie<none@example.invalid> writes:
> Douglas "Local Deity" Lewan <doug@toucan.emperorlinux.com> wrote on Wed,
> 31 Dec 2003 05:19:09 GMT:
>
> > All,
>
> > On occasion, C-mode gets into a bad fontification state for me.
>
> What Emacs version are you using? (M-x emacs-version).
> What CC Mode version have you got? (M-x c-version).
Sorry. I've got the following versions
emacs: 21.2
CC-mode: 5.28
>
> > With every keystroke, I'll get an error like the following.
>
> > font-lock-fontify-keywords-region(162 687 nil)
> > font-lock-default-fontify-region(162 663 nil)
> > font-lock-fontify-region(162 663)
> > run-hook-with-args(font-lock-fontify-region 162 663)
> > jit-lock-fontify-now(162 662)
> > jit-lock-function(162)
> > sit-for(0.125)
> > jit-lock-stealth-fontify()
> > apply(jit-lock-stealth-fontify nil)
> > byte-code("...." [timer apply 5 6] 4)
> > timer-event-handler([t 0 3 0 3 jit-lock-stealth-fontify nil t])
>
> OK. This is the back trace. What was the error message that was
> signalled? (This message should appear in your *Messages* buffer.)
>
> > There are also errors that claim emacs has tried something like
>
> > (font-lock-fontify-region (match-beginning 5)
> > (match-end 1))
>
> > which seems pretty darned odd to me. (Sorry if I've got the real error
> > here wrong. It happens inside an (eval) and I'm not seeing it at the
> > moment.)
>
> Not necessarily. In this case, match 1 probably _encloses_ matches 2, 3,
> 4 and 5.
>
> > Can anyone one help me understand what's going on? Or fix it?
> > Or avoid it?
>
> Yes, maybe, and hopefully yes. My feel is that you've hit some nasty
> interaction between CC Mode and Jit Lock mode. The backtrace you give
> above shows that the error is happening during Jit Lock's "stealth
> fontification" (i.e., the background fontification which happens after
> you haven't typed a key for some time.)
>
> One way forward could be to upgrade to the latest CC Mode (available from
> <http://cc-mode.sourceforge.net/release.php>). This might help if your
> current version (M-x c-version) is lower than 5.31. If you're already
> using 5.31 (or 5.31.1, etc.) and are prepared to help debug the problem,
> a bug report to the CC Mode mailing list (at bug-cc-mode@gnu.org) would
> be most appreciated.
>
> As a quick fix, you might try using Lazy Lock mode instead, by putting
> the following early on in your .emacs:
>
> (setq font-lock-support-mode 'lazy-lock-mode)
>
> Happy New Year!
>
> > Douglas Lewan
>
> --
> Alan Mackenzie (Munich, Germany)
> Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
> (like "aa"), remove half of them (leaving, say, "a").
>
--
,Doug
Douglas Lewan
d_lewan2000@yahoo.com
All the simple programs have been written,
and all the good names taken.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-31 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-31 5:19 Interfering fontification in C? Douglas "Local Deity" Lewan
2003-12-31 11:51 ` Alan Mackenzie
2003-12-31 15:58 ` Douglas "Local Deity" Lewan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).