From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 11 Sep 2010 15:34:36 -0700 Message-ID: References: <058F2FC300154C1AB894694655B2A968@us.oracle.com><90A72397ABF34D84A3ACB3B6DE18F74A@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1284244837 32136 80.91.229.12 (11 Sep 2010 22:40:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Sep 2010 22:40:37 +0000 (UTC) Cc: 6256@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 12 00:40:34 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OuYkK-0002Rx-3r for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Sep 2010 00:40:32 +0200 Original-Received: from localhost ([127.0.0.1]:38958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuYkJ-0001v9-DR for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Sep 2010 18:40:31 -0400 Original-Received: from [140.186.70.92] (port=38592 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuYkC-0001uG-1W for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 18:40:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuYkA-0005gx-2u for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 18:40:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56314) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuYk9-0005gs-Uo for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 18:40:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OuYe2-0007vG-9H; Sat, 11 Sep 2010 18:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Sep 2010 22:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6256-submit@debbugs.gnu.org id=B6256.128424442430425 (code B ref 6256); Sat, 11 Sep 2010 22:34:02 +0000 Original-Received: (at 6256) by debbugs.gnu.org; 11 Sep 2010 22:33:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuYdk-0007uf-Do for submit@debbugs.gnu.org; Sat, 11 Sep 2010 18:33:44 -0400 Original-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 Original-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 Original-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 Original-Received: from abhmt005.oracle.com by acsmt353.oracle.com with ESMTP id 597248351284244481; Sat, 11 Sep 2010 15:34:41 -0700 Original-Received: from dradamslap1 (/10.159.221.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Sep 2010 15:34:41 -0700 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 11 Sep 2010 18:34:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40101 Archived-At: 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