From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73764: format-kbd-macro returns a key name that keymap-lookup doesn't recognize Date: Sat, 12 Oct 2024 09:33:59 -0400 Message-ID: References: <86plo5y902.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23741"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73764@debbugs.gnu.org, Eduardo Ochs To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 12 16:11:07 2024 Return-path: Envelope-to: geb-bug-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 1szcpm-00061J-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Oct 2024 16:11:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szcpc-0005hq-C5; Sat, 12 Oct 2024 10:10:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szcpV-0005gt-S9 for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 10:10:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1szcpV-0007uN-Cx for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 10:10:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=tude/2tLKh8VNFsIS69ddPZrHnil10rBTzVuCEFwevk=; b=h1t3FTm3uP2kGAuFHmwb5e4GRtc0CtojTQUybDoC2GZN1yPwr3sZW7K7h4POJqbjdxsEa2HiJg05yP6k2CtlJs/1VSl/UJWC122nfxEszCKvoAsrnN3dsi8npe2abyLpvUxzDwR7x2zefQO1CfauXSycKsRlXd+MK+GCMcEFViq0a4w6XYHHjDpyJ1x7f7mc6ELlIIJZJBoFq4NDWh7XjrXbrzyMt0FjkmQXplKvXxBrE4+6pUcsBk8marxXBqQJBLu66h9d3NXmstUxtcdaGno8aYpmylZvOvgJNcnsUm/u384vZJ2fTjD+u6rmJaHe//ZZpWeGEkxzKCohD3kGvA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szcpj-0001sn-EC for bug-gnu-emacs@gnu.org; Sat, 12 Oct 2024 10:11:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Oct 2024 14:11:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73764 X-GNU-PR-Package: emacs Original-Received: via spool by 73764-submit@debbugs.gnu.org id=B73764.17287422106597 (code B ref 73764); Sat, 12 Oct 2024 14:11:03 +0000 Original-Received: (at 73764) by debbugs.gnu.org; 12 Oct 2024 14:10:10 +0000 Original-Received: from localhost ([127.0.0.1]:46333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szcor-0001iE-6r for submit@debbugs.gnu.org; Sat, 12 Oct 2024 10:10:10 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szcNT-00081c-S7 for 73764@debbugs.gnu.org; Sat, 12 Oct 2024 09:41:52 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4D2F91000C3; Sat, 12 Oct 2024 09:34:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1728740041; bh=vEQboWuPcl2GH6/pKDrdiuCtEzHJzwDkroVi6Mfwy3Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Y/o3WF+KDB1bu289d5Zkul/DWo7M7J8l5tRq6psweLVKHtiPdGfpxBq6ReNLj2XOZ 4WHs/KBOSy7son00S84Z26DZyHkS/cnZ1lLyGdHKzA2J82TyFhc6O56637KUHYPqQ5 QA2fbSKZ+DZ38s8gYf3usJJJQYn9rTYB2xUIxIBdk1v4mc13CX6S7FuH0zAMp23MGf lU4ziXv8LvgYBbGzhuzo6sUh5SsIoUk0rwfgChxMEGbTgUrNd8q6N/Pfsb/281DzML FyoEPCE/9tTmhWx2IcRCVoEj4KFwmAved0wmg2ArDpeIGpCJK2+759VuSurseYuEM/ P1zMjbv3WEeIQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 754FB10002E; Sat, 12 Oct 2024 09:34:01 -0400 (EDT) Original-Received: from pastel (unknown [104.195.209.82]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4B5031204E5; Sat, 12 Oct 2024 09:34:01 -0400 (EDT) In-Reply-To: <86plo5y902.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Oct 2024 12:18:37 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293441 Archived-At: >> (keymap-lookup global-map "M-C-h") >> ;;-> "M-C-h" is not a valid key definition; see `key-valid-p' [...] > Should we fix key-valid-p to be more lenient? AFAIK the strictness was a conscious choice, so maybe we should simply improve the error message to say something like "M-C-h uses an invalid modifier ordering, maybe you meant C-M-h". >> if we run this >> >> (format-kbd-macro (read-key-sequence-vector "Type C-M-h:")) >> >> we get "M-C-h". I guess we also need to make sure `format-kbd-macro` generates something that `key-valid-p` accepts. > Or maybe just remove the call to keymap--check from keymap-lookup? IIRC we wanted to use `keymap--check` on all input coming from the user, so I guess the question is whether the second arg of `keymap-lookup` is expected to be an immediate constant. That function is still young, so it's hard to tell how it'll turn up, but my `grep` says that indeed many (most) calls take a literal string as argument, so `keymap--check` seems appropriate. Stefan