From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: master 859190f 2/3: Convert some keymaps to defvar-keymap Date: Sat, 16 Oct 2021 17:07:55 +0000 Message-ID: <74383e4ac5000d12b416@heytings.org> References: <20211004081724.6281.11798@vcs0.savannah.gnu.org> <83tuhlnkxm.fsf@gnu.org> <818f9907c2f359a71f49@heytings.org> <83czo9nj4g.fsf@gnu.org> <818f9907c244b9db0bea@heytings.org> <834k9lnd2i.fsf@gnu.org> <818f9907c2dff3b49971@heytings.org> <83k0ign3zj.fsf@gnu.org> <818f9907c26fb6f0233a@heytings.org> <838rywm7a7.fsf@gnu.org> <9865db3af5547c6ca15c@heytings.org> <9865db3af561bf9f05d1@heytings.org> <87mtnbv2q1.fsf@gnus.org> <87h7djv0j4.fsf@gnus.org> <87czo7uyxl.fsf@gnus.org> <878ryvuylj.fsf@gnus.org> <871r4nl3di.fsf@igel.home> <87a6jbtgjf.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Vd1EJbQAMI" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Eli Zaretskii , Andreas Schwab , Stefan Monnier , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 16 19:11:40 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 1mbnDf-0003cQ-NI for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Oct 2021 19:11:39 +0200 Original-Received: from localhost ([::1]:33770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbnDe-0007io-9k for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Oct 2021 13:11:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnAF-0005Zj-1v for emacs-devel@gnu.org; Sat, 16 Oct 2021 13:08:07 -0400 Original-Received: from heytings.org ([95.142.160.155]:54198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnAB-0007RQ-IZ; Sat, 16 Oct 2021 13:08:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1634404075; bh=tjTyrmA3Jo+tdNY93qPZOVqVFySzvBoCkql9ivP71n4=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=vlULRRlVi+DrNPMqeDPSl/8vjq3z3hTmYaGTPhEN1kxu8eofGx8SPm1lCwgtqycW6 7Z+w6pYFxRm21I3GSwVnzVEba0dPF7BeOlkljRNTdF3yn9lhiQNQmNIUgBoCbQk8sW FhzaftiiFHGkBlwyqaOShiFBNO2JvPkfS5Oh8Svfhj463pPltwfmO8XrN3aDA00hMg czlVRJdBOtzpM7xEQC1z/g9yzGxv2jQJQ6XZRyzb5yCyzfXzVIF88TV2RY2tlol8hk L88h0iIUAe3uIWx/irYSoGxAPbazjCqO/sG7QEHtkoBP9rFM8yeoEDUMKdyhGjO2MY kjaIVBkEXNdmQ== In-Reply-To: <87a6jbtgjf.fsf@gnus.org> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org 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, SPF_HELO_PASS=-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.23 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:277188 Archived-At: --Vd1EJbQAMI Content-Type: text/plain; charset=us-ascii; format=flowed > > ["C-c C-c"] > > The string-in-a-vector syntax is the easiest to handle -- it's very > regular, well-understood syntax that doesn't look magical. > > And since it's totally non-ambiguous, and we could make it error out on > everything that's not valid. > It's still not clear to me why it's necessary to introduce a fifth syntax for key bindings. Here's a more detailed patch, which isn't a proof of concept anymore. It performs a check of the input string, and if it happens to have the "strict" kbd syntax (the one that's used everywhere), converts it with kbd. It passes make check, and does not seem to pose problems elsewhere. --Vd1EJbQAMI Content-Type: text/x-diff; name=Make-it-possible-to-use-the-kbd-key-binding-syntax-i.patch Content-Transfer-Encoding: base64 Content-ID: <74383e4ac549ff6d0a7f@heytings.org> Content-Description: Content-Disposition: attachment; filename=Make-it-possible-to-use-the-kbd-key-binding-syntax-i.patch RnJvbSAzOWNkOTE3NTFjZDJiN2MyZWFjNjNmNTU2ZDZkM2RlYTZiOGFiNjU1 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBTYXQsIDE2IE9j dCAyMDIxIDE2OjQ3OjQ3ICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIE1ha2Ug aXQgcG9zc2libGUgdG8gdXNlIHRoZSBrYmQga2V5IGJpbmRpbmcgc3ludGF4 IGluIG1vcmUNCiBwbGFjZXMuDQoNCiogc3JjL2tleW1hcC5jIChp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ID09ICcg JykNCisJew0KKwkgIGlmICghc3BhY2UgfHwgISooa2V5ICsgMSkpDQorCSAg ICByZXR1cm4gZmFsc2U7DQorCSAgc3BhY2UgPSBmYWxzZTsNCisJICBrZXkr KzsNCisJICBjb250aW51ZTsNCisJfQ0KKyAgICAgIG1vZFswXSA9IG1vZFsx XSA9IG1vZFsyXSA9IG1vZFszXSA9IG1vZFs0XSA9IG1vZFs1XSA9IGZhbHNl Ow0KKyAgICAgIHdoaWxlICgoKCprZXkgPT0gJ0EnICYmICFtb2RbMF0gJiYg KG1vZFswXSA9IHRydWUpKSB8fA0KKwkgICAgICAoKmtleSA9PSAnQycgJiYg IW1vZFsxXSAmJiAobW9kWzFdID0gdHJ1ZSkpIHx8DQorCSAgICAgICgqa2V5 ID09ICdIJyAmJiAhbW9kWzJdICYmIChtb2RbMl0gPSB0cnVlKSkgfHwNCisJ ICAgICAgKCprZXkgPT0gJ00nICYmICFtb2RbM10gJiYgKG1vZFszXSA9IHRy dWUpKSB8fA0KKwkgICAgICAoKmtleSA9PSAncycgJiYgIW1vZFs0XSAmJiAo bW9kWzRdID0gdHJ1ZSkpIHx8DQorCSAgICAgICgqa2V5ID09ICdTJyAmJiAh bW9kWzVdICYmIChtb2RbNV0gPSB0cnVlKSkpICYmDQorCSAgICAgKihrZXkg KyAxKSA9PSAnLScpDQorCWtleSArPSAyOw0KKyAgICAgIGlmICghc3RybmNt cCAoa2V5LCAiTlVMIiwgMykgfHwgIXN0cm5jbXAgKGtleSwgIlJFVCIsIDMp IHx8DQorCSAgIXN0cm5jbXAgKGtleSwgIkxGRCIsIDMpIHx8ICFzdHJuY21w IChrZXksICJUQUIiLCAzKSB8fA0KKwkgICFzdHJuY21wIChrZXksICJFU0Mi LCAzKSB8fCAhc3RybmNtcCAoa2V5LCAiU1BDIiwgMykgfHwNCisJICAhc3Ry bmNtcCAoa2V5LCAiREVMIiwgMykpDQorCXsNCisJICBzcGFjZSA9IHRydWU7 DQorCSAga2V5ICs9IDM7DQorCSAgY29udGludWU7DQorCX0NCisgICAgICBp ZiAoKmtleSA9PSAnPCcgJiYNCisJICAoKCooa2V5ICsgMSkgPj0gJ2EnICYm ICooa2V5ICsgMSkgPD0gJ3onKSB8fA0KKwkgICAoKihrZXkgKyAxKSA+PSAn QScgJiYgKihrZXkgKyAxKSA8PSAnWicpKSkNCisJew0KKwkgIGtleSsrOw0K KwkgIHdoaWxlICgqa2V5ICYmICprZXkgIT0gJz4nKQ0KKwkgICAgew0KKwkg ICAgICBpZiAoISgoKmtleSA+PSAnYScgJiYgKmtleSA8PSAneicpIHx8DQor CQkgICAgKCprZXkgPj0gJ0EnICYmICprZXkgPD0gJ1onKSB8fA0KKwkJICAg ICgqa2V5ID49ICcwJyAmJiAqa2V5IDw9ICc5JykgfHwNCisJCSAgICAqa2V5 ID09ICctJyB8fCAqa2V5ID09ICdfJykpDQorCQlyZXR1cm4gZmFsc2U7DQor CSAgICAgIGtleSsrOw0KKwkgICAgfQ0KKwkgIGlmICgqa2V5ICE9ICc+JykN CisJICAgIHJldHVybiBmYWxzZTsNCisJICBzcGFjZSA9IHRydWU7DQorCSAg a2V5Kys7DQorCSAgY29udGludWU7DQorCX0NCisgICAgICBpZiAoKmtleSA+ PSAnIScgJiYgKmtleSA8PSAnficpDQorCXsNCisJICBzcGFjZSA9IHRydWU7 DQorCSAga2V5Kys7DQorCSAgY29udGludWU7DQorCX0NCisgICAgICByZXR1 cm4gZmFsc2U7DQorICAgIH0NCisgIHJldHVybiB0cnVlOw0KK30NCisNCitz dGF0aWMgTGlzcF9PYmplY3QNCittYXliZV9jb252ZXJ0X2tiZF9rZXkgKExp c3BfT2JqZWN0IGtleSkNCit7DQorICBMaXNwX09iamVjdCBrYmRfa2V5Ow0K KyAgaWYgKFNUUklOR1AgKGtleSkgJiYNCisgICAgICBpc19rYmRfa2V5IChT U0RBVEEgKGtleSkpICYmDQorICAgICAgIU5JTFAgKEZmYm91bmRwIChRa2Jk KSkgJiYNCisgICAgICAhTklMUC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