unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 6256@debbugs.gnu.org
Subject: bug#6256: 24.0.50; read-event in `repeat' command
Date: Sat, 11 Sep 2010 15:34:36 -0700	[thread overview]
Message-ID: <AA30C57A014F458983869D2EB23E5994@us.oracle.com> (raw)
In-Reply-To: <jwvr5h0yw9t.fsf-monnier+emacs@gnu.org>

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 (#<window 8 on foo.el> 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 <up> <up> <up>... (or <down> <down>...) 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






  reply	other threads:[~2010-09-11 22:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 15:11 bug#6256: 24.0.50; read-event in `repeat' command Drew Adams
2010-05-24 16:28 ` Drew Adams
2010-05-24 23:05   ` Drew Adams
2010-05-25  0:06     ` Lennart Borgman
2010-05-25  2:41     ` Stefan Monnier
2010-07-03 21:24       ` Drew Adams
2010-07-04 22:45         ` Stefan Monnier
2010-07-07 14:43           ` Drew Adams
2010-07-21 15:54           ` Drew Adams
2010-08-28 15:19             ` Drew Adams
2010-09-11 18:25         ` Stefan Monnier
2010-09-11 22:34           ` Drew Adams [this message]
2010-09-12 16:06             ` Drew Adams
2010-09-17  3:34               ` Drew Adams
2010-09-22 14:01                 ` bug#6256: [PATCH] " Drew Adams
2010-09-25 14:30                   ` Drew Adams
2010-10-18 18:40               ` Stefan Monnier
2010-10-18 21:12                 ` Drew Adams
2010-10-19  1:13                   ` Stefan Monnier
2010-10-19  6:50                     ` Jan Djärv
2010-10-19 14:03                       ` Drew Adams
     [not found]                 ` <jwv4ocjuvm1.fsf-monnier+emacs@gnu.org>
     [not found]                   ` <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com>
     [not found]                     ` <jwvpqv7rp50.fsf-monnier+emacs@gnu.org>
2010-10-19 19:21                       ` Drew Adams
2010-10-19 20:54                         ` Stefan Monnier
2010-10-19 22:17                           ` Drew Adams
2010-10-20 15:47                             ` Stefan Monnier
2010-10-20 20:55                               ` Drew Adams
2010-10-21  1:08                                 ` Stefan Monnier
2010-10-22 18:43                                   ` Drew Adams
2010-10-22 19:47                                     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AA30C57A014F458983869D2EB23E5994@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=6256@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).