From debbugs-submit-bounces@debbugs.gnu.org Mon May 24 11:12:42 2010 Received: (at submit) by debbugs.gnu.org; 24 May 2010 15:12:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGZKc-00026A-AZ for submit@debbugs.gnu.org; Mon, 24 May 2010 11:12:42 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGZKZ-000265-8M for submit@debbugs.gnu.org; Mon, 24 May 2010 11:12:40 -0400 Received: from lists.gnu.org ([199.232.76.165]:53885) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OGZKU-0007u8-93 for submit@debbugs.gnu.org; Mon, 24 May 2010 11:12:34 -0400 Received: from [140.186.70.92] (port=60303 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGZKR-0003Wm-8T for bug-gnu-emacs@gnu.org; Mon, 24 May 2010 11:12:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGZKP-0007lr-9m for bug-gnu-emacs@gnu.org; Mon, 24 May 2010 11:12:31 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:43118) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGZKO-0007lV-MI for bug-gnu-emacs@gnu.org; Mon, 24 May 2010 11:12:29 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4OFCLJD004748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 May 2010 15:12:24 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4O80bQC008442 for ; Mon, 24 May 2010 15:12:10 GMT Received: from abhmt015.oracle.com by acsmt354.oracle.com with ESMTP id 262668871274713874; Mon, 24 May 2010 08:11:14 -0700 Received: from dradamslap1 (/141.144.160.26) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 May 2010 08:11:10 -0700 From: "Drew Adams" To: Subject: 24.0.50; read-event in `repeat' command Date: Mon, 24 May 2010 08:11:37 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Thread-Index: Acr7U2eLNMl3f5XOTxOtwKcH93l1zw== X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090202.4BFA9759.00F3:SCFMA922111,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-05-23 on G41R2F1 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/xpm/include' I use popup frames a lot. By default, that is how a buffer gets displayed in my setup. I'm also on MS Windows, which has the property that a newly created frame is always selected (obtains the focus). This means that displaying a buffer is different, depending on whether its frame already exists. If it does, then the focus (typically) does not change to the buffer's frame. If it does not, then the focus moves there. I work around this focus-grabbing annoyance sometimes by using `select-frame-set-input-focus' at appropriate places. (Ugh!) Anyway, the problem I have is with the `repeat' command. Presumably, it tries to be sensitive to actual user events, such as typing a character, but ignore other, non-user events. This does not work for me in some cases - an automatic `switch-frame' event is causing it to stop repeating. I have a command that displays a buffer in its own frame (the same frame or another, possibly new, frame). I make it repeatable using `repeat', and I bind it to a key, say `f'. That works fine in general: hitting `f f f...' continues to display buffers - in new frames or existing frames. No problem. But in some cases my command also pops up an additional buffer, in another frame. In those cases the repetition breaks as soon as that second buffer is displayed. Hitting `f' at that point just inserts an `f' character (in that buffer if it was selected, else in the first buffer displayed by `f'). It does not matter whether the second buffer and its frame already exist or not. I mentioned the frame focus above, but that is apparently not the problem. It does not matter whether the `f' command opens the first buffer in a new frame or an existing frame, and likewise for the second buffer. And it does not matter whether the second buffer is selected (and its frame focused) or not. It is only when hitting `f' opens also a second buffer that a subsequent `f' just inserts. However, if I make a copy of the definition of command `repeat' and change only its `read-event' to `read-char-exclusive', then the problem goes away. So some event being read is being tested and found to be different from the `f' last input event, thus ending the repetition. I'm guessing that this is what happens: The `read-event' reads the `f' and repeats the command, which displays the first and second buffers. I would think there would be a `switch-frame' event associated with each buffer display, but maybe not. In any case, if there is a `switch-frame' for the first buffer display it is ignored, but the `switch-frame' for the second buffer display causes repetition to stop. It is difficult to use the debugger with `repeat', so I copied the code and inserted a call to `message' after the `read-event'. It shows clearly that display of the second buffer causes the event read to be a `switch-frame'. Do we intentionally use `read-event' here (instead of `read-char-exclusive') in order to let `repeat' work with other user events besides just char input (e.g. mouse clicks)? If so, then changing `read-event' to `read-char-exclusive' would not be the correct fix, but what would? This is not clear to me. `read-event' has been present in this code since at least Emacs 20, but this code does not correctly handle `switch-frame' events. Real user events need to be distinguished from events such as `switch-frame' that can be generated by code. Is changing `read-event' to `read-char-exclusive' the proper fix for this bug? It works for me. If it is not the right fix, then what is? If it is important for some use reason to keep `read-event', and no fix is found that would DTRT to distinguish real user events from events such as `switch-frame', then could we at least use `(funcall repeat-read-function)' instead of `(read-event)', so that code that wants to be sensitive to only char events can bind `repeat-read-function' to `read-char-exclusive' around the call to `repeat'? The default value of such a var could be `read-event', if that's deemed the best default, but we at least need some way to make `repeat' ignore non-char events (if we cannot find a way to make it ignore non-user events). From debbugs-submit-bounces@debbugs.gnu.org Mon May 24 12:28:51 2010 Received: (at 6256) by debbugs.gnu.org; 24 May 2010 16:28:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGaWI-0002gM-PP for submit@debbugs.gnu.org; Mon, 24 May 2010 12:28:50 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGaWG-0002gH-2R for 6256@debbugs.gnu.org; Mon, 24 May 2010 12:28:48 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4OGSeJ3029612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <6256@debbugs.gnu.org>; Mon, 24 May 2010 16:28:42 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4OCFm49029339 for <6256@debbugs.gnu.org>; Mon, 24 May 2010 16:28:39 GMT Received: from abhmt021.oracle.com by acsmt354.oracle.com with ESMTP id 262972221274718517; Mon, 24 May 2010 09:28:37 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 May 2010 09:28:37 -0700 From: "Drew Adams" To: <6256@debbugs.gnu.org> References: Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Mon, 24 May 2010 09:28:36 -0700 Message-ID: <058F2FC300154C1AB894694655B2A968@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Thread-Index: Acr7U2eLNMl3f5XOTxOtwKcH93l1zwACiewg X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090208.4BFAA93A.00B1:SCFMA922111,ss=1,fgs=0 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: 6256 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) > Is changing `read-event' to `read-char-exclusive' the proper > fix for this bug? It works for me. If it is not the right fix, > then what is? > > If it is important for some use reason to keep `read-event', > and no fix is found that would DTRT to distinguish real user > events from events such as `switch-frame', then could we at > least use `(funcall repeat-read-function)' instead of > `(read-event)', so that code that wants to be sensitive to > only char events can bind `repeat-read-function' to > `read-char-exclusive' around the call to `repeat'? > > The default value of such a var could be `read-event', if > that's deemed the best default, but we at least need some > way to make `repeat' ignore non-char events > (if we cannot find a way to make it ignore non-user events). Actually, I think that using `read-char-exclusive' is the right fix. If the action were initiated by a mouse event it is unlikely that the next event would be the same mouse event, so repetition would not occur anyway. Could you please make this fix: replace the unique occurrence of `read-event' by `read-char-exclusive' in `repeat'. Thx. From debbugs-submit-bounces@debbugs.gnu.org Mon May 24 19:05:38 2010 Received: (at 6256) by debbugs.gnu.org; 24 May 2010 23:05:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGgiH-0005gv-Vu for submit@debbugs.gnu.org; Mon, 24 May 2010 19:05:38 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGgiG-0005gq-15 for 6256@debbugs.gnu.org; Mon, 24 May 2010 19:05:36 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4ON5SO5019202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <6256@debbugs.gnu.org>; Mon, 24 May 2010 23:05:30 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4ON5PQ5022721 for <6256@debbugs.gnu.org>; Mon, 24 May 2010 23:05:26 GMT Received: from abhmt001.oracle.com by acsmt354.oracle.com with ESMTP id 264050171274742325; Mon, 24 May 2010 16:05:25 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 May 2010 16:05:25 -0700 From: "Drew Adams" To: <6256@debbugs.gnu.org> References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Mon, 24 May 2010 16:05:27 -0700 Message-ID: <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <058F2FC300154C1AB894694655B2A968@us.oracle.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Thread-Index: Acr7U2eLNMl3f5XOTxOtwKcH93l1zwACiewgAAJNsGA= X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090203.4BFB063A.0123:SCFMA922111,ss=1,fgs=0 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: 6256 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) > > Is changing `read-event' to `read-char-exclusive' the proper > > fix for this bug? It works for me. If it is not the right fix, > > then what is? > > > > If it is important for some use reason to keep `read-event', > > and no fix is found that would DTRT to distinguish real user > > events from events such as `switch-frame', then could we at > > least use `(funcall repeat-read-function)' instead of > > `(read-event)', so that code that wants to be sensitive to > > only char events can bind `repeat-read-function' to > > `read-char-exclusive' around the call to `repeat'? > > > > The default value of such a var could be `read-event', if > > that's deemed the best default, but we at least need some > > way to make `repeat' ignore non-char events > > (if we cannot find a way to make it ignore non-user events). > > Actually, I think that using `read-char-exclusive' is the > right fix. If the > action were initiated by a mouse event it is unlikely that > the next event would > be the same mouse event, so repetition would not occur anyway. > > Could you please make this fix: replace the unique occurrence > of `read-event' by `read-char-exclusive' in `repeat'. Thx. I take it back. `read-char-exclusive' is not the right fix, because not all keyboard events are character events. Hitting the key `left', for instance, does not work. And in fact, I do not seem to be able to reproduce the problem anymore in Emacs 23. (It does occur in Emacs 22.3, however.) Sorry for the noise. So I guess this bug could be closed. But I still wonder if the code shouldn't be tweaked somehow to read an event but ignore non-user (or at least non-keyboard) events. I don't know how to do that. Before closing, it would be great if someone knowledgable would reply with some info about the question. Thx. From debbugs-submit-bounces@debbugs.gnu.org Mon May 24 20:06:58 2010 Received: (at 6256) by debbugs.gnu.org; 25 May 2010 00:06:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGhfd-00065X-Qo for submit@debbugs.gnu.org; Mon, 24 May 2010 20:06:58 -0400 Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGhfb-00065S-Oj for 6256@debbugs.gnu.org; Mon, 24 May 2010 20:06:56 -0400 Received: by gwj15 with SMTP id 15so929118gwj.3 for <6256@debbugs.gnu.org>; Mon, 24 May 2010 17:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=aye3RWzAqfUGGU12XPrLgjp++xCISwOVQYKYlosO1/s=; b=mHmhtv2jcKuORsf0qM/9kFbJ8qM0zRzCon8Eg52g8L16bPAxx9Rv1SCSxBrisKrlI+ 8NGThO1jWjdSFb+eyraXBFWNWIqFkwuEp15q+c53UScKNEEKuCyPTsCwYEi6R1gSqbHs 7bZIWWSyQHVhqnvdeOu26WMMC311/OesvgFXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=PPDWNbtgzwhTvZiLq5qDQDm0OOoCZMv25O5+JKy4kBtm9ah/qV3TCC8hQdqgI3GBNS KpaUEy+EybB9WJglnYqOw3zPk0QDBfDRQq8V+2FlQIaYZWLAJqyWpEqHT1yJ6TNcV/9x HfQfl6lw434mZE9eQqq9u9bvOJiu50BTpR+58= Received: by 10.101.202.2 with SMTP id e2mr6859972anq.269.1274746011444; Mon, 24 May 2010 17:06:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.177.20 with HTTP; Mon, 24 May 2010 17:06:31 -0700 (PDT) In-Reply-To: <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> From: Lennart Borgman Date: Tue, 25 May 2010 02:06:31 +0200 Message-ID: Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command To: Drew Adams Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) On Tue, May 25, 2010 at 1:05 AM, Drew Adams wrote: > > So I guess this bug could be closed. =C2=A0But I still wonder if the code= shouldn't > be tweaked somehow to read an event but ignore non-user (or at least > non-keyboard) events. =C2=A0I don't know how to do that. After a quick look I guess it does that. However the switch-frame event is a bit special. The handling of it is delayed in keyboard.c. I guess what you have seen is the result of that something has gone wrong because of that (but I am not sure). Maybe this has been fixed in 23.2? From debbugs-submit-bounces@debbugs.gnu.org Mon May 24 22:41:32 2010 Received: (at 6256) by debbugs.gnu.org; 25 May 2010 02:41:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGk5E-0007Gt-8X for submit@debbugs.gnu.org; Mon, 24 May 2010 22:41:32 -0400 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 1OGk5B-0007Go-O0 for 6256@debbugs.gnu.org; Mon, 24 May 2010 22:41:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAF7V+ktFpZMM/2dsb2JhbACdeXK+AoUTBIw/ X-IronPort-AV: E=Sophos;i="4.53,295,1272859200"; d="scan'208";a="64966380" Received: from 69-165-147-12.dsl.teksavvy.com (HELO pastel.home) ([69.165.147.12]) by ironport2-out.pppoe.ca with ESMTP; 24 May 2010 22:41:25 -0400 Received: by pastel.home (Postfix, from userid 20848) id 49E948267; Mon, 24 May 2010 22:41:25 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Date: Mon, 24 May 2010 22:41:25 -0400 In-Reply-To: <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> (Drew Adams's message of "Mon, 24 May 2010 16:05:27 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > I take it back. `read-char-exclusive' is not the right fix, because not all > keyboard events are character events. Hitting the key `left', for instance, > does not work. I think the real answer is that both read-event and read-char-exclusive are the wrong answer. A better answer would be to have some way to change the way the next key is handled. Something like a `next-key-map', kind of like the overriding maps, except that it would be automatically reset before running a command (and it would not disable the other keymaps, only take precedence over them). Basically calling read-event and friends and then putting it back onto the unread-command-events list is almost always wrong in one way or another (e.g. it postpones running post-command-hook). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 17:25:35 2010 Received: (at 6256) by debbugs.gnu.org; 3 Jul 2010 21:25:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVADP-0002Eo-B3 for submit@debbugs.gnu.org; Sat, 03 Jul 2010 17:25:35 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVADN-0002Ei-Ej for 6256@debbugs.gnu.org; Sat, 03 Jul 2010 17:25:33 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o63LPQwe011852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 3 Jul 2010 21:25:28 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o63KEV8g003046; Sat, 3 Jul 2010 21:25:25 GMT Received: from abhmt002.oracle.com by acsmt354.oracle.com with ESMTP id 379958351278192259; Sat, 03 Jul 2010 14:24:19 -0700 Received: from dradamslap1 (/141.144.160.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 03 Jul 2010 14:24:19 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 3 Jul 2010 14:24:23 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acr7s8ZpR7Xtnga5STa6MhyZLb0idQfP1Bzg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4C2FAAC6.013B:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > I take it back. `read-char-exclusive' is not the right > > fix, because not all keyboard events are character events. > > Hitting the key `left', for instance, does not work. > > I think the real answer is that both read-event and > read-char-exclusive are the wrong answer. A better answer > would be to have some way to change the way the next key is > handled. Something like a `next-key-map', kind of like the > overriding maps, except that it would be automatically reset > before running a command (and it would not disable the other > keymaps, only take precedence over them). > > Basically calling read-event and friends and then putting it > back onto the unread-command-events list is almost always > wrong in one way or another (e.g. it postpones running > post-command-hook). I don't really understand the code very well, I admit. You obviously understand it and have an idea for how to improve things in a big way. It's not clear that that improvement is soon forthcoming, however. I assume that it might not be trivial or that you are busy doing other things. While waiting for the ideal fix, can we at least improve this incrementally to enable `repeat' to work as I would expect it to wrt, say, mouse events? For example, suppose I do this: (defun repeat-command (command) (let ((repeat-previous-repeated-command command) (repeat-message-function 'ignore) (last-repeatable-command 'repeat)) (repeat nil))) (defun foo-repeat (arg) (interactive "P") (repeat-command 'foo)) (define-key my-map (vector (list mouse-wheel-up-event)) 'foo-repeat) And suppose `my-map' is bound to `C-x p'. I would like for `C-x p' followed by repeated mouse-wheel-up events to repeat command `foo'. That does not happen, however, because of this restrictive `eq' test in the definition of function `repeat': (while (eq (read-event) repeat-repeat-char) (repeat repeat-arg)) The event read will be something like this, for the wheel action: (wheel-down (# 2051 (118 . 176) 158455015 nil 2051 (59 . 40) nil (26 . 2) (2 . 4))) I would think that we would want to change the test to this, or similar: (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)) And that seems to work OK. What do you think - is it reasonable to do that? It seems like a win, to me (nothing lost, something gained). But perhaps I'm missing something. It seems to me that what we want is to check whether the same user event occurred, and for complex events such as mouse events we would typically just want the same event type with the same modifiers. Please let me know what you think. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 09:17:41 2010 Received: (at 6256) by debbugs.gnu.org; 5 Jul 2010 13:17:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVlYL-0002qw-AU for submit@debbugs.gnu.org; Mon, 05 Jul 2010 09:17:41 -0400 Received: from drizzle.cc.mcgill.ca ([132.206.27.48]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVlYJ-0002qr-Hx for 6256@debbugs.gnu.org; Mon, 05 Jul 2010 09:17:40 -0400 Received: from mailscan3.ncs.mcgill.ca (mailscan3.NCS.McGill.CA [132.216.77.250]) by drizzle.cc.mcgill.ca (8.12.11.20060308/8.12.3) with ESMTP id o65DHY2V023156; Mon, 5 Jul 2010 09:17:34 -0400 Received: from mailscan3.ncs.mcgill.ca (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 5F53B5E46; Mon, 5 Jul 2010 09:17:34 -0400 (EDT) Received: from alfajor.home (vpn87205.VPN.McGill.CA [132.216.87.205]) by mailscan3.ncs.mcgill.ca (Postfix) with ESMTP id 06FCA5DA0; Mon, 5 Jul 2010 09:17:33 -0400 (EDT) Received: by alfajor.home (Postfix, from userid 20848) id 9F71CBB542; Mon, 5 Jul 2010 00:45:37 +0200 (CEST) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Date: Mon, 05 Jul 2010 00:45:37 +0200 In-Reply-To: (Drew Adams's message of "Sat, 3 Jul 2010 14:24:23 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2010.6.9.160619 X-McGill-WhereFrom: Internal X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) > That does not happen, however, because of this restrictive `eq' test in the > definition of function `repeat': > (while (eq (read-event) repeat-repeat-char) > (repeat repeat-arg)) > The event read will be something like this, for the wheel action: > (wheel-down (# 2051 (118 . 176) 158455015 nil > 2051 (59 . 40) nil (26 . 2) (2 . 4))) > I would think that we would want to change the test to this, or similar: > (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)) > And that seems to work OK. What do you think - is it reasonable to do > that? That sounds right, yes, People, feel free to make such a change, Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 07 10:49:16 2010 Received: (at 6256) by debbugs.gnu.org; 7 Jul 2010 14:49:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWVw4-0005i5-Fn for submit@debbugs.gnu.org; Wed, 07 Jul 2010 10:49:16 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWVw2-0005i0-8I for 6256@debbugs.gnu.org; Wed, 07 Jul 2010 10:49:14 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o67En6V7015956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Jul 2010 14:49:08 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o67BCibk020828; Wed, 7 Jul 2010 14:48:58 GMT Received: from abhmt008.oracle.com by acsmt354.oracle.com with ESMTP id 406162791278513785; Wed, 07 Jul 2010 07:43:05 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 07 Jul 2010 07:43:05 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Wed, 7 Jul 2010 07:43:04 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcscRHQEwJCjutjjS+SkaFc6VdP/jgBnjHiA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4C3493E2.007A:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > People, feel free to make such a change, I hope someone will. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 11:54:10 2010 Received: (at 6256) by debbugs.gnu.org; 21 Jul 2010 15:54:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObbcY-0006fD-Af for submit@debbugs.gnu.org; Wed, 21 Jul 2010 11:54:10 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObbcV-0006f7-U4 for 6256@debbugs.gnu.org; Wed, 21 Jul 2010 11:54:08 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o6LFsWlv022027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Jul 2010 15:54:33 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o6LCZXp8001557; Wed, 21 Jul 2010 15:54:30 GMT Received: from abhmt001.oracle.com by acsmt354.oracle.com with ESMTP id 446156901279727656; Wed, 21 Jul 2010 08:54:16 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Jul 2010 08:54:16 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Wed, 21 Jul 2010 08:54:16 -0700 Message-ID: <3A1AD3748A994BD8B39DD742EB6D5BE1@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcscRHQEwJCjutjjS+SkaFc6VdP/jgMqFS1A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4C471838.0136:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > From: Stefan Monnier Sent: Sunday, July 04, 2010 3:46 PM > That sounds right, yes, > People, feel free to make such a change, Could someone please commit this change? Thx. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 28 11:19:14 2010 Received: (at 6256) by debbugs.gnu.org; 28 Aug 2010 15:19:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OpNBa-0001RB-1V for submit@debbugs.gnu.org; Sat, 28 Aug 2010 11:19:14 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OpNBY-0001R5-Pc for 6256@debbugs.gnu.org; Sat, 28 Aug 2010 11:19:13 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o7SFKg7k026802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 28 Aug 2010 15:20:43 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o7SFKeGU015683; Sat, 28 Aug 2010 15:20:41 GMT Received: from abhmt012.oracle.com by acsmt355.oracle.com with ESMTP id 557080051283008756; Sat, 28 Aug 2010 08:19:16 -0700 Received: from dradamslap1 (/10.159.221.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 28 Aug 2010 08:19:15 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <3A1AD3748A994BD8B39DD742EB6D5BE1@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 28 Aug 2010 08:19:18 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <3A1AD3748A994BD8B39DD742EB6D5BE1@us.oracle.com> Thread-Index: AcscRHQEwJCjutjjS+SkaFc6VdP/jgMqFS1AB3XdEKA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > From: Stefan Monnier Sent: Sunday, July 04, 2010 3:46 PM > > That sounds right, yes, > > People, feel free to make such a change, > > Could someone please commit this change? Thx. ping From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 11 14:23:29 2010 Received: (at 6256) by debbugs.gnu.org; 11 Sep 2010 18:23:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuUjZ-0000u4-Fl for submit@debbugs.gnu.org; Sat, 11 Sep 2010 14:23:29 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuUjW-0000tl-UR for 6256@debbugs.gnu.org; Sat, 11 Sep 2010 14:23:27 -0400 Received: from IMPmailhost1.adm.correo ([10.20.102.38]) by IMPaqm1.telefonica.net with bizsmtp id 5W2b1f00y0piX6q01WRYeN; Sat, 11 Sep 2010 20:25:32 +0200 Received: from ceviche.home ([83.61.39.212]) by IMPmailhost1.adm.correo with BIZ IMP id 5WRW1f0074aeRwb1hWRW6v; Sat, 11 Sep 2010 20:25:32 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 497D1660D2; Sat, 11 Sep 2010 20:25:30 +0200 (CEST) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Date: Sat, 11 Sep 2010 20:25:30 +0200 In-Reply-To: (Drew Adams's message of "Sat, 3 Jul 2010 14:24:23 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > And suppose `my-map' is bound to `C-x p'. I would like for `C-x p' > followed by repeated mouse-wheel-up events to repeat command `foo'. > That does not happen, however, because of this restrictive `eq' test in the > definition of function `repeat': > (while (eq (read-event) repeat-repeat-char) > (repeat repeat-arg)) > The event read will be something like this, for the wheel action: > (wheel-down (# 2051 (118 . 176) 158455015 nil > 2051 (59 . 40) nil (26 . 2) (2 . 4))) I installed the patch below in the emacs-23 branch (it seemed slightly safer than your version of the code). Please confirm that it fixes your problem, Stefan === modified file 'lisp/repeat.el' --- lisp/repeat.el 2010-01-13 08:35:10 +0000 +++ lisp/repeat.el 2010-09-11 18:20:32 +0000 @@ -335,7 +335,12 @@ (setq real-last-command 'repeat) (setq repeat-undo-count 1) (unwind-protect - (while (eq (read-event) repeat-repeat-char) + (while (let ((evt (read-event))) ;FIXME: read-key maybe? + ;; For clicks, we need to strip the meta-data to + ;; check the underlying event name. + (eq (or (car-safe evt) evt) + (or (car-safe repeat-repeat-char) + repeat-repeat-char))) (repeat repeat-arg)) ;; Make sure `repeat-undo-count' is reset. (setq repeat-undo-count nil)) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 11 18:33:44 2010 Received: (at 6256) by debbugs.gnu.org; 11 Sep 2010 22:33:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuYdk-0007uf-Do for submit@debbugs.gnu.org; Sat, 11 Sep 2010 18:33:44 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuYdi-0007uR-I4 for 6256@debbugs.gnu.org; Sat, 11 Sep 2010 18:33:43 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8BMZlXK020598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 11 Sep 2010 22:35:49 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8B6owKU030845; Sat, 11 Sep 2010 22:35:47 GMT Received: from abhmt005.oracle.com by acsmt353.oracle.com with ESMTP id 597248351284244481; Sat, 11 Sep 2010 15:34:41 -0700 Received: from dradamslap1 (/10.159.221.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Sep 2010 15:34:41 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 11 Sep 2010 15:34:36 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActR3rpHr0fp0OUMQJKM/Re1iu6XLgAIRC+g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Thanks for trying, but no, unfortunately it does not work. I tested your patch using this release: GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600) of 2010-05-08 on G41R2F1 And I can confirm that the code I suggested does work. > From: Stefan Monnier Sent: Saturday, September 11, 2010 11:26 AM > > And suppose `my-map' is bound to `C-x p'. I would like for `C-x p' > > followed by repeated mouse-wheel-up events to repeat command `foo'. > > > That does not happen, however, because of this restrictive > > `eq' test in the definition of function `repeat': > > > (while (eq (read-event) repeat-repeat-char) > > (repeat repeat-arg)) > > > The event read will be something like this, for the wheel action: > > (wheel-down (# 2051 (118 . 176) 158455015 nil > > 2051 (59 . 40) nil (26 . 2) (2 . 4))) > > I installed the patch below in the emacs-23 branch (it seemed slightly > safer than your version of the code). > Please confirm that it fixes your problem, > + (while (let ((evt (read-event))) ;FIXME: read-key maybe? > + ;; For clicks, we need to strip the meta-data to > + ;; check the underlying event name. > + (eq (or (car-safe evt) evt) > + (or (car-safe repeat-repeat-char) > + repeat-repeat-char))) If you want to test for yourself, then: 1. Load the Bookmark+ files (see below). 2. Use C-x p RET at several places in a file to create some bookmarks. 3. Use C-x p ... (or ...) to cycle among the bookmarks. You will see a message showing the position at each bookmark visited. 4. Now try C-x p followed by repeated mouse-wheel down or up movements. You should see the same movement to each bookmark in turn, and the same position messages. With your code the wheel repetition does not work. With the code I sent it does work. This is the `while' condition I sent (again): (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)))) The Bookmark+ files are these (load in this order, after loading std library bookmark.el): bookmark+-mac.el bookmark+-bmu.el bookmark+-1.el bookmark+-lit.el bookmark+.el You can find the Bookmark+ files here (Emacs Wiki Elisp area): http://www.emacswiki.org/cgi-bin/wiki?action=index;match=%5C.(el%7Ctar)(%5C.gz)% 3F%24 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 12 12:05:24 2010 Received: (at 6256) by debbugs.gnu.org; 12 Sep 2010 16:05:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oup3U-00015M-IM for submit@debbugs.gnu.org; Sun, 12 Sep 2010 12:05:24 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oup3S-00015H-J7 for 6256@debbugs.gnu.org; Sun, 12 Sep 2010 12:05:23 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8CG7TRZ011500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 12 Sep 2010 16:07:31 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8CG3JtI017440; Sun, 12 Sep 2010 16:07:28 GMT Received: from abhmt016.oracle.com by acsmt353.oracle.com with ESMTP id 597935771284307604; Sun, 12 Sep 2010 09:06:44 -0700 Received: from dradamslap1 (/10.159.220.107) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 12 Sep 2010 09:06:44 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Sun, 12 Sep 2010 09:06:38 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActR3rpHr0fp0OUMQJKM/Re1iu6XLgAIRC+gACUQaiA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > If you want to test for yourself, then: > > 1. Load the Bookmark+ files (see below). Forgot to mention that you will need to uncomment this code in bookmark+-1.el: ;; (define-key bookmark-map (vector (list mouse-wheel-up-event)) ;; 'bmkp-next-bookmark-this-buffer-repeat) ;; (define-key bookmark-map (vector (list mouse-wheel-down-event)) ;; 'bmkp-previous-bookmark-this-buffer-repeat) > 2. Use C-x p RET at several places in a file to create some bookmarks. > 3. Use C-x p ... (or ...) to cycle > among the bookmarks. You will see a message showing the position at > each bookmark visited. > > 4. Now try C-x p followed by repeated mouse-wheel down or up > movements. You should see the same movement to each bookmark > in turn, and the same position messages. With your code the wheel > repetition does not work. With the code I sent it does work. > This is the `while' condition I sent (again): > > (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)))) > > The Bookmark+ files are these (load in this order, after > loading std library bookmark.el): > > bookmark+-mac.el > bookmark+-bmu.el > bookmark+-1.el > bookmark+-lit.el > bookmark+.el > > You can find the Bookmark+ files here (Emacs Wiki Elisp area): > http://www.emacswiki.org/cgi-bin/wiki?action=index;match=%5C.(el%7Ctar)(%5C.gz)% 3F%24 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 16 23:32:03 2010 Received: (at 6256) by debbugs.gnu.org; 17 Sep 2010 03:32:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwRgA-0004gh-Rj for submit@debbugs.gnu.org; Thu, 16 Sep 2010 23:32:03 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwRg8-0004gJ-II for 6256@debbugs.gnu.org; Thu, 16 Sep 2010 23:32:01 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8H3YJbq005691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Sep 2010 03:34:21 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8H3Tmx9028152; Fri, 17 Sep 2010 03:34:19 GMT Received: from abhmt013.oracle.com by acsmt355.oracle.com with ESMTP id 611679961284694448; Thu, 16 Sep 2010 20:34:08 -0700 Received: from dradamslap1 (/10.159.220.112) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Sep 2010 20:34:07 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Thu, 16 Sep 2010 20:34:06 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: Thread-Index: ActR3rpHr0fp0OUMQJKM/Re1iu6XLgAIRC+gACUQaiAA4ULw8A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) ping From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 22 10:00:00 2010 Received: (at 6256) by debbugs.gnu.org; 22 Sep 2010 14:00:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyPrc-0001XB-Et for submit@debbugs.gnu.org; Wed, 22 Sep 2010 10:00:00 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyPrZ-0001X5-W9 for 6256@debbugs.gnu.org; Wed, 22 Sep 2010 09:59:58 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8ME2Qx5018154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 Sep 2010 14:02:28 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8MAVdB6029819; Wed, 22 Sep 2010 14:02:24 GMT Received: from abhmt018.oracle.com by acsmt353.oracle.com with ESMTP id 621020841285164119; Wed, 22 Sep 2010 07:01:59 -0700 Received: from dradamslap1 (/10.159.244.247) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Sep 2010 07:01:58 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: [PATCH] RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Wed, 22 Sep 2010 07:01:57 -0700 Message-ID: <827B91A0FC6E4AD98199FD26C72B17CE@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActR3rpHr0fp0OUMQJKM/Re1iu6XLgAIRC+gACUQaiAA4ULw8AERWTmQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) ping Please apply the patch (code) I sent (or equivalent that works). Thx. > From: Drew Adams Sent: Thursday, September 16, 2010 8:34 PM > > ping From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 25 10:27:52 2010 Received: (at 6256) by debbugs.gnu.org; 25 Sep 2010 14:27:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzVjE-0000Uo-L3 for submit@debbugs.gnu.org; Sat, 25 Sep 2010 10:27:52 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzVjC-0000Uj-R1 for 6256@debbugs.gnu.org; Sat, 25 Sep 2010 10:27:51 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8PEUVEQ031772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 25 Sep 2010 14:30:33 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8PAlb9v021863; Sat, 25 Sep 2010 14:30:28 GMT Received: from abhmt016.oracle.com by acsmt355.oracle.com with ESMTP id 629895371285425019; Sat, 25 Sep 2010 07:30:19 -0700 Received: from dradamslap1 (/10.159.219.31) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 25 Sep 2010 07:30:19 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <827B91A0FC6E4AD98199FD26C72B17CE@us.oracle.com> Subject: RE: bug#6256: [PATCH] RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 25 Sep 2010 07:30:21 -0700 Message-ID: <0780FAE3E461400D9820A9ACA8FE2766@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <827B91A0FC6E4AD98199FD26C72B17CE@us.oracle.com> Thread-Index: ActR3rpHr0fp0OUMQJKM/Re1iu6XLgAIRC+gACUQaiAA4ULw8AERWTmQAJeF1yA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) ping. I sent a fix for this in May 2010. Stefan, you agreed (in July) with the fix I sent. You said: "That sounds right, yes. People, feel free to make such a change." We waited for someone to commit it. No one did. In September you committed a different "fix" that does not work. Can you please commit the fix I sent, or at least something equivalent that actually fixes the bug? Thx. > > > People, feel free to make such a change > > > > Could someone please commit this change? Thx. > > ping > > ping From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 18 14:36:36 2010 Received: (at 6256) by debbugs.gnu.org; 18 Oct 2010 18:36:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P7uZY-0000KV-Ca for submit@debbugs.gnu.org; Mon, 18 Oct 2010 14:36:36 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P7uZW-0000KQ-M5 for 6256@debbugs.gnu.org; Mon, 18 Oct 2010 14:36:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjALANgxvExMCpO7/2dsb2JhbACgM3lywDKFSQSSGQ X-IronPort-AV: E=Sophos;i="4.57,345,1283745600"; d="scan'208";a="80036888" Received: from 76-10-147-187.dsl.teksavvy.com (HELO pastel.home) ([76.10.147.187]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 18 Oct 2010 14:40:17 -0400 Received: by pastel.home (Postfix, from userid 20848) id 60C8BA822C; Mon, 18 Oct 2010 14:40:17 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Date: Mon, 18 Oct 2010 14:40:17 -0400 In-Reply-To: (Drew Adams's message of "Sun, 12 Sep 2010 09:06:38 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >> If you want to test for yourself, then: >> 1. Load the Bookmark+ files (see below). It's not exactly self-contained and going through all those links to finally download each file is rather inconvenient. So in order to help me help you, in the future, please try and make it easier. E.g. with a single download, and then a single load-file. >> 4. Now try C-x p followed by repeated mouse-wheel down or up >> movements. You should see the same movement to each bookmark >> in turn, and the same position messages. With your code the wheel >> repetition does not work. Indeed it doesn't work. >> With the code I sent it does work. >> This is the `while' condition I sent (again): >> (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)))) But that doesn't work either in my tests: the problem is that the last-command-event was `mouse-4' (i.e. the up event) whereas read-event returns `down-mouse-4' (a subsequent read-event would return the `mouse-4'). For my case, replacing the read-event by `read-key' happens to make it work (see patch below). Please confirm whether or not it fixes it for you, and if it doesn't, please show me the values of `repeat-repeat-char' and `evt' in the above test. Stefan === modified file 'lisp/repeat.el' --- lisp/repeat.el 2010-09-11 18:23:45 +0000 +++ lisp/repeat.el 2010-10-18 18:34:24 +0000 @@ -335,7 +335,7 @@ (setq real-last-command 'repeat) (setq repeat-undo-count 1) (unwind-protect - (while (let ((evt (read-event))) ;FIXME: read-key maybe? + (while (let ((evt (read-key))) ;; For clicks, we need to strip the meta-data to ;; check the underlying event name. (eq (or (car-safe evt) evt) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 18 17:09:15 2010 Received: (at 6256) by debbugs.gnu.org; 18 Oct 2010 21:09:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P7wxG-0001Ud-R4 for submit@debbugs.gnu.org; Mon, 18 Oct 2010 17:09:15 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P7wxE-0001UV-KX for 6256@debbugs.gnu.org; Mon, 18 Oct 2010 17:09:13 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9ILCs66019061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 18 Oct 2010 21:12:56 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9IKk5uI019074; Mon, 18 Oct 2010 21:12:53 GMT Received: from abhmt010.oracle.com by acsmt354.oracle.com with ESMTP id 700073761287436347; Mon, 18 Oct 2010 14:12:27 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 18 Oct 2010 14:12:27 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Mon, 18 Oct 2010 14:12:30 -0700 Message-ID: <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: Thread-Index: Actu8+sQgWCbzEHHS4+GdOoZTkkMZAAEjtKw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > >> With the code I sent it does work. > >> This is the `while' condition I sent (again): > > >> (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)))) > > But that doesn't work either in my tests: the problem is that the > last-command-event was `mouse-4' (i.e. the up event) whereas > read-event returns `down-mouse-4' (a subsequent read-event would > return the `mouse-4'). No doubt that is a difference between Emacs on Windows and Emacs on GNU. BTW, the behavior you describe doesn't really seem very right for a mouse wheel: Why should the first wheel event be `down-'? I would think that `down-' would only be called for when you press the mouse wheel (as in mouse-2 clicking using the wheel). Whatever. Seems like the Emacs mouse-wheel behavior on Windows (the events) is generally superior to that on GNU. What about fixing the latter so that it comes up to speed? Another problem is that it precludes having `mouse-4' and `mouse-5' correspond to actual mouse buttons. On Windows I can make good use of those mouse buttons when I use a mouse that has them. Using `mouse-4' and 5 as stand-ins for the mouse wheel on GNU seems like an ugly workaround/hack. But I don't know the details/history. BTW - Don't know if this is related - if not, ignore for this thread, but you might want to compare my question in emacs-devel wrt an added `' when using the wheel in a standalone minibuffer (thread "mouse wheel events - why an extra ?"). > For my case, replacing the read-event by `read-key' happens to make > it work (see patch below). Please confirm whether or not it fixes it > for you, and if it doesn't, please show me the values of > `repeat-repeat-char' and `evt' in the above test. > + (while (let ((evt (read-key))) > ;; For clicks, we need to strip the meta-data to > ;; check the underlying event name. > (eq (or (car-safe evt) evt) Yes, that works for me too. Please install it if you see no problems with it. Thx. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 01:23:42 2010 Received: (at 6256-done) by debbugs.gnu.org; 19 Oct 2010 05:23:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P84fl-0004qU-Q2 for submit@debbugs.gnu.org; Tue, 19 Oct 2010 01:23:42 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P80hs-0003Bn-FY for 6256-done@debbugs.gnu.org; Mon, 18 Oct 2010 21:09:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjALAD6NvExMCpO7/2dsb2JhbACgVXlyw16FSQSSGQ X-IronPort-AV: E=Sophos;i="4.57,347,1283745600"; d="scan'208";a="80065585" Received: from 76-10-147-187.dsl.teksavvy.com (HELO pastel.home) ([76.10.147.187]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 18 Oct 2010 21:13:19 -0400 Received: by pastel.home (Postfix, from userid 20848) id 61F7AA8233; Mon, 18 Oct 2010 21:13:19 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> Date: Mon, 18 Oct 2010 21:13:19 -0400 In-Reply-To: <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> (Drew Adams's message of "Mon, 18 Oct 2010 14:12:30 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 6256-done X-Mailman-Approved-At: Tue, 19 Oct 2010 01:23:40 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >> But that doesn't work either in my tests: the problem is that the >> last-command-event was `mouse-4' (i.e. the up event) whereas >> read-event returns `down-mouse-4' (a subsequent read-event would >> return the `mouse-4'). > No doubt that is a difference between Emacs on Windows and Emacs on GNU. > BTW, the behavior you describe doesn't really seem very right for > a mouse wheel: Why should the first wheel event be `down-'? Under X11, wheel-up and wheel-down events are buttons, so they get pressed&released like any other (actually, it seems to be the case for the hardware as well, so it's not a complete invention of the X11 layer). I.e. when you turn up the wheel by 3 steps, you get 6 events. > I would think that `down-' would only be called for when you press the > mouse wheel (as in mouse-2 clicking using the wheel). Whatever. You also get such a down in that case, but that's a down-mouse-2 rather than a down-mouse-4 or down-mouse-5: pressing on the wheel is a completely different button from "turning the wheel". > Seems like the Emacs mouse-wheel behavior on Windows (the events) is > generally superior to that on GNU. Yes, tho it's mostly not Emacs's fault. X11's handling of wheels is not great. > What about fixing the latter so that it comes up to speed? > Another problem is that it precludes having `mouse-4' and `mouse-5' > correspond to actual mouse buttons. That's a general problem under X11, yes. There are various ways to work around the problem, but it's a source of annoyances. Typically, the additional buttons will then appear not as mouse-4/5 but for example as mouse-6,7,8. >> For my case, replacing the read-event by `read-key' happens to make >> it work (see patch below). Please confirm whether or not it fixes it >> for you, and if it doesn't, please show me the values of >> `repeat-repeat-char' and `evt' in the above test. >> + (while (let ((evt (read-key))) >> ;; For clicks, we need to strip the meta-data to >> ;; check the underlying event name. >> (eq (or (car-safe evt) evt) > Yes, that works for me too. Please install it if you see no problems > with it. Thx. Thanks, it's installed in emacs-23, closed, Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 02:47:03 2010 Received: (at 6256) by debbugs.gnu.org; 19 Oct 2010 06:47:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P85yR-0005pa-IP for submit@debbugs.gnu.org; Tue, 19 Oct 2010 02:47:03 -0400 Received: from smtprelay-h21.telenor.se ([195.54.99.196]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P85yO-0005pB-N3 for 6256@debbugs.gnu.org; Tue, 19 Oct 2010 02:47:01 -0400 Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-h21.telenor.se (Postfix) with ESMTP id EC956CDA4 for <6256@debbugs.gnu.org>; Tue, 19 Oct 2010 08:50:44 +0200 (CEST) X-SENDER-IP: [85.225.45.100] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQxACvdvExV4S1kPGdsb2JhbACHcZl2DAEBAQE1LcB3hUkEjU4 X-IronPort-AV: E=Sophos;i="4.57,349,1283724000"; d="scan'208";a="141381348" Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb2.telenor.se with ESMTP; 19 Oct 2010 08:50:44 +0200 Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTP id 1D94A7FA05A; Tue, 19 Oct 2010 08:50:44 +0200 (CEST) Message-ID: <4CBD3FD0.1000907@swipnet.se> Date: Tue, 19 Oct 2010 08:50:56 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100922 Thunderbird/3.1.4 MIME-Version: 1.0 To: 6256@debbugs.gnu.org, monnier@iro.umontreal.ca Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 6256 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) 2010-10-19 03:13, Stefan Monnier skrev: > That's a general problem under X11, yes. There are various ways to work > around the problem, but it's a source of annoyances. Typically, the > additional buttons will then appear not as mouse-4/5 but for example as > mouse-6,7,8. > If you have a mouse that scrolls horizontally also it comes as mouse 6 and 7. So extra buttons in that case would be 8, 9, 10 and so on. This makes it har do make code that uses extra buttons, there is no unique button numbering between different mouses except 1-5. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 10:00:14 2010 Received: (at 6256) by debbugs.gnu.org; 19 Oct 2010 14:00:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8Cjd-00017l-Vb for submit@debbugs.gnu.org; Tue, 19 Oct 2010 10:00:14 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8Cjc-00017g-5N for 6256@debbugs.gnu.org; Tue, 19 Oct 2010 10:00:12 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9JE3u1O030002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Oct 2010 14:03:57 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9JCLAKi005338; Tue, 19 Oct 2010 14:03:55 GMT Received: from abhmt020.oracle.com by acsmt354.oracle.com with ESMTP id 702177951287497032; Tue, 19 Oct 2010 07:03:52 -0700 Received: from dradamslap1 (/10.159.219.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Oct 2010 07:03:51 -0700 From: "Drew Adams" To: "=?iso-8859-1?Q?'Jan_Dj=E4rv'?=" , <6256@debbugs.gnu.org>, References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> <4CBD3FD0.1000907@swipnet.se> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Tue, 19 Oct 2010 07:03:48 -0700 Message-ID: <2EA3A2A14891434BAF023F61D9AF7EDF@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4CBD3FD0.1000907@swipnet.se> Thread-Index: ActvXQXKX4DHYEYDQJ2xVwf9fnEu2wAOOadA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > If you have a mouse that scrolls horizontally also it comes > as mouse 6 and 7. > So extra buttons in that case would be 8, 9, 10 and so on. > This makes it hard do make code that uses extra buttons, > there is no unique button numbering between different > mouses except 1-5. Correction: except 1-3, not 1-5 (or is it even just 1-2?). mouse-4 and mouse-5 on Windows are the 4th and 5th mouse buttons (crazy!, I know), while on GNU they represent wheel actions. But apparently there's not much that Emacs can do about this. (Did I understand that correctly?) From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 15:17:31 2010 Received: (at 6256) by debbugs.gnu.org; 19 Oct 2010 19:17:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8Hgg-0004AK-KC for submit@debbugs.gnu.org; Tue, 19 Oct 2010 15:17:30 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8Hgd-0004AF-70 for 6256@debbugs.gnu.org; Tue, 19 Oct 2010 15:17:27 -0400 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9JJLCYn025897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Oct 2010 19:21:13 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9J8lCrp028231; Tue, 19 Oct 2010 19:21:11 GMT Received: from abhmt020.oracle.com by acsmt354.oracle.com with ESMTP id 698493011287516067; Tue, 19 Oct 2010 12:21:07 -0700 Received: from dradamslap1 (/10.159.219.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Oct 2010 12:21:06 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com><0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Tue, 19 Oct 2010 12:21:04 -0700 Message-ID: <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActvKXP10VE12WVIS1CpDYQsnZybNQAb20mA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) (Putting this back into the bug-list thread, since some of my reply (#3 below) still pertains to #6256.) 1. > Yes, tho the only change it requires is to change the lets into setqs. Including the let-binding of `repeat-message-function'? I assume not. Doing that would change the value globally from then on. I've left that one as a let binding. 2. However, you say that your implementation will anyway render a let binding of `repeat-message-function' ineffective. Do you mean your current fix using read-key or your future reimplementation that you have locally? I assume you mean the latter. I can't test that, so I can't say how annoying the changed message behavior would be. Not being able to effectively let bind `repeat-message-function' (anywhere) would significantly reduce the utility of that variable. That's kind of the point of such a variable - code that uses it is unlikely to just treat it as a global setting (e.g. setq). There needs to be some simple way to prevent `repeat' from issuing its own message for the duration (including during all repetitions). And preferably we would also provide a way to apply an alternative function - i.e. to do exactly what `repeat-message' was intended to do and does currently. It seems like your future replacement would change the notion of a repetition so that it no longer does everything that is currently done in `repeat' (since `repeat' is not called repetitively). Dunno. I realize you are still working on it, but please try not to sacrifice too much in your quest for simplicity. 3. Your current read-key fix for `repeat' does not work in Emacs 23, whereas my fix using read-event does work. Yours works only for Emacs 24 - I'm not sure why (can you tell me perhaps?). Mine works also in Emacs 22 and 23. (Emacs 22 has no `read-key'.) So I cannot say I'm overjoyed with that solution. But maybe I will be if I understand its advantages. What was your objection to the solution I provided using `read-event'? You never stated it, IIRC. I realize that you do not care much about Emacs 22 or 23, but it seems like a fair amount of loss for little gain. I'd like to understand the advantage of your current fix using read-key. (Granted, an Emacs 22/23 user would need to eval the fixed version of `repeat', but that's not a big deal.) 4. > If you look at the corresponding patch included below, you'll see that > it makes it unnecessary to deal with pre/post-command-hook or with > undo-boundary. Actually it also handles various other details of the > top-level loop which the current version of repeat just > hasn't bothered to try and reproduce (e.g. moving the cursor outside > of images/compositions/invisible text). Yes, it looks simpler. (But you didn't show the definition of `set-temporary-overlay-map'.) > > I'm not objecting but asking to understand, especially > > since it breaks the way `repeat' has functioned (its > > interface), requiring code changes for at least some > > `repeat' callers such as mine. > > Yes, that's a concern. Consider providing some info in NEWS about how to make code compatible etc. > I've sent my current implementation to emacs-devel in some > other thread, but in any case it suffers from a few problems. > > > BTW, what's the `t' argument for? > > It means "keep this overlay map active as long as the user hits keys > within that keymap". A nil value means to keep it active only for the > very next command. You can also provide a predicate function > to decide when to deactivate the map. Do you actually use such optional functionality? How/where? From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 16:50:59 2010 Received: (at 6256) by debbugs.gnu.org; 19 Oct 2010 20:50:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8J99-0004vY-3W for submit@debbugs.gnu.org; Tue, 19 Oct 2010 16:50:59 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8J96-0004vS-KF for 6256@debbugs.gnu.org; Tue, 19 Oct 2010 16:50:57 -0400 Received: from faina.iro.umontreal.ca (vpn-132-204-232-129.acd.umontreal.ca [132.204.232.129]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o9JKsfRK019123; Tue, 19 Oct 2010 16:54:41 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 9E3E0B4007; Tue, 19 Oct 2010 16:54:40 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> Date: Tue, 19 Oct 2010 16:54:40 -0400 In-Reply-To: <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> (Drew Adams's message of "Tue, 19 Oct 2010 12:21:04 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3653=0 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 1. > Yes, tho the only change it requires is to change the lets into setqs. > Including the let-binding of `repeat-message-function'? I assume not. > Doing that would change the value globally from then on. I've left > that one as a let binding. Good. > 2. However, you say that your implementation will anyway render a let > binding of `repeat-message-function' ineffective. Do you mean your > current fix using read-key or your future reimplementation that you > have locally? I mean my future reimplementation. > I assume you mean the latter. I can't test that, so I can't say how annoying > the changed message behavior would be. Don't worry about it: it's a problem for me, as of now. > It seems like your future replacement would change the notion of > a repetition so that it no longer does everything that is currently > done in `repeat' (since `repeat' is not called repetitively). Dunno. It changes the place where the loop happens, yes: insteads of calling repeat repetitively from repeat itself, it's called repetitively from the toplevel command loop. > I realize you are still working on it, but please try not to sacrifice > too much in your quest for simplicity. It's not for simplicity but for correctness (several corner cases fail to work with read-key/event/char). > 3. Your current read-key fix for `repeat' does not work in Emacs 23, > whereas my fix using read-event does work. I did not understand that from your answer and I'm very surprised, since AFAIK this part of Emacs hasn't changed significantly. In any case I've only tested it under Emacs-23 (yup, that's a 3 there). > But maybe I will be if I understand its advantages. What was your > objection to the solution I provided using `read-event'? You never > stated it, IIRC. Your characterization of what works and what doesn't makes no sense to me (based on my understand of what the code does, and based on my tests), so I used the code that I know to work and I understand why. Since you say it doesn't work for you, please follow my advice: Please confirm whether or not it fixes it for you, and if it doesn't, please show me the values of `repeat-repeat-char' and `evt' in the above test. because without that info from your tests, I can't help you much further. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 18:19:04 2010 Received: (at 6256) by debbugs.gnu.org; 19 Oct 2010 22:19:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8KWO-0005YJ-3W for submit@debbugs.gnu.org; Tue, 19 Oct 2010 18:19:04 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8KWM-0005Xx-Uk for 6256@debbugs.gnu.org; Tue, 19 Oct 2010 18:19:03 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9JMMkrV025396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Oct 2010 22:22:47 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9JIi1Es017964; Tue, 19 Oct 2010 22:22:44 GMT Received: from abhmt009.oracle.com by acsmt353.oracle.com with ESMTP id 703726631287526667; Tue, 19 Oct 2010 15:17:47 -0700 Received: from dradamslap1 (/10.159.219.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Oct 2010 15:17:47 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com><0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com><8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Tue, 19 Oct 2010 15:17:45 -0700 Message-ID: <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Actvz+FbQMTKGifUR7aQz1+ky5T4sgAA5nHQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > 3. Your current read-key fix for `repeat' does not work in Emacs 23, > > whereas my fix using read-event does work. > > I did not understand that from your answer and I'm very > surprised, since > AFAIK this part of Emacs hasn't changed significantly. In > any case I've > only tested it under Emacs-23 (yup, that's a 3 there). > > > But maybe I will be if I understand its advantages. What was your > > objection to the solution I provided using `read-event'? You never > > stated it, IIRC. > > Your characterization of what works and what doesn't makes no sense to > me (based on my understand of what the code does, and based on my > tests), so I used the code that I know to work and I understand why. > > Since you say it doesn't work for you, please follow my advice: > > Please confirm whether or not it fixes it > for you, and if it doesn't, please show me the values of > `repeat-repeat-char' and `evt' in the above test. > > because without that info from your tests, I can't help you > much further. 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) In my own Emacs setup (which has lots of stuff in it) `C-x p wheel-down' moves correctly to the first bookmark, but then subsequent wheel-downs just start scrolling the window. IOW, `repeat' is exited immediately - there is no repetition at all. And because it exits immediately _no_ debug message appears in *Messages*. That tells me that it exited during `read-key', not because the event/key tested did not match (`while' test = nil). Apparently `read-key' itself exits out to the `unwind-protect' protection code in this scenario. I tried fiddling with `read-key-delay' but that didn't help. I used 3 bookmarks, all in the same buffer, so there should be no switch-frame events interfering anywhere. I do use a standalone minibuffer in my setup, and that sometimes causes `handle-switch-frame' events to happen in places one might not expect. But I don't think that is happening here (we are not even using the minibuffer, and everything should be taking place in the same frame). Dunno what is causing the problem. In emacs -Q, however, with just the Bookmark+ files loaded, I do not see the problem. That is presumably what you are seeing. The only way I see a problem then (without my setup) is if I rotate the wheel more rapidly. That is no doubt because it gets a `double-wheel-down' or `triple-wheel-down' event instead of a `wheel-down' event. I haven't bound those events specifically to the bookmark-cycling command, but I could do so to get around that (assuming that's the cause). For the same reason, I can see that same rapid-rotation problem with the fix I sent. This rapid-rotation behavior is not an issue, for me. The issue is the behavior I see when I use my own setup, and I cannot begin to pare things down from that setup to determine just what else might be involved. Presumably the bad behavior has something to do with how `read-key' works - something is apparently causing it to barf, but how `read-key' works is unclear to me. I hope that you (who wrote it) can figure out or guess what's happening here. I would have guessed that if there were a problem it would have occurred because `read-key' did not return an event/key that matched - like the problem with the original code and with the `read-char-exclusive' attempt I made first to fix it. But no, it never even got to the `and' test of the `while': it seems to have exited during `read-key'. 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'? Coming back to my question - I see no problems at all when I instead use the solution I sent, which uses read-event instead of read-key. It just works. You still have not said anything about what's wrong with that solution. If your read-key solution worked I would not hesitate to say fine, let's go with it - believe me. But it doesn't. If we can figure it out and fix it, I'm OK with that. I'm willing to try to help determine what's going wrong with the `read-key' approach, if we can do that by just debugging the `repeat' code (as opposed to my trying to narrow down my setup). 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)) 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? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 20 11:44:04 2010 Received: (at 6256) by debbugs.gnu.org; 20 Oct 2010 15:44:04 +0000 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 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" 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 Received: by ceviche.home (Postfix, from userid 20848) id 1E2A966112; Wed, 20 Oct 2010 11:47:49 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> Date: Wed, 20 Oct 2010 11:47:49 -0400 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) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 20 16:52:02 2010 Received: (at 6256) by debbugs.gnu.org; 20 Oct 2010 20:52:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8fdh-0007GQ-4D for submit@debbugs.gnu.org; Wed, 20 Oct 2010 16:52:01 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8fdf-0007GL-B8 for 6256@debbugs.gnu.org; Wed, 20 Oct 2010 16:52:00 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9KKtkfS025694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Oct 2010 20:55:47 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9KK93km030377; Wed, 20 Oct 2010 20:55:45 GMT Received: from abhmt003.oracle.com by acsmt353.oracle.com with ESMTP id 707703321287608136; Wed, 20 Oct 2010 13:55:36 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Oct 2010 13:55:36 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com><0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com><8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com><02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Wed, 20 Oct 2010 13:55:35 -0700 Message-ID: <08402D206B354E10BD8F86D4CD5FA9E8@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActwbigA7lM5DnVIQhGSgAozrMGCgAAC1yKg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > > 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. This is what I used: (unwind-protect (while (let ((evt (read-key))) (message "EVT: %S, R-R-CHAR: %S" evt repeat-repeat-char) (eq (or (car-safe evt) evt) (or (car-safe repeat-repeat-char) repeat-repeat-char))) (repeat repeat-arg)) (setq repeat-undo-count nil)) The only time that code is not entered is if `repeat-repeat-char' is nil (since the code is inside the (when repeat-repeat-char...)). And if that code is entered then the only time `message' is not invoked is if `read-key' barfs. > > 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. I saw no error messages in *Messages*. Perhaps we can conclude that `repeat-repeat-char' was nil. Since I have `repeat-on-final-keystroke'=t (the default), that in turn means that `last-command-event' was nil. Does that help you see what went wrong? `last-command-event' takes us into C code (and perhaps into your code for `read-key'?). I can't help much with that. As I suggested, this might have to do with other things such as my using a standalone minibuffer. Dunno. > > 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. I really don't want to try that for this, if I can avoid it. > > 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). Ah. I see. That's the first I heard of it. I was thinking that that code would work because it remains abstract (in principle). It just decomposes the event into its components and compares those. There is (in principle) nothing platform-specific about it. But I see from what you say below that the problem is that on X (and maybe on some other platforms?) wheel events cannot be treated abstractly without some massaging first. They have a different form depending on whether they are the first of a series. That form difference might be useful for X (?), and maybe it could sometimes be useful for Emacs (?), but it is just an obstacle in this context. In general (and in particular here) I don't think that Emacs has any need to distinguish the first wheel event in a given direction from subsequent ones in the same direction. IOW, the problem is not that X uses different event names from Windows for its wheel events. The problem (here) is that X uses different event names for the _same_ wheel action (rotation in a given direction). > 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. I see. So it sounds like we need an abstraction to deal with that - I'd think that would be useful anyway. After all, there is no good reason to distinguish the first wheel rotation (in a given direction). At least there is no good reason to _always_ do that, even if someone might find a reason why that might be useful sometimes. The modifiers that I wanted to compare in the `while' test are only the `control', `meta', `shift', `double', etc. modifiers. In the case of a wheel event we could safely abstract from any `down' or `up' modifiers (here, at least), AFAIK - they don't mean anything here. What about defining a function that maps X wheel events to "Emacs" wheel events that strip the `down' and `up' modifiers? And then using that function here? But that means being able to recognize a wheel event as such - any wheel event. We don't want to strip `down' or `up' from any non-wheel mouse events. That recognition should be possible using the vars `mouse-wheel-(up|down)-event'. Can you use something like this to make the decomposing-read-event approach work for X? (defun wheel-event (event) "Return EVENT, with modifiers `down' and `up' removed if a wheel event." (if (memq (event-basic-type event) (list mouse-wheel-up-event mouse-wheel-down-event)) event (event-convert-list (delq 'down (delq 'up (event-modifiers event)))))) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 20 21:04:54 2010 Received: (at 6256) by debbugs.gnu.org; 21 Oct 2010 01:04:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8jaP-0000Sw-Lj for submit@debbugs.gnu.org; Wed, 20 Oct 2010 21:04:53 -0400 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 1P8jaN-0000Sr-HR for 6256@debbugs.gnu.org; Wed, 20 Oct 2010 21:04:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYJABIvv0xMCpO7/2dsb2JhbACgVXpyv1SFSgSSGw X-IronPort-AV: E=Sophos;i="4.58,214,1286164800"; d="scan'208";a="80273772" 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 21:08:40 -0400 Received: by ceviche.home (Postfix, from userid 20848) id D30A366112; Wed, 20 Oct 2010 21:08:39 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> <08402D206B354E10BD8F86D4CD5FA9E8@us.oracle.com> Date: Wed, 20 Oct 2010 21:08:39 -0400 In-Reply-To: <08402D206B354E10BD8F86D4CD5FA9E8@us.oracle.com> (Drew Adams's message of "Wed, 20 Oct 2010 13:55:35 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > I was thinking that that code would work because it remains abstract (in > principle). It just decomposes the event into its components and compares > those. There is (in principle) nothing platform-specific about it. In principle, your message call should have generated a message. In principle my (eq (or (car-safe evt) evt) (or (car-safe repeat-repeat-char) repeat-repeat-char)) is 100% equivalent (tho more efficient) to your (and (equal (event-basic-type evt) (event-basic-type repeat-repeat-char)) (equal (event-modifiers evt) (event-modifiers repeat-repeat-char)))) But obviously, there's more at play here. >> 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. > I see. So it sounds like we need an abstraction to deal with that - > I'd think that would be useful anyway. After all, there is no good > reason to distinguish the first wheel rotation (in a given direction). > At least there is no good reason to _always_ do that, even if someone > might find a reason why that might be useful sometimes. [ You're misunderstanding. ] I know how to deal with the X11 side. It's dealt with, the code works. Let's concentrate on your case. E.g.: >> 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)) Or adding the suggested `message' calls before/after read-key or elsewhere to try and see what are the values of repeat-repeat-char at various places rather than try and guess them. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 22 14:40:35 2010 Received: (at 6256) by debbugs.gnu.org; 22 Oct 2010 18:40:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9MXb-0005lh-0e for submit@debbugs.gnu.org; Fri, 22 Oct 2010 14:40:35 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9MXY-0005lb-4x for 6256@debbugs.gnu.org; Fri, 22 Oct 2010 14:40:32 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9MIiOqL018966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Oct 2010 18:44:25 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9MIASLo006452; Fri, 22 Oct 2010 18:44:23 GMT Received: from abhmt009.oracle.com by acsmt355.oracle.com with ESMTP id 708232961287773011; Fri, 22 Oct 2010 11:43:31 -0700 Received: from dradamslap1 (/10.159.219.235) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Oct 2010 11:43:31 -0700 From: "Drew Adams" To: "'Stefan Monnier'" References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com><0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com><8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com><02C729C63ABB48A898C742329EE4ADB0@us.oracle.com><08402D206B354E10BD8F86D4CD5FA9E8@us.oracle.com> Subject: RE: bug#6256: 24.0.50; read-event in `repeat' command Date: Fri, 22 Oct 2010 11:43:32 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActwvIGPyJF8/eAURkq4UavBPesXRwBVu1Ag X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) > >> 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)) > > Or adding the suggested `message' calls before/after read-key or > elsewhere to try and see what are the values of repeat-repeat-char at > various places rather than try and guess them. OK, I retested, and I no longer see the problem. In the last few days I've changed some of the code I use, but not in any way that I would expect would make a difference here (i.e., in presumably unrelated areas). So I don't understand it. But the good news is that your code works for me now. If I had to guess, I'd guess that the problem was that I was loading the new code but then when I used the mouse-wheel commands the library they were defined in invoked `(require repeat.el)', and that redefined the function `repeat' as it was originally. That would be my guess. But I could have sworn that I used `C-M-x' several times during testing (e.g. after adding a call to `message'), so I should have at some point tested with the new definition. When I tested before, it systematically did not work. Anyway, it works now. Sorry for not testing correctly the first time. I checked also that it works with modifiers (e.g. C-S-wheel-up). (I assume that you tested that also on GNU.) So I'm OK with your fix. The only disadvantage wrt my fix, for my use (on Windows), is that it will not work for Emacs prior to 23.2, when `read-key' was introduced. (I know you don't care about that.) Thx. What changes will I need to make to my code, if any, after you move to the new implementation that uses `set-temporary-overlay-map'? I think you said none, since I changed the let bindings to setq. Can you confirm or let me know what will need to change? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 22 15:43:11 2010 Received: (at 6256) by debbugs.gnu.org; 22 Oct 2010 19:43:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9NWA-0006Ku-OB for submit@debbugs.gnu.org; Fri, 22 Oct 2010 15:43:10 -0400 Received: from torrent.cc.mcgill.ca ([132.206.27.49]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P9NW9-0006Kp-80 for 6256@debbugs.gnu.org; Fri, 22 Oct 2010 15:43:09 -0400 Received: from mailscan3.ncs.mcgill.ca (mailscan3.NCS.McGill.CA [132.216.77.250]) by torrent.cc.mcgill.ca (8.12.11.20060308/8.12.3) with ESMTP id o9MJl3Bw029884; Fri, 22 Oct 2010 15:47:03 -0400 Received: from mailscan3.ncs.mcgill.ca (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 513A0BFD0; Fri, 22 Oct 2010 15:47:03 -0400 (EDT) Received: from alfajor.home (vpn87177.VPN.McGill.CA [132.216.87.177]) by mailscan3.ncs.mcgill.ca (Postfix) with ESMTP id 2933DBFCE; Fri, 22 Oct 2010 15:47:03 -0400 (EDT) Received: by alfajor.home (Postfix, from userid 20848) id 94F6564098; Fri, 22 Oct 2010 15:47:02 -0400 (EDT) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#6256: 24.0.50; read-event in `repeat' command Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com> <90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com> <8E5430CB43B84B91BB47DB3C0C710C44@us.oracle.com> <02C729C63ABB48A898C742329EE4ADB0@us.oracle.com> <08402D206B354E10BD8F86D4CD5FA9E8@us.oracle.com> Date: Fri, 22 Oct 2010 15:47:02 -0400 In-Reply-To: (Drew Adams's message of "Fri, 22 Oct 2010 11:43:32 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2010.10.22.165721 X-McGill-WhereFrom: Internal X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 6256 Cc: 6256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) > OK, I retested, and I no longer see the problem. In the last few days I've > changed some of the code I use, but not in any way that I would expect would > make a difference here (i.e., in presumably unrelated areas). Good, thanks. > What changes will I need to make to my code, if any, after you move to > the new implementation that uses `set-temporary-overlay-map'? None for now, Stefan From unknown Thu Aug 14 21:54:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Nov 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator