From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: local keymap patch for key-binding Date: Tue, 12 Sep 2006 12:04:01 +0200 Message-ID: <85hczdbdv2.fsf@lola.goethe.zz> References: <87slj1hybl.fsf@stupidchicken.com> <85pse5cbqw.fsf@lola.goethe.zz> <87zmd7yjq4.fsf@furball.mit.edu> <85pse3n99c.fsf@lola.goethe.zz> <87r6yjxh7k.fsf@furball.mit.edu> <85venuc27c.fsf@lola.goethe.zz> <85r6yiivi7.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158055476 20255 80.91.229.2 (12 Sep 2006 10:04:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Sep 2006 10:04:36 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org, storm@cua.dk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 12 12:04:33 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GN580-00049b-Io for ged-emacs-devel@m.gmane.org; Tue, 12 Sep 2006 12:04:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GN580-0000HB-43 for ged-emacs-devel@m.gmane.org; Tue, 12 Sep 2006 06:04:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GN57q-0000Fm-41 for emacs-devel@gnu.org; Tue, 12 Sep 2006 06:04:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GN57p-0000Fa-Mr for emacs-devel@gnu.org; Tue, 12 Sep 2006 06:04:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GN57p-0000FX-Jy for emacs-devel@gnu.org; Tue, 12 Sep 2006 06:04:17 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GN59I-0004u5-KT for emacs-devel@gnu.org; Tue, 12 Sep 2006 06:05:48 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GN57g-0006Zd-TH; Tue, 12 Sep 2006 06:04:09 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id C54921C40B5C; Tue, 12 Sep 2006 12:04:01 +0200 (CEST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Mon\, 11 Sep 2006 15\:58\:07 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59725 Archived-At: Richard Stallman writes: > (`key-binding' can't be used to look up events, and I am less > than certain that it should). > > Of course key-binding can be used to look up events. If you want to > look them up in the current active keymaps, key-binding is the > natural way. I think we are talking about different things here. Call M-: (eventp (read-key-sequence nil)) RET and click with the mouse somewhere. You will get "nil" as a result since read-key-sequence does not return an event, but rather an array with the 0th element being an event. key-binding in its current code by Chong can only deal with such an event _sequence_ (which is not an event according to eventp). If you thing it reasonable that key-binding should also react to bona-fide events _not_ wrapped in an array, I can do this easily enough in the change I am working on. > The recent change affects the lookup of events that specify > positions. It has no effect on what happens if you pass a list of > event-types without positions. > > Perhaps there is a misunderstanding here about what it means > to "look up events". > > a) add an additional optional parameter BASE-KEY which, when non-NIL, > will replace KEY for all purposes of lookup except determining the > keymaps to use when KEY is a key-sequence based on an event. > > I don't follow this at all, sorry. We have the situation that we want to look up an artificial "follow-link" keymap entry depending on the keymaps where a click was made. It would be nice to do this with (key-binding click-event nil nil 'follow-link) > b) have a function `event-replace-key' or something with a > better name which will take a key sequence based on an event and > swap out the basic event (but maybe _not_ its modifiers since > they can play a part in which keymap to use) and swap out the > `down-mouse-2' or similar with `follow-link'. > > What does "swap out" mean here? Replace it (actually, make a copy and replace the `down-mouse-1' symbol in the copy with `follow-link'). -- David Kastrup, Kriemhildstr. 15, 44793 Bochum