emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-n is very slow in Font-Lock mode


From: Eli Zaretskii
Subject: Re: C-n is very slow in Font-Lock mode
Date: Wed, 27 Apr 2005 14:59:52 +0300

> Cc: address@hidden
> From: David Kastrup <address@hidden>
> Date: Wed, 27 Apr 2005 13:32:11 +0200
> 
> >> We are talking about the situation where the input is coming in faster
> >> than Emacs can process it.
> >
> > See, we don't really know that.  Whether this is true or not,
> > depends on several unknown factors, like the rate of keyboard
> > auto-repeat on the user's machine vs the time it takes Emacs on that
> > machine, with that CPU and display type/toolkit to perform
> > redisplay.
> >
> > In my experience, movement with C-n gives Emacs enough time to
> > update the display.
> 
> The last time I looked, this thread was about Emacs not being fast
> enough to update the display.

Maybe it was, I just am not sure.  Richard said "C-n is very slow" and
gave an example of invoking C-n with a large numeric argument.  The
example would cause only one redisplay: at the end of movement,
regardless of the rate input is coming in.  That is not the only
situation that jit-lock-defer-time was introduced to deal with, see
below.

> > jit-lock-defer-time non-nil works by disabling fontification
> > altogether until Emacs is idle.  If fontification is not disabled,
> > you yourself explained that vertical-motion _must_ fontify to keep
> > its calculations accurate.
> 
> It seems I am a complete failure at conveying my meaning.

Or I am a complete failure at understanding it.

> I was arguing for a setting where vertical-motion is allowed to keep
> its calculations inaccurate with regard to font locking.

And I was trying to say that AFAIK currently there's no reliable way
of deferring fontifications until just before the screen is redrawn.
What you suggest will perhaps work in the single example given by
Richard (and even then it requires some changes in the C code), but I
see difficulty applying it to other situations.  For example, consider
the case where I press and hold C-v (a not-so-uncommon way of paging
quickly through a large buffer): with your suggestion, unless Emacs
never redraws a screen until I lift my fingers (a rare case with a
reasonably fast machine and reasonably sized windows), the paging
would be as slow as with jit-lock-defer-time set to nil, while setting
it to something like 0.2 would make paging as fast as without font
lock.

In other words, the fact that Emacs becomes idle is a clear sign that
the screen was updated and the displayed text must now be fontified.
In your suggestion, what would be such a clear sign?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]