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: Getting the click position in a string Date: Thu, 27 Apr 2006 14:08:08 +0200 Message-ID: <85r73jkyqf.fsf@lola.goethe.zz> References: <85fyk2ugle.fsf@lola.goethe.zz> <85fyk0rbrk.fsf@lola.goethe.zz> <853bg0r1ms.fsf@lola.goethe.zz> <85y7xspkgk.fsf@lola.goethe.zz> <87ejzk8mmv.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146142261 17169 80.91.229.2 (27 Apr 2006 12:51:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Apr 2006 12:51:01 +0000 (UTC) Cc: emacs-devel@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 27 14:50:59 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 1FZ5xO-0001P9-44 for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2006 14:50:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZ5xN-0003ui-JO for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2006 08:50:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZ5xB-0003ud-I5 for emacs-devel@gnu.org; Thu, 27 Apr 2006 08:50:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZ5xA-0003uR-GW for emacs-devel@gnu.org; Thu, 27 Apr 2006 08:50:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZ5xA-0003uK-EN for emacs-devel@gnu.org; Thu, 27 Apr 2006 08:50:40 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZ605-0000zJ-0F for emacs-devel@gnu.org; Thu, 27 Apr 2006 08:53:41 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FZ5x8-0004oO-Ts; Thu, 27 Apr 2006 08:50:39 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id AEEFE1D1FFCD; Thu, 27 Apr 2006 14:08:08 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: <87ejzk8mmv.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 26 Apr 2006 09:58:14 -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:53502 Archived-At: Stefan Monnier writes: >> But I increasingly feel that this is not the right way to go, the >> whole function should get dissed out, and instead we should have >> something like > >> (posn-key-binding event &optional accept-default remap key) > > Sounds right. I have taken a look how the command loop does this right now. It appears that read-key-sequence does all the lookup (and it is more or less necessary to do so in order to decide when a key sequence is finished), stuffs the looked-up command as a by-product into an internal variable that appears not accessible at the Lisp level (at a first glance), and the command loop picks it out from there. Of all the ugly... Factoring the keymap and partial keymaps out into a separate function would probably not be trivial. But even if code reuse might not be practical, I think that something like posn-key-binding should be implemented in keyboard.c so that there is some guarantee it will deliver the same results. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum