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: Re: Attach a map to another Date: Sun, 20 Feb 2022 12:07:13 +0100 Message-ID: References: <20220219130737.esdd2kou35avl75e.ref@Ergus> <20220219130737.esdd2kou35avl75e@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25964"; mail-complaints-to="usenet@ciao.gmane.io" To: Stefan Monnier , Stefan Monnier via Users list for the GNU Emacs text editor , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 20 12:08:49 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 1nLk5A-0006bl-P2 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Feb 2022 12:08:48 +0100 Original-Received: from localhost ([::1]:33686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLk59-0004z6-9c for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Feb 2022 06:08:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLk3n-0004mF-DC for help-gnu-emacs@gnu.org; Sun, 20 Feb 2022 06:07:23 -0500 Original-Received: from sonic308-1.consmr.mail.bf2.yahoo.com ([74.6.130.40]:42754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLk3l-0005Np-0W for help-gnu-emacs@gnu.org; Sun, 20 Feb 2022 06:07:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1645355240; bh=jffIejABFp7QYptIUJQkfFQFCCm4GPJFjKsFqo6g1hs=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject:Reply-To; b=Z99qXDkSMK4XSbVP2ECQNP2MyT2y8+sqkSZyrn4Cby38/USwTtgxRptTT1/XpLVxeTp3b1fmNqZS2+BysM1dVO1X0/M1F7Ni+uYeGqvAbzMV21K8hw6GDBVZnXyhYycxkPH5aKjINhGo+SaIsam6ltFZv5gQqIFmhhHrrZLTBdW+ClXbQtKMbPUbY20lFSQMSk0cadSd/42UqZuehXljzD1ptfwelgaI0FVpuapr9Lr64+WrkySyUwpk5Pi3cGmNyXSIeMeIIIckIr3adXuGMnKZPNbt2njmuqfFpPxE0RS4CUR8Ka9GBCN0N44QD7kXgurRVpwWAeLRBw+FtLEBSQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645355240; bh=dMoDG3xX2tStcFYjuEsnFVVO1pKDcyuDjRxrn7X55J2=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=f6c9d3QAvROsQ6Lv2DDBtfHcmRJMUibHC5vvg6lEjwh7Pj6W3gO6mkcv2oHpRjUc5lktRPrIR8yyJMWrVjYMwLi5ihNVEbcr5udFyOtknlCvPetyWSAqsIUUQgx3ku3TcAkZEFPAg2NFYY7Z9cAvzbe8NyD4C3Xt+amT7w7wJQXsMpW6X+DNvNauMBRVNIQIGJ//wQRAnGDChV4u6GNnrp+lbLJPD/9Bf0D9LJe3jBP1ZwrrwLpZOLU2QetYtLYQudXRMfRJtsD9aD0ac38pbJqoxwi6i8Cth5HhguCflpDd0NknXuGyQN7I1v8kNh7JZXssIlcOYsdHNHzmSGoplQ== X-YMail-OSG: Ap.dkwQVM1kTt45J8r2nWO7CjXG_WBBbVec2q8ukZHCr0bK9.ucLZg9jSPV0xwj dKQcrkeYv3EprVFJD5o4Qf.n3hkofLOdAv4AsaHeUu8lQNx5ZuqJQtScQqkun9AVPUsWddBTkgbU b47T7a9ioi4ZKuor5LrKLBuZWBl9CGUWPgZr8ZghjhjW7K1TpyJHbxcW.d9bvnP0b4evPFz1sMl2 nhiglyUL4P0K.TJJhnyoljkAvmPJG1viJpZKrx0d4kvOL4fDubGNMa_WgylRwM4vKSjjtYLbMHIQ ftcYDwgrKbijFwc6c6.KKJUnbSDnpq5Hycz.QTQIn7lshAWCDK4ynOiOED60c6cLLbfkJBqYuo8H Hdn.zkaAp7aQKB7ucdQPz56qM35dJctRZaT74x2cQy3_XXvgpPAy.BSDZ.se7xWaM9s1BFRDMTyJ ygm4H0_lGjvvPtYBK1ugm7BeWmRlSbLs0YtAyme6OoT_u6R.Vm.BlQqU6rj6cTN0q70WkFHwY5Fv Pu9_qHKCJjzOh0txWISMRQAUHhiC2CCwOl97GAVbph1r48qDsyvD.nEyCVblXurLjB4jQhjAGS16 ckK7FgqDCKGwggjAUasnhgObdWdbnfhjuCtJOwQexC3Pu0p1pGRUbUKXhtWLvViiyNsas0SqixMM FADKWNcndWlqau8IpXdu.Z3vXqgpY6gM31yOjNEV_kzv7zZ1PCzy4Hjz0TOAALFfAboDLmZKAK9S Vrvs_0pMhvgvyV97uWO_sMCjsQ3RxZnzdo3FesLGDuvvvIA4JSZphPVNg2CWRBdWwdFHSpHkkudm cUmqOHOaZMgc_EtlGLukUAxkrKzI9GUEy3VpW0gp6D X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Sun, 20 Feb 2022 11:07:20 +0000 Original-Received: by kubenode516.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 899a34aaf5a3d473c8d5b3f21cbabed7; Sun, 20 Feb 2022 11:07:18 +0000 (UTC) In-Reply-To: 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.130.40; envelope-from=spacibba@aol.com; helo=sonic308-1.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:136042 Archived-At: Thanks Stefan=2E=2E=2E Good to know=2E=2E=2E Do you think it worth doing th= is a feature request?? I think that many packages will benefit from it=2E= =2E=2E Because I have seen many of then dealing with this issue in differen= t manners and not all of them succesfull=2E Maybe the new keymap package may include something in keymap-set=2E=2E=2E= =2E Best and thanks, Ergus On February 19, 2022 7:29:56 PM GMT+01:00, Stefan Monnier via Users list f= or the GNU Emacs text editor wrote: >> I think that having a keymap entry in another one makes the trick >> according to the documentation: >> (keymap >> (keymap >> (26 =2E extra-functions)) >> (24 =2E normal-functions)) > >Yes, it's the low-level representation used for >multi-keymap inheritance=2E > >> but I am wondering if there is an api to do that more conveniently?? > >The only API available which uses that is `make-composed-keymap`=2E > >[ Well, there's also `lookup-key` since multiple inheritance can appear > naturally in some cases as the result of looking up bindings in > keymaps with single inheritance=2E Fixing those corner cases was > actually the original motivation for introducing support for multiple > inheritance=2E ] > >> (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 ))) > >This code isn't right, but I see what you mean, and indeed, that's >a good use case=2E > >We sadly don't yet have good functions for that, so you have to get >dirty and do it by hand, with something like: > > (define-minor-mode my-mode > (if my-mode > (cl-pushnew my-mode-map (cdr isearch-mode-map)) > (delq my-mode-map isearch-mode-map))) > > >-- Stefan > > --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E