From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: local keymap patch for key-binding Date: Wed, 13 Sep 2006 15:25:05 -0400 Message-ID: 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> <85hczdbdv2.fsf@lola.goethe.zz> <85mz959kkw.fsf@lola.goethe.zz> <85irjs4tda.fsf@lola.goethe.zz> <85ejug4pl4.fsf@lola.goethe.zz> <85k648kwy7.fsf@lola.goethe.zz> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1158175711 25674 80.91.229.2 (13 Sep 2006 19:28:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2006 19:28:31 +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 Wed Sep 13 21:28:29 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 1GNaP4-0003jY-57 for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 21:28:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNaP3-0006kP-KJ for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 15:28:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GNaM7-000221-OI for emacs-devel@gnu.org; Wed, 13 Sep 2006 15:25:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GNaM6-00020p-TR for emacs-devel@gnu.org; Wed, 13 Sep 2006 15:25:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNaM6-00020S-LA for emacs-devel@gnu.org; Wed, 13 Sep 2006 15:25:06 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GNaNt-0000K8-1X for emacs-devel@gnu.org; Wed, 13 Sep 2006 15:26:57 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GNaM5-00084e-Cr; Wed, 13 Sep 2006 15:25:05 -0400 Original-To: David Kastrup In-reply-to: <85k648kwy7.fsf@lola.goethe.zz> (message from David Kastrup on Wed, 13 Sep 2006 10:11:28 +0200) 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:59795 Archived-At: Why add the argument LOCATION? Is it just for the sake of command-rebinding? Why the need to switch buffers? Aside from that, some little details: + * keymap.c: include "window.h". You need to add a dependency in Makefile.in for that. ! if (SYMBOLP (AREF(location,0)) && ASIZE(location) > 1) ! event = AREF(location,1); ! else ! event = AREF(location,0); To follow our coding style you need additional spaces here: ! if (SYMBOLP (AREF (location,0)) && ASIZE (location) > 1) ! event = AREF (location, 1); ! else ! event = AREF (location, 0); A comma should always be followed by a space. Outside of a parenthesis there must be a space, unless the same spot is inside another parenthesis or followed by a semicolon. There needs to be documentation for LOCATION in etc/NEWS and the Lisp Manual. ! /* Key sequences beginning with mouse clicks are ! read using the keymaps in the buffer clicked on, ! not the current buffer. If we're at the ! beginning of a key sequence, switch buffers. */ I can't understand the second sentence, "If we're at the beginning of a key sequence". Since key-binding always operates on a key sequence, and since we're not in the middle of a loop which scans that key sequence, what does it mean to say that we are, or are not, "at the beginning" of it?