From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brian Malehorn Newsgroups: gmane.emacs.bugs Subject: bug#13948: no key-binding-locus Date: Wed, 13 Mar 2013 16:34:48 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f503254b579e204d7d45875 X-Trace: ger.gmane.org 1363209666 8277 80.91.229.3 (13 Mar 2013 21:21:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2013 21:21:06 +0000 (UTC) To: 13948@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 13 22:21:29 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UFt70-00008d-LH for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Mar 2013 22:21:26 +0100 Original-Received: from localhost ([::1]:33836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFt6d-0007WF-Vy for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Mar 2013 17:21:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFt6Y-0007W0-3O for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 17:21:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFt6V-0006M9-Ft for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 17:20:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFt6V-0006M4-BB for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 17:20:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UFt7a-0002Lt-J4 for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 17:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brian Malehorn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Mar 2013 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13948 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13632097119019 (code B ref -1); Wed, 13 Mar 2013 21:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Mar 2013 21:21:51 +0000 Original-Received: from localhost ([127.0.0.1]:51997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFt7M-0002LK-4u for submit@debbugs.gnu.org; Wed, 13 Mar 2013 17:21:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36174) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFsPs-0001Ey-W2 for submit@debbugs.gnu.org; Wed, 13 Mar 2013 16:36:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFsOe-0006Dn-PK for submit@debbugs.gnu.org; Wed, 13 Mar 2013 16:35:40 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:46166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFsOe-0006Di-Lm for submit@debbugs.gnu.org; Wed, 13 Mar 2013 16:35:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFsOb-0005SP-8z for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 16:35:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFsOX-00069p-A6 for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 16:35:33 -0400 Original-Received: from mail-ie0-x234.google.com ([2607:f8b0:4001:c03::234]:57854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFsOX-00069a-0P for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2013 16:35:29 -0400 Original-Received: by mail-ie0-f180.google.com with SMTP id bn7so2094006ieb.11 for ; Wed, 13 Mar 2013 13:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=UZ1JUmrcnUR8AC+73iAtCiPLKKtZ6DYQb6i/v6njZ+s=; b=vNuyAAUJAnVzhQNklEaCBvjl4lEOAa1So+eP+Yf/LmiSjX65cOoDIrSTBiT1obP+YG SkDKfiAa/u/kp6CpTHQONRaKcSdBIHRsj+jtNUSdwfiXh5+AkX7KISrkfB2sLwP8CVsD f/a04txsEI620CPPE9t4mb54fuJH1qwedMUPfX1YpejUhSWaHolzQ2t1GBJ5J/b+dTYC QUghhBkyJnu4rkLoO03/WzJD9hH1e4Mm7fNKF0GW5hEH0aCBqADUPycDRUVrOdsuWPjN uQY3IugGulj3WkRrEk27muja2sDbbE9NE5hrGML57pWrwuEwcYdyae4K0mQqOSZ48b0l +DHQ== X-Received: by 10.50.11.138 with SMTP id q10mr18116887igb.5.1363206928147; Wed, 13 Mar 2013 13:35:28 -0700 (PDT) Original-Received: by 10.43.100.201 with HTTP; Wed, 13 Mar 2013 13:34:48 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 13 Mar 2013 17:21:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72436 Archived-At: --e89a8f503254b579e204d7d45875 Content-Type: text/plain; charset=ISO-8859-1 Why isn't there a key equivalent to variable-binding-locus? As in, a way to figure out where a particular keybinding is coming from. For example, M-x key-binding-locus C-j would evaluate to 'lisp-interaction-mode-map, which is the first map in which C-j was found. In terms of implementation, the process for finding a binding is described in (info "(elisp) Searching Keymaps"): ...Here is a pseudo-Lisp description of the order and conditions for searching them: (or (cond (overriding-terminal-local-map (FIND-IN overriding-terminal-local-map)) (overriding-local-map (FIND-IN overriding-local-map)) ((or (FIND-IN (get-char-property (point) 'keymap)) (FIND-IN-ANY emulation-mode-map-alists) (FIND-IN-ANY minor-mode-overriding-map-alist) (FIND-IN-ANY minor-mode-map-alist) (if (get-text-property (point) 'local-map) (FIND-IN (get-char-property (point) 'local-map)) (FIND-IN (current-local-map)))))) (FIND-IN (current-global-map))) So implementing key-binding-locus would only be a small tweak of the key lookup code: the first time you find the key, just return the map you found it in, rather than the command it's supposed to call. Thanks, Brian --e89a8f503254b579e204d7d45875 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Why isn't there a key equivalent to variable-bind= ing-locus? As
in, a way to figure out where a particular keybindi= ng is coming
from. For example,

=A0 =A0 = M-x key-binding-locus C-j

would evaluate to 'lisp-interaction-mode-map, which= is the first
map in which C-j was found.


In terms of implementation, the process for finding a bind= ing is
described in (info "(elisp) Searching Keymaps"):
<= br>
=A0 =A0 ...Here is a pseudo-Lisp description of the order and=
=A0 =A0 conditions for searching them:

= =A0 =A0 =A0(or (cond
=A0 =A0 =A0 =A0 =A0 (overriding-terminal-local-map
=A0 =A0 = =A0 =A0 =A0 =A0(FIND-IN overriding-terminal-local-map))
=A0 =A0 = =A0 =A0 =A0 (overriding-local-map
=A0 =A0 =A0 =A0 =A0 =A0(FIND-IN= overriding-local-map))
=A0 =A0 =A0 =A0 =A0 ((or (FIND-IN (get-ch= ar-property (point) 'keymap))
=A0 =A0 =A0 =A0(FIN= D-IN-ANY emulation-mode-map-alists)
=A0 =A0 =A0 =A0(FIND-IN-ANY minor-mode-overriding-map= -alist)
=A0 =A0 =A0 =A0(FIND-IN-ANY minor-mode-map-alist)
=A0 =A0 =A0 =A0(if = (get-text-property (point) 'local-map)
=A0 =A0 =A0 =A0 =A0 =A0(FIND-IN (get-char-prop= erty (point) 'local-map))
=A0 =A0 =A0 =A0 =A0= (FIND-IN (current-local-map))))))
=A0 =A0 =A0 =A0 =A0(FIND-IN (cu= rrent-global-map)))

So implementing key-binding-lo= cus would only be a small tweak of
the key lookup code: the first time you find the key, just return
the map you found it in, rather than the command it's supposed to=
call.

Thanks,
Brian

--e89a8f503254b579e204d7d45875--