From: Juri Linkov <juri@linkov.net>
To: Alan Mackenzie <acm@muc.de>
Cc: 38049@debbugs.gnu.org
Subject: bug#38049: C mode fontification broken with reposition-window
Date: Wed, 06 Nov 2019 00:10:29 +0200 [thread overview]
Message-ID: <87lfsu9e6a.fsf@mail.linkov.net> (raw)
In-Reply-To: <20191105210737.GA6303@ACM> (Alan Mackenzie's message of "Tue, 5 Nov 2019 21:07:37 +0000")
> 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?
next prev parent reply other threads:[~2019-11-05 22:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-03 20:28 bug#38049: C mode fontification broken with reposition-window Juri Linkov
[not found] ` <mailman.552.1572813126.13325.bug-gnu-emacs@gnu.org>
2019-11-03 21:27 ` Alan Mackenzie
2019-11-05 21:07 ` Alan Mackenzie
[not found] ` <20191105210737.GA6303@ACM>
2019-11-05 22:10 ` Juri Linkov [this message]
2019-11-06 17:13 ` Eli Zaretskii
2019-11-06 20:56 ` Alan Mackenzie
2019-11-09 14:45 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lfsu9e6a.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=38049@debbugs.gnu.org \
--cc=acm@muc.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).