unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Oleksandr Gavenko <gavenkoa@gmail.com>
Cc: 12937@debbugs.gnu.org
Subject: bug#12937: 24.2; Fontification performed in 'jit-lock-defer-time' in any case (don't wait while Emacs become really idle).
Date: Mon, 19 Nov 2012 16:29:02 -0500	[thread overview]
Message-ID: <jwvsj85xpas.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87obitia6d.fsf@gavenkoa.example.com>

> I would try to workaround jerks with:
>   (setq jit-lock-defer-time 0.01)
> and with same negative effect by (see below):
>   (setq jit-lock-defer-time 3.0)

I don't see that.  I'm not sure how you tried, it but I did

  src/emacs -Q --eval '(setq jit-lock-defer-time 0.01)' src/xdisp.c

and scrolling with page-down indeed is jerky and I see that the buffer
is getting fontified (at least occasionally).  But if I try again with

  src/emacs -Q --eval '(setq jit-lock-defer-time 0.1)' src/xdisp.c

then the scrolling is fast&smooth and it only gets fontified when
I stop scrolling.

I suspect that fontification takes place in the 0.01s case because
redisplay itself takes more than 0.01s, so after redisplay we check
timers and see that we've been idle for more than 0.01s (and there's no
input yet because my repeat rate is 30Hz).

BTW, with 0.01s the behavior is particularly poor because the redisplay
is even slower than without it: we first do a redisplay without
fontification, and then we fontify and have to redo a redisplay, so the
first redisplay is mostly wasted work.

> Also note that fixing CC-mode is not a solution as there are many possible
> external modes that can be useful but with slow fontification.

Fixing cc-mode is not a general solution, indeed, but it should also be done.


        Stefan





  reply	other threads:[~2012-11-19 21:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 20:56 bug#12937: 24.2; Fontification performed in 'jit-lock-defer-time' in any case (don't wait while Emacs become really idle) Oleksandr Gavenko
2012-11-19 21:29 ` Stefan Monnier [this message]
2019-10-30 22:45   ` Lars Ingebrigtsen
2020-04-17 10:24     ` Stefan Kangas
2012-11-20  4:00 ` Eli Zaretskii

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=jwvsj85xpas.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=12937@debbugs.gnu.org \
    --cc=gavenkoa@gmail.com \
    /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).