unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18856@debbugs.gnu.org, deng@randomsample.de
Subject: bug#18856: 24.4; *grep* output buffer not getting fontified when jit-lock-defer-time	is used
Date: Tue, 28 Oct 2014 15:01:46 -0400	[thread overview]
Message-ID: <jwvy4s0t4kf.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <838uk02i9j.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Oct 2014 19:53:12 +0200")

>> IOW jit-lock-defer should use a non-idle timer for this case.
> But then how do we ensure the fontifications don't happen for as long
> as Emacs isn't idle?

Yes, that question did occur to me as well, but I didn't have an
immediate answer, so I decided to stay silent ;-)

> test idleness by hand inside the timer function?

I don't think we can really do that unless we can access the "time since
idleness started" rather than just whether Emacs is idle or not (which
it almost always is when running timer functions).

Another approach would be to cancel that timer from pre-command-hook.

>> Note that an alternative implementation of jit-lock-defer which only
>> defers when there is not input pending would supposedly not suffer from
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> You mean, when there _is_ input pending, right?

Of course, thanks for correcting me.

>> this problem since it wouldn't defer fontification in this case (of
>> course, that would suffer from the reverse problem that by failing to
>> defer fontification, the redisplay may not be able to keep up with
>> process output).
> Indeed, so what's the point of doing that?

To only defer fontification when we know "for sure" that the user is
waiting for further processing.  If jit-lock-defer-time is smaller than
the normal time between key presses, deferring fontification actually
increases the amount of work done by Emacs, since we end up doing
2 redisplays per command (once without fontification, plus another one
with fontification after jit-lock-defer-time passed), so for "normal"
use, it's more efficient not to defer.

BTW, another reason not to defer for process-output is that contrary to
key-commands, process-output is processed more efficiently if we receive
it in large chunks than in small chunks.  So if there's "pending process
output", it's OK to keep redisplaying with fontification, since it just
means that the next time we get to read the process output we'll get more
output, which we'll hence process more efficiently.


        Stefan





  reply	other threads:[~2014-10-28 19:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 19:33 bug#18856: 24.4; *grep* output buffer not getting fontified when jit-lock-defer-time is used David Engster
2014-10-28 16:36 ` Eli Zaretskii
2014-10-28 17:38   ` Stefan Monnier
2014-10-29 15:01     ` Eli Zaretskii
2014-10-29 22:23       ` Stefan Monnier
2014-11-01 14:24         ` Eli Zaretskii
2014-10-28 17:09 ` Stefan Monnier
2014-10-28 17:53   ` Eli Zaretskii
2014-10-28 19:01     ` Stefan Monnier [this message]
2014-10-28 19:26       ` Eli Zaretskii
2014-10-29  4:06         ` Stefan Monnier
2014-10-29 14:16           ` Eli Zaretskii
2014-10-29 22:16             ` Stefan Monnier
2014-10-30  3:39               ` Eli Zaretskii
2014-10-30  4:10                 ` Stefan Monnier

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=jwvy4s0t4kf.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18856@debbugs.gnu.org \
    --cc=deng@randomsample.de \
    --cc=eliz@gnu.org \
    /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).