emacs-devel
[Top][All Lists]
Advanced

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

Re: How to know if a key is pressed without getting it?


From: Lennart Borgman
Subject: Re: How to know if a key is pressed without getting it?
Date: Mon, 27 Sep 2010 01:25:02 +0200

On Mon, Sep 27, 2010 at 1:11 AM, Stefan Monnier
<address@hidden> wrote:
>> The problem that I'm trying to fix is an specific slow down in whitespace
>> when user holds space key pressed at end of a line. The slow down is caused
>> by whitespace which call jit-font-lock-refontify each time the user press
>> a space at end of line. If it is possible to detect that user is still
>> pressing a key, I could fix the slow down by not calling
>> jit-font-lock-refontify while user is pressing a key.
>
> Calling it without any BEG and END args is a bad idea for something that
> can run at each key press.
>
> You could try to check input-pending-p, but note that the pending input
> may end up not running any command, so you may end up with a display in
> an incorrect state for an unlimited amount of time, since the next
> post-command-hook may not be run for the same unlimited amount of time.

Running it in an idle timer?



reply via email to

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