From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Round-tripping key definitions Date: Sat, 13 Nov 2021 05:58:02 +0100 Message-ID: <875yswtzxh.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="456"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 13 05:59:33 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mll8X-000AX1-7m for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Nov 2021 05:59:33 +0100 Original-Received: from localhost ([::1]:42472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mll8W-0003pq-84 for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Nov 2021 23:59:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mll7E-0001WP-D5 for emacs-devel@gnu.org; Fri, 12 Nov 2021 23:58:14 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=33126 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mll7C-0003WF-Tm for emacs-devel@gnu.org; Fri, 12 Nov 2021 23:58:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kkMtzpNyoqIANEW/lrQfQWaz8ZG8/CCxe0LtoyOq/Kc=; b=lPD5C2KE2LCpelj1cxCZlYv12B mMip5UDoJlBdTeNE4lIGUK++4xTz3G5yOPVegw8+XSHP8sc7MhldIqx6KaytHS/Imm4G9cUMNntDN aKiK8ZcBRCxNZoD2BDHcLOUF3+BJogbcxgZtIRB1TGcr2QSkVXu4YhvazPY6UCvPSLTo=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mll75-0005j5-7K for emacs-devel@gnu.org; Sat, 13 Nov 2021 05:58:07 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJ1BMVEUaGhoiIyIfHx8e JiEcIR4pTDMiOCkvZD0UDBIzbkMcHSANDQ3///80p4IIAAAAAWJLR0QMgbNRYwAAAAd0SU1FB+UL DQQsG7u6w8MAAADPSURBVDjLY2AUxAqUGQQYwABKMQoKQDiGMBFmBlRgyMDAEpZmlpaWYgwkHeDi jIJAIrTUPLU8Ir2sNNQAoQNoAqNYalhaaoBZaGpqAlxcwBmkIy3VJS3BzCwZySggEGQpDa00iYzI DA0LRZJgBJqWGJZmEuZgFhaWaoCsg1HAhcXBhcGZAR0IMiowYAWMDDiAIHZhLgbcQIBEcdyW4wD4 LCfVrFGADoZLCHJRTwICBDCDhouABmJARwOCzdHR0dG9e/fujo4dQHL3DiCXgQEA0lEnRjB5cFYA AAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTEtMTNUMDQ6NDQ6MjcrMDA6MDD5VkYAAAAAJXRFWHRk YXRlOm1vZGlmeQAyMDIxLTExLTEzVDA0OjQ0OjI3KzAwOjAwiAv+vAAAAABJRU5ErkJggg== X-Now-Playing: Talking Heads's _Fear of Music_: "Heaven" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279301 Archived-At: It'd be nice if doing a `describe-keymap' would output the same bindings that we put in. I mean, on the same form. If you define a key as "C-i", that function will describe the key as "TAB", for instance. (And the person making that keymap may have meant C-i with "i" being a mnemonic for something.) To do this, we'd have to stash the "intended" syntax somewhere, but: (define-keymap "a" 'foo "b" 'bar) => (keymap (98 . bar) (97 . foo)) (define-keymap :full t "a" 'foo "b" 'bar) => (keymap #^[nil nil keymap #^^[3 0...]) In the latter case, we could stash the data in the case table somewhere. But the sparse syntax doesn't give us a lot of wriggle room. We could, of course, change the keymap types (since we're already adding new functions for all of this binding stuff), but it'd be a lot of work. Anybody got any ideas? Hm... while typing this, it occurs to me that we could add an "impossible" "binding". I.e.: (keymap (98 . bar) (97 . foo) (:bindings )) `describe-keymap' could use the :bindings entry to look up the intended syntax (and not output that element). Yeah! I think that should work? (We'd only add this entry if there's any "ambiguous" keys in the map, so the impact wouldn't be noticeable, I think.) Thank you for coming to my TED talk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no