From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: How to know if a key is pressed without getting it? Date: Sun, 26 Sep 2010 19:41:29 -0300 Message-ID: <4C9FCC19.5020804@ig.com.br> References: <4C9F609A.8010303@ig.com.br> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285540693 15622 80.91.229.12 (26 Sep 2010 22:38:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Sep 2010 22:38:13 +0000 (UTC) Cc: "GNU Emacs \(devel\)" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 00:38:11 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzzrH-0006mK-EE for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 00:38:11 +0200 Original-Received: from localhost ([127.0.0.1]:57047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzzrG-0002IE-Ir for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2010 18:38:10 -0400 Original-Received: from [140.186.70.92] (port=36787 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzzrA-0002HN-KL for emacs-devel@gnu.org; Sun, 26 Sep 2010 18:38:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ozzr9-0000PQ-AA for emacs-devel@gnu.org; Sun, 26 Sep 2010 18:38:04 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:62093) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozzr9-0000PM-5V for emacs-devel@gnu.org; Sun, 26 Sep 2010 18:38:03 -0400 Original-Received: by ywl5 with SMTP id 5so2135371ywl.0 for ; Sun, 26 Sep 2010 15:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vqGkCIK867aMv11nfg044uX/IR8VotNAkjlXYw8XcW0=; b=LuR5EuBNBQTGo7fogpICBygIz8CZMH4a+aVwG19dHi7ljO8GjUaT2EtbtHYZW/N4Zs C7T4VgSvjII6Sn58Ge1ZdWzkFfeEY0wd1SlgvdtwE1pSavJd6mrzLXD/TWcIksQoXzXv 7QN3xGqTfVJVesiQwF79eaVAi6O3npQwOj4eY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=bWgYmg4ENQqz2H55Ebu5wFSBdXVC1wygH/EAikRewP5s0hf7igRfKEkJjHLGC65VNO CGAh+2sxEKk536ICYCuCyqBNRHUmjp9gH1Ai8n/VcE2qIUHlhwCD68cfOk/X1kii2glR CZI8IBNq7xcPRWZU/g84fznF8wEKeTeOtIAUw= Original-Received: by 10.151.48.3 with SMTP id a3mr7926721ybk.427.1285540682466; Sun, 26 Sep 2010 15:38:02 -0700 (PDT) Original-Received: from [192.168.0.101] ([201.82.131.118]) by mx.google.com with ESMTPS id x3sm4684911ybl.10.2010.09.26.15.38.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Sep 2010 15:38:01 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130955 Archived-At: >> Does anyone know how to know if a key is pressed without getting it in Emacs >> (like kbhit like function)? >> > I don't know kbhit, so I'm not sure what you're asking. > But it sounds like something that can't be done right, so if you give us > a more general description of the problem at hand, we may be able to > suggest a different solution. The kbhit (keyboard hit) is a function that returns true if a key was pressed. This function is used in Windows but there is also kbhit implementation for GNU/Linux. 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. BTW, calling jit-font-lock-refontify in Emacs 22 didn't cause any slow down, but this happens in Emacs 23 and 24. Probably jit-font-lock-refontify or some part of font-lock was modified in Emacs 23.