[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#38049: C mode fontification broken with reposition-window
From: |
Juri Linkov |
Subject: |
bug#38049: C mode fontification broken with reposition-window |
Date: |
Wed, 06 Nov 2019 00:10:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
> 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.
>
> As Stefan M has sometimes remarked, narrowing is often not a good idea.
>
> It would seem undesirable for the vertical-motion in (iii) to trigger
> font-locking, since it is merely trying to count lines. Perhaps there
> should be a macro `without-fontifying' which could be wrapped around
> this call to vertical-motion, if there isn't such a thing anyway.
ISTR there was some macro to disable font-lock temporarily,
but I can't find it. Maybe just let-binding font-lock-mode to nil
could help?