GNU bug report logs - #38049
C mode fontification broken with reposition-window

Previous Next

Packages: emacs, cc-mode;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 3 Nov 2019 20:32:02 UTC

Severity: normal

Found in version 27.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alan Mackenzie <acm <at> muc.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#38049: closed (C mode fontification broken with
 reposition-window)
Date: Sat, 09 Nov 2019 14:46:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 9 Nov 2019 14:45:17 +0000
with message-id <20191109144517.GB5546 <at> ACM>
and subject line Re: bug#38049: C mode fontification broken with reposition-window
has caused the debbugs.gnu.org bug report #38049,
regarding C mode fontification broken with reposition-window
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
38049: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38049
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: C mode fontification broken with reposition-window
Date: Sun, 03 Nov 2019 22:28:05 +0200
Version: 27.0.50

This is a reproducible test case:

0. emacs -Q
1. C-x C-f emacs/lib-src/emacsclient.c
2. M-: (progn (search-forward "create-frame" nil t) (reposition-window))

Then half screen displays unfontified lines.

Fontification doesn't fail in other modes, only in C mode.

This has something to do with interaction between c-font-lock
and buffer navigation in reposition-window.


[Message part 3 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: Juri Linkov <juri <at> linkov.net>
Cc: 38049-done <at> debbugs.gnu.org
Subject: Re: bug#38049: C mode fontification broken with reposition-window
Date: Sat, 9 Nov 2019 14:45:17 +0000
Hello, Juri.

On Tue, Nov 05, 2019 at 21:07:37 +0000, Alan Mackenzie wrote:
> On Sun, Nov 03, 2019 at 22:28:05 +0200, Juri Linkov wrote:
> > Version: 27.0.50

> > This is a reproducible test case:

> > 0. emacs -Q
> > 1. C-x C-f emacs/lib-src/emacsclient.c
> > 2. M-: (progn (search-forward "create-frame" nil t) (reposition-window))

> > Then half screen displays unfontified lines.

> > Fontification doesn't fail in other modes, only in C mode.

> > This has something to do with interaction between c-font-lock
> > and buffer navigation in reposition-window.

> Indeed it does.

> Briefly,
> (i) reposition-window narrows to (2758 3940) in
> repos-count-screen-lines.
> (ii) This latter function uses vertical-motion to count the lines.
> (iii) vertical-motion triggers jit-lock fontification.
> (iv) This calls (eventually) c-font-lock-fontify-region.
> (v) c-font-lock-fontify-region attempts to examine buffer text before
>   the start of the jit-lock chunk to find syntactic context.
> (vi) This is outside the visible region, so Emacs raises an exception.
> (vii) The exception is caught and discarded by an unwind-protect in
>   c-font-lock-fontify-region.
> (viii) The jit-lock chunk remains unfontified.

[ .... ]

I have fixed this bug by widening around c-font-lock-fontify-region.  I
am closing the bug with this post.

-- 
Alan Mackenzie (Nuremberg, Germany).


This bug report was last modified 5 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.