From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: unexpected result with keymap inheritance Date: Wed, 23 Nov 2016 10:02:51 -0500 Message-ID: References: <20161121002838.rkoniry5n6aemrzt@doriath.local> <87twb0sqnr.fsf@gmail.com> <871sy3jpu4.fsf@gmail.com> <20161123101639.7v7y2xslyvkkg6uo@doriath.local> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1479926668 27556 195.159.176.226 (23 Nov 2016 18:44:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2016 18:44:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 23 19:44:24 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9cWs-00065B-RE for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Nov 2016 19:44:22 +0100 Original-Received: from localhost ([::1]:35668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9cWw-0006Xd-Dg for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Nov 2016 13:44:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9Z4l-0002xZ-N7 for help-gnu-emacs@gnu.org; Wed, 23 Nov 2016 10:03:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9Z4i-0006D6-Fl for help-gnu-emacs@gnu.org; Wed, 23 Nov 2016 10:03:07 -0500 Original-Received: from [195.159.176.226] (port=58283 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9Z4i-0006CR-A3 for help-gnu-emacs@gnu.org; Wed, 23 Nov 2016 10:03:04 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c9Z4c-0008KN-NQ for help-gnu-emacs@gnu.org; Wed, 23 Nov 2016 16:02:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:jNTCfvakKizlfkFk4g110YBKUsM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Wed, 23 Nov 2016 13:43:45 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111776 Archived-At: > (unbind-key ido-common-completion-map [(control ?p)]) > where unbind-key is a function that removes any reference to a key from the > given map. unbind-key would be bad name since after the call (lookup-key ido-common-completion-map [?\C-p]) would still return a binding. I.e. there are two ways to under "the map", one includes the parent and the other doesn't. So, in order to avoid confusion, the name should be clear regardless of how you look at the map. I don't have good ideas for a name, tho: remove-key-from-child and reveal/expose-parent-binding is the best I could come up with so far. Another option is to use something like (define-key :get-from-parent) Side note: A keymap can be composed of other keymaps, so it can be an object of the form (keymap MAP1 MAP2 . PARENT). In that case, a nil binding in MAP1 does not hide another binding in MAP2, but does hide a binding in PARENT. With a special :get-from-parent binding, we could get the exact opposite: a :get-from-parent binding in MAP1 could hide a binding in MAP2 and reveal a binding in PARENT, whereas the most obvious implementation of reveal-parent-binding would probably mean that after it, both bindings in MAP2 and in PARENT would be exposed. Stefan