From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Interfering fontification in C? Date: Wed, 31 Dec 2003 11:51:32 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <48dusb.l7.ln@acm.acm> References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1072872885 25811 80.91.224.253 (31 Dec 2003 12:14:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2003 12:14:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 31 13:14:37 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AbfFF-00033D-00 for ; Wed, 31 Dec 2003 13:14:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AbgCe-0006LJ-B5 for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Dec 2003 08:16:00 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-mue1.dfn.de!newsfeed.stueberl.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1072872386 59858 193.149.49.134 (31 Dec 2003 12:06:26 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 31 Dec 2003 12:06:26 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:119697 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15639 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15639 Douglas "Local Deity" Lewan 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 ). 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").