all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* checking jit-lock-defer-multiline
@ 2005-10-24  8:18 martin rudalics
  2005-10-24 14:14 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2005-10-24  8:18 UTC (permalink / raw)


The recent change to `jit-lock-fontify-now' may disable checking the
`jit-lock-defer-multiline' property in a number of cases.  It might make
sense to introduce a variable `jit-lock-defer-multiline' with default
nil.  Modes like `perl-mode' would set this to t and the check in
`jit-lock-fontify-now' become:

            (when (and jit-lock-context-unfontify-pos
                       (>= jit-lock-context-unfontify-pos start)
                       (< jit-lock-context-unfontify-pos next)
                       (not jit-lock-defer-multiline))
              (setq jit-lock-context-unfontify-pos next))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: checking jit-lock-defer-multiline
  2005-10-24  8:18 checking jit-lock-defer-multiline martin rudalics
@ 2005-10-24 14:14 ` Stefan Monnier
  2005-10-25 12:34   ` martin rudalics
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2005-10-24 14:14 UTC (permalink / raw)
  Cc: emacs-devel

> The recent change to `jit-lock-fontify-now' may disable checking the
> `jit-lock-defer-multiline' property in a number of cases.  It might make
> sense to introduce a variable `jit-lock-defer-multiline' with default
> nil.  Modes like `perl-mode' would set this to t and the check in
> `jit-lock-fontify-now' become:

>             (when (and jit-lock-context-unfontify-pos
>                        (>= jit-lock-context-unfontify-pos start)
>                        (< jit-lock-context-unfontify-pos next)
>                        (not jit-lock-defer-multiline))
>               (setq jit-lock-context-unfontify-pos next))

Hmm... Could you give some example (concrete or hypothetical) where the
problem you mention comes up?


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: checking jit-lock-defer-multiline
  2005-10-24 14:14 ` Stefan Monnier
@ 2005-10-25 12:34   ` martin rudalics
  2005-10-25 15:16     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2005-10-25 12:34 UTC (permalink / raw)
  Cc: emacs-devel

 > Could you give some example (concrete or hypothetical) where the
 > problem you mention comes up?

I'm looking for a practical font-lock-multiline substitute.  I dislike
font-lock-multiline because it may introduce too much overhead during
typing, especially when the multiline property spans a couple of lines.
Using jit-lock-defer-multiline should ideally resolve this because it's
processed when I don't type.

Now suppose I set a jit-lock-defer-multiline property from the beginning
of foo till the end of bar as in

foo
...
bar

The property would get assigned iff foo is textually followed by bar on
some line below.  If some user changes bar to baz I would have to act in
some way and the jit-lock-defer-multiline should help me to rescan the
text from foo till baz.  With the recent change the following might
happen: If the user replaces bar by baz _and_ inserts some text on the
line below baz, redisplay would call to fontify these lines "as usual".
jit-lock-context-fontify, on the other hand, would eventually refontify
from a position below these lines.  Refontification would not see foo in
either case.

However, I believe the extra variable is not needed.  The following should
suffice:

            (when (and jit-lock-context-unfontify-pos
                       (< jit-lock-context-unfontify-pos next)
                       (>= jit-lock-context-unfontify-pos start)
                       (not (get-text-property start 'jit-lock-defer-multiline)))
              (setq jit-lock-context-unfontify-pos next))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: checking jit-lock-defer-multiline
  2005-10-25 12:34   ` martin rudalics
@ 2005-10-25 15:16     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2005-10-25 15:16 UTC (permalink / raw)
  Cc: emacs-devel

> However, I believe the extra variable is not needed.  The following should
> suffice:

>             (when (and jit-lock-context-unfontify-pos
>                        (< jit-lock-context-unfontify-pos next)
>                        (>= jit-lock-context-unfontify-pos start)
>                        (not (get-text-property start 'jit-lock-defer-multiline)))
>               (setq jit-lock-context-unfontify-pos next))

Oh, that makes more sense.  Thank you.


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-25 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-24  8:18 checking jit-lock-defer-multiline martin rudalics
2005-10-24 14:14 ` Stefan Monnier
2005-10-25 12:34   ` martin rudalics
2005-10-25 15:16     ` Stefan Monnier

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.