From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.help Subject: Attach a map to another Date: Sat, 19 Feb 2022 14:07:37 +0100 Message-ID: <20220219130737.esdd2kou35avl75e@Ergus> References: <20220219130737.esdd2kou35avl75e.ref@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16190"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 19 14:22:46 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nLPhF-000445-8G for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Feb 2022 14:22:45 +0100 Original-Received: from localhost ([::1]:39670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLPhE-0003fQ-6f for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Feb 2022 08:22:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLPe1-0003ds-K1 for help-gnu-emacs@gnu.org; Sat, 19 Feb 2022 08:19:28 -0500 Original-Received: from sonic315-13.consmr.mail.bf2.yahoo.com ([74.6.134.123]:41620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLPd2-0000NJ-1U for help-gnu-emacs@gnu.org; Sat, 19 Feb 2022 08:19:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1645276702; bh=MLJYHpDDnR9g/p0w+lQZv50Y9BmdGAxPBGJkd9GNAOU=; h=Date:From:To:Subject:References:From:Subject:Reply-To; b=mDIrgDCi0yIloli84uKvtUl8bfxSGbEy+wuKUgeGeu1L4MF0cCEhBSudv4F2BGPm7St315YnwhY5tsKj5+E63dFkhDwIk3U6X+SY7MT1ZlirbjdcioGI1rCITxUXxPaz/+zjQBsau5RkIG8AeQ60oy34y8n7PwTZj7opNaHcTnVoKNMPKJsV466wD7NI0zHJ6NLE/ZyOYDciwiNHpvI5nBwi2Pk4M4IiXyxpnloRw7btL7gqPfp3+CMnFBBaehtwb9nxzhnlsA48mTgJuVXgWzcYwMI1TSLRArzV1FQ0qDS51O7FmF6jqCBHJ9cv2WygP2hdYghdz1IUWAxhAxwmxA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645276702; bh=MqPCwsFpxNQ+z3P8sdwMfNBI0kVfO/LZB2qX98aH1Em=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=UvhY6TFqGwoYcPEYPDS4/NkMyIlwpmRjDsv4YpaZ5ZvrZaK3TLnKCpMAm78uRIyOywSkrMRNM8SdK6DKGq7nD1rUW+Np0387PdrQMfltcWClYT5fxv17Kysljq+kO6w7yEucbqUhbDcDFGm7NXJ24nJOXGUFU+w/SwVdo+G7pzArlVQjc1EeC7guUz6f9FNG4V5kqs9EJeCaj/Qg1Sk6tc1ct38V455i2BWG9obQB9eDJuuy/hxzbJJYg6q5EXAp1dZ2lK+PsKQc4ufNmhlxwOdfpXoYBft97+pgJOjccvI3wJXdD3WfwRdjI/lMAi1vp5uxk0ZCNcuvdjA+3m2ZGQ== X-YMail-OSG: BiuosHQVM1mAF8pKUViucK83Ag47GAFnmdLuODZNyp_YbbcmLF_MrGH7kktr_XD PxkybgDKGZx9SXyf8BHXyhe7tFEzNRfAq74BgrTfLOHE4cDQlvu1qyKFY89jG9N69As8riQWiETI auNavsDP9POdW4kxp2RBsBfO.pQldi8zT.69trypoXD4AQ5eWlVRf40XFNWyJUF6vGnBGuHA91dJ 7_DN8qR2VgOHLsnjHdcal95IpkZUWr2Rm08YImzxbuNP2zbYEHbS03bs4ZPmqv5Ma96ccC1SiL_j FCLB0xVqQ8A4fBRANO5yI6NRkvCTga_85dt1mOVN5H5uE2tojeSKcP5Qi6lRsMHKp3LWlmZDzp07 XkNWCf8fsAdcUYbWTubJ0UooQilB6W1sz1nMafvuEAStIFkwnAwBGx3qsa8xTGnzQ9zKZR3V6xas eq.ZRvwfqVvflCM4PIjlm1p.IffGto52YTZHPRHjhJSMuv7eno5vlcutypYib4jG5Z5c.v6o.3t2 sYarKwoQ_ckyDvtm2psyYUCXrucMHGhOM4Gn7wCmnvOI1CnEUsEYfuaJpUXMg.OdYXFqIGxJ.N53 siAU9JVPMs6VbbqSeli.WbAvOciAK4.yG.qqISq1LZ8MIYanzy805HZlm.qMk1DoLlW2dLCayAl2 BHNdDDaH.4e3wBCBbwrtk4abqIwbvjdWhC7yhXouxBlm6ceRGmBV6r_StrquxU3nOJ_tXdDBnSr_ YNSglSTmU2CJY8oYNXNzm7.TDnsXvOoS4hfMMViFRr.RuB.pCSb2VPlVlUNTbmCDQ_1EVwaZzQXY .YC1Xb8STdLFof4nDmpVkgDb54dtTLbkOBbf_rk_gB X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Sat, 19 Feb 2022 13:18:22 +0000 Original-Received: by kubenode509.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f5da3704e9a65215720e5ff712c2a689; Sat, 19 Feb 2022 13:08:15 +0000 (UTC) Content-Disposition: inline X-Mailer: WebService/1.1.19797 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.134.123; envelope-from=spacibba@aol.com; helo=sonic315-13.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136000 Archived-At: Hi: Recently I was making a minor-mode that apart from other stuff attach some bindings to isearch-mode-map. I know that it is possible to add a parent keymap and some inheritance.. and in the opposite direction I see that it is possible to add bindings or prefix maps to another... But I am not clear from the documentation if it is possible to add a keymap to another without a prefix (with something like keymap-set or similar). I think that having a keymap entry in another one makes the trick according to the documentation: (keymap (keymap (26 . extra-functions)) (24 . normal-functions)) but I am wondering if there is an api to do that more conveniently?? At we don't add bindings to keymaps with push so I don't expect to do so with keymaps. The idea is that in the mode it will be easier to do something like: ``` (defvar-keymap my-mode-isearch-map ...) (define-minor-mode my-mode :keymap 'my-mode-keymap (if my-mode (keymap-set isearch-mode-map my-mode-isearch-map) (keymap-unset isearch-mode-map ))) ``` Otherwise the isearch-mode-map keeps modified even after disabling the mode. I see that some packages around deal with this manually coping the bindings, saving the previous map and replacing with an inherited one iteratively and so on... but maybe there is something already there to not reinvent the wheel?? And potentially more efficient??