From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6256: 24.0.50; read-event in `repeat' command Date: Sat, 11 Sep 2010 20:25:30 +0200 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 X-Trace: dough.gmane.org 1284230554 15094 80.91.229.12 (11 Sep 2010 18:42:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Sep 2010 18:42:34 +0000 (UTC) Cc: 6256@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 11 20:42:26 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 1OuV1U-00008O-EW for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Sep 2010 20:42:26 +0200 Original-Received: from localhost ([127.0.0.1]:47333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuV1E-0006Wj-Ak for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Sep 2010 14:41:44 -0400 Original-Received: from [140.186.70.92] (port=42283 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuV15-0006OH-DC for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 14:41:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuV00-00046C-B5 for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 14:40:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43054) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuV00-000468-7i for bug-gnu-emacs@gnu.org; Sat, 11 Sep 2010 14:40:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OuUk6-0000ux-MD; Sat, 11 Sep 2010 14:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Sep 2010 18:24: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.12842294093479 (code B ref 6256); Sat, 11 Sep 2010 18:24:02 +0000 Original-Received: (at 6256) by debbugs.gnu.org; 11 Sep 2010 18:23:29 +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 1OuUjZ-0000u4-Fl for submit@debbugs.gnu.org; Sat, 11 Sep 2010 14:23:29 -0400 Original-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 Original-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 Original-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" Original-Received: by ceviche.home (Postfix, from userid 20848) id 497D1660D2; Sat, 11 Sep 2010 20:25:30 +0200 (CEST) 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) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 11 Sep 2010 14:24: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:40097 Archived-At: > 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))