From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Naohiro Aota Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3904: 23.1.50; [PATCH] keyboard translating with timer doesn't work well Date: Thu, 23 Jul 2009 03:02:51 +0900 Message-ID: <87ws6038ac.fsf@elisp.net> Reply-To: Naohiro Aota , 3904@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248320823 4957 80.91.229.12 (23 Jul 2009 03:47:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2009 03:47:03 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 23 05:46:56 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MTpGh-0001jt-EE for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Jul 2009 05:46:55 +0200 Original-Received: from localhost ([127.0.0.1]:45088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTpGg-00082B-Tc for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jul 2009 23:46:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTgNm-0003ZJ-M9 for bug-gnu-emacs@gnu.org; Wed, 22 Jul 2009 14:17:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTgNg-0003YH-QX for bug-gnu-emacs@gnu.org; Wed, 22 Jul 2009 14:17:38 -0400 Original-Received: from [199.232.76.173] (port=54257 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTgNg-0003Y7-E6 for bug-gnu-emacs@gnu.org; Wed, 22 Jul 2009 14:17:32 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35457) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTgNf-000504-Sh for bug-gnu-emacs@gnu.org; Wed, 22 Jul 2009 14:17:32 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6MIHTei005466; Wed, 22 Jul 2009 11:17:29 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6MI55Rw002635; Wed, 22 Jul 2009 11:05:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Naohiro Aota Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 22 Jul 2009 18:05:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3904 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12482857892152 (code B ref -1); Wed, 22 Jul 2009 18:05:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 22 Jul 2009 18:03:09 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6MI34qG002145 for ; Wed, 22 Jul 2009 11:03:06 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:53171) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MTg9f-0002af-VG for emacs-pretest-bug@gnu.org; Wed, 22 Jul 2009 14:03:04 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MTg9d-0001BJ-DS for emacs-pretest-bug@gnu.org; Wed, 22 Jul 2009 14:03:02 -0400 Original-Received: from s318.xrea.com ([125.53.25.46]:56407) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MTg9c-00019F-5R for emacs-pretest-bug@gnu.org; Wed, 22 Jul 2009 14:03:00 -0400 Original-Received: (qmail 18951 invoked by uid 89); 23 Jul 2009 03:02:54 +0900 Original-Received: from zaq3a55f27d.zaq.ne.jp (HELO yue.localnetwork) (naota@elisp.net@58.85.242.125) by 192.168.1.46 with SMTP; 23 Jul 2009 03:02:54 +0900 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 22 Jul 2009 14:17:37 -0400 X-Mailman-Approved-At: Wed, 22 Jul 2009 23:46:47 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29564 gmane.emacs.pretest.bugs:24831 Archived-At: I found evaluating the following code outputs "abbbbb ...", and M-x view-lossage after that shows "b b b b b ...". (progn (keyboard-translate ?a ?b) (push ?a unread-command-events) (setq my-timer (run-with-idle-timer 1 t (lambda () (push ?a unread-command-events))))) This result suggests three problems. 1. If a timer handler function uses `sit-for' (or any function push a key to `unread-command-events'), the key would be translated once more. 2. idle-timer function should run "only once for each time Emacs becomes idle", but it seems the above function is called so many times. 3. `view-lossage' shouldn't show such stroke: "b b b b b ...". I don't know this is the right way, but it seems the patch below solves all the problem above. --8<---------------cut here---------------start------------->8--- Index: src/keyboard.c =================================================================== RCS file: /sources/emacs/emacs/src/keyboard.c,v retrieving revision 1.1008 diff -c -r1.1008 keyboard.c *** src/keyboard.c 3 Jul 2009 11:07:11 -0000 1.1008 --- src/keyboard.c 22 Jul 2009 17:20:11 -0000 *************** *** 2988,2993 **** --- 2988,2994 ---- { c = XCAR (Vunread_command_events); Vunread_command_events = XCDR (Vunread_command_events); + goto reread_for_input_method; } /* Read something from current KBOARD's side queue, if possible. */ --8<---------------cut here---------------end--------------->8--- 2009-07-22 Naohiro Aota * keyboard.c (read_char): When event set by a timer, sentinel or filter, skip keyboard translating and key recording. Regards,