From xemacs-m  Tue Sep 16 21:23:32 1997
Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28])
	by xemacs.org (8.8.5/8.8.5) with SMTP id VAA22923
	for <xemacs-beta@xemacs.org>; Tue, 16 Sep 1997 21:23:31 -0500 (CDT)
Received: from M66-080-21.MIT.EDU by MIT.EDU with SMTP
	id AA25789; Tue, 16 Sep 97 22:23:33 EDT
Received: by M66-080-21.MIT.EDU (SMI-8.6/4.7) id WAA20747; Tue, 16 Sep 1997 22:23:27 -0400
Date: Tue, 16 Sep 1997 22:23:27 -0400
Message-Id: <199709170223.WAA20747@M66-080-21.MIT.EDU>
From: David Bakhash <cadet@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] `make-event' accepts arguments
In-Reply-To: <kigk9gg8zp6.fsf@jagor.srce.hr>
References: <kigk9gg8zp6.fsf@jagor.srce.hr>
X-Mailer: VM 6.31 under 20.2 XEmacs Lucid

Hrvoje Niksic writes:
 > The comment at events.c says:
 > 
 > /* #### This should accept a type and props (as returned by
 >    event-properties) to allow creation of any type of event.
 >    This is useful, for example, in Lisp code that might want
 >    to determine if, for a given button-down event, what the
 >    binding for the corresponding button-up event is. */
 > 
 > DEFUN ("make-event", Fmake_event, 0, 0, 0, /*
 > ...
 > 
 > 
 > Here is an experimental patch for `make-event' to accept the TYPE and
 > PLIST arguments, so you can create events you like.  That can be used, 
 > for instance, to implement things like xterm-mouse-mode, or much
 > more.  The idea is that `make-event' parses PLIST as if it were a
 > list returned by `event-properties', and sanity-checks it on the way.

holy cow, dude!  this is excellent!  I think that with this patch I can
re-write strokes so that it doesn't use defadvice!!!

basically, here's the plan:

totally steal away the binding for button-2.  Strokes would completely
own that binding  to the extent that even a local keymap would not get
it.  I can do this with `key-translation-map', and some crazyness.  Next 
step:  once that button-press events happens, I'll save the
even-properties of that event.  If it's a stroke (i.e. a drag) great,
then I'll just let strokes do what it used to do; if it's a click, then
I'll create a brand-new event with the same event plist as the original
one had, and then dispatch it.  NO DEFADVICE!

thanks a mil.  you kick ASS!

dave
(hope it works!)

