all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 20146@debbugs.gnu.org
Subject: bug#20146: font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned.
Date: Wed, 25 Mar 2015 17:12:05 +0000	[thread overview]
Message-ID: <20150325171204.GA3833@acm.fritz.box> (raw)
In-Reply-To: <jwvpp80bimf.fsf-monnier+emacsbugs@gnu.org>

Hello, Stefan.

On Sun, Mar 22, 2015 at 10:01:53PM -0400, Stefan Monnier wrote:
> >> >> The major mode sets font-lock-extend-region-function and this functions'
> >> >> result should be (and is) respected by the rest of font-lock.
> >> > If only, but this is simply not the case at the moment.
> >> > jit-lock-fontify-now has a hard-coded extension to whole lines,
> >> > regardless of the contents of font-lock-extend-region-functions.
> >> There's no relationship between the two.  The bounds that
> >> font-lock-fontify-region [gets] are not under the major mode's control.
> > Yes they are.  They can be set by
> > font-lock-extend-after-change-region-function, as described in the elisp
> > manual.

> That's where you're confused:
> font-lock-extend-after-change-region-function affects the region that's
> declared as "in need of refresh because of a change".  But that doesn't
> mean that this region will then be passed to font-lock-fontify-region.
> For example, if that region is not currently visible in any window, then
> jit-lock will typically do nothing.  And if only some part of that
> region is visible in a window, then maybe only that part will be then
> passed to font-lock-fontify-region so as to actually refresh it.
> And maybe that part will be combined with some other parts that were
> also in need of refresh and are now newly visible.  Or maybe that part
> will actually be fontified in several steps (i.e. several calls to
> font-lock-fontify-region).

Yes, I was confused about that.  I hope I've got it now.  Thanks for the
help.

[ ... ]

> > Looking more critically at jit-lock-fontify-now, there is simply no need
> > for it to expand the region to whole lines.

> I agree with this statement (I actually have such a change in my local
> tree), but that won't help you.
> Looking at jit-lock as the source of your pain is a waste of time.

OK.  But I have to be aware of how jit-lock works: in particular how the
actions in after-change-functions influence those of
jit-lock-fontify-now and font-lock-fontify-region.

[ ... ]

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2015-03-25 17:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 23:01 bug#20146: font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned Alan Mackenzie
2015-03-20 14:20 ` Stefan Monnier
2015-03-20 16:07   ` Alan Mackenzie
2015-03-20 19:39     ` Stefan Monnier
2015-03-21  0:00       ` Alan Mackenzie
2015-03-21  1:06         ` Daniel Colascione
2015-03-21 10:58           ` Alan Mackenzie
2015-03-21 11:36             ` Daniel Colascione
2015-03-21  2:29         ` Stefan Monnier
2015-03-21 13:19           ` Alan Mackenzie
2015-03-21 14:55             ` Stefan Monnier
2015-03-21 21:03           ` Alan Mackenzie
2015-03-21 22:30             ` Stefan Monnier
2015-03-22 14:13               ` Alan Mackenzie
2015-03-23  2:01                 ` Stefan Monnier
2015-03-25 17:12                   ` Alan Mackenzie [this message]
2015-03-25 18:26                     ` Stefan Monnier
2019-10-30 15:53     ` Lars Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150325171204.GA3833@acm.fritz.box \
    --to=acm@muc.de \
    --cc=20146@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.