From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6256: 24.0.50; read-event in `repeat' command Date: Wed, 20 Oct 2010 11:47:49 -0400 Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1287593998 4674 80.91.229.12 (20 Oct 2010 16:59:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2010 16:59:58 +0000 (UTC) Cc: 6256@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 20 18:59:56 2010 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.69) (envelope-from ) id 1P8c13-0006Pb-RM for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 18:59:54 +0200 Original-Received: from localhost ([127.0.0.1]:36921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8c12-00067n-Nb for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 12:59:52 -0400 Original-Received: from [140.186.70.92] (port=40731 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8bqd-0001Pr-Vi for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:49:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8bHK-0004xV-Sm for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:12:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8bHK-0004xR-RK for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:12:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P8aqd-00057i-4a; Wed, 20 Oct 2010 11:45:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Oct 2010 15:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6256-submit@debbugs.gnu.org id=B6256.128758944419665 (code B ref 6256); Wed, 20 Oct 2010 15:45:03 +0000 Original-Received: (at 6256) by debbugs.gnu.org; 20 Oct 2010 15:44:04 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8apf-000578-HK for submit@debbugs.gnu.org; Wed, 20 Oct 2010 11:44:03 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8apd-00056m-BT for 6256@debbugs.gnu.org; Wed, 20 Oct 2010 11:44:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An8KANKrvkxMCpO7/2dsb2JhbACgYHpyv0WFSgSSGw X-IronPort-AV: E=Sophos;i="4.57,356,1283745600"; d="scan'208";a="80222473" Original-Received: from 76-10-147-187.dsl.teksavvy.com (HELO ceviche.home) ([76.10.147.187]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 20 Oct 2010 11:47:49 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 1E2A966112; Wed, 20 Oct 2010 11:47:49 -0400 (EDT) In-Reply-To: <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> (Drew Adams's message of "Tue, 19 Oct 2010 15:17:45 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 20 Oct 2010 11:45:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:41011 Archived-At: > I tried debugging it that way. I added this just after the (let ((evt > (read-key))), that is BEFORE the `and' test of the `while': > (message "EVT: %S, R-R-CHAR: %S" evt repeat-repeat-char) That sounds right. > And because it exits immediately _no_ debug message appears in *Messages*. That's very odd. > That tells me that it exited during `read-key', not > because the event/key tested did not match (`while' test = nil). That's one possibility, indeed, tho maybe the code never gets to read-key at all. > Apparently `read-key' itself exits out to the `unwind-protect' > protection code in this scenario. That's only if it signals an error, which you should then see somewhere. > In emacs -Q, however, with just the Bookmark+ files loaded, I do not > see the problem. That is presumably what you are seeing. Indeed. So it does work for you in Emacs-23, tho only for the case of "emacs -Q"? If so, you may want to try and do the binary-search dance on your .emacs to see what's interfering. > Perhaps you can suggest something I can do to determine what is > happening that causes it (presumably) to exit the `while' during the > `read-key', jumping out to the `unwind-protect'. Is there some debug > message I can put at the beginning of the the `unwind-protect' > protection code to see what happened? Can I put some debug stuff into > `read-key'? You can start by adding various `message' calls around the while, inside the while, around the read-key call, etc... Using edebug in this code is sadly problematic, so we're left with print-debugging. > You still have not said anything about what's wrong with that solution. It does not work for me (i.e. for X11 mouse wheel events). > Again (coming back to my question), this is what I suggested: > (while (let ((evt (read-event))) > (and (equal (event-basic-type evt) > (event-basic-type repeat-repeat-char)) > (equal (event-modifiers evt) > (event-modifiers repeat-repeat-char)))) > (repeat repeat-arg)) You could also try (while (let ((evt (read-event))) (message "EVT: %S, R-R-CHAR: %S" evt repeat-repeat-char) (and (equal (event-basic-type evt) (event-basic-type repeat-repeat-char)) (equal (event-modifiers evt) (event-modifiers repeat-repeat-char)))) (repeat repeat-arg)) > It's pretty simple. It also seems logical, and it says just what we > want to be done: if the event's components are all the same as before > then repeat. Dunno why you have a problem with this. What problems > do you see with this approach? That on X11, the second event is *not* the same as the first because mouse wheel send first a down and then an up event. Stefan