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#58747: 28.2; local-function-key-map is not used when used with input-decode-map and modifier Date: Thu, 27 Oct 2022 12:42:27 -0400 Message-ID: References: <877d0qbgr8.fsf@linj.tech> <83pmedl01p.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="6004"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Lin Jian , 58747@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 18:44:39 2022 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 1oo5zh-0001Li-1u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 18:44:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo5yD-0002ZO-Iq; Thu, 27 Oct 2022 12:43:05 -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 1oo5yC-0002MX-L5 for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo5yA-0001bw-Ke for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:43:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo5y9-0002FR-T4 for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 16:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58747 X-GNU-PR-Package: emacs Original-Received: via spool by 58747-submit@debbugs.gnu.org id=B58747.16668889608608 (code B ref 58747); Thu, 27 Oct 2022 16:43:01 +0000 Original-Received: (at 58747) by debbugs.gnu.org; 27 Oct 2022 16:42:40 +0000 Original-Received: from localhost ([127.0.0.1]:59130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5xn-0002Em-JN for submit@debbugs.gnu.org; Thu, 27 Oct 2022 12:42:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5xl-0002EX-06 for 58747@debbugs.gnu.org; Thu, 27 Oct 2022 12:42:37 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B58B48065C; Thu, 27 Oct 2022 12:42:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 161C480355; Thu, 27 Oct 2022 12:42:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666888949; bh=UOzcqQcLFdRNwUNLfwRyToEzdwhhEYSGYDfuTCTaf90=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OEqgxPqKmG78FgUUVJtAmMCgYKmpiGKZAvC+6FbesnGgeZhNBrviTzQI5gs6UJVgD xDJtPN1k2xD0k7daGEpC+v+8dIXAgOrSXCO0K5QWnRE99R9B3G+XZOkkzP8Nd2z78T pwKNde8cpeHv4hxifCKwWJC4kq6IKnvdRnXBQncj5K3EnQJb93jQjZp1Rh32BbXDyI hCxBBdfDHjMUTTR1sAe/zk48J3sJ/VBq/gNxRKyE9GbC/j9VfnJoZ7/5m/HO0qwYzF tY998l+qezmuxm9BcNryYog8nCmDfKTmtg5fS/BCHXji4KvniSuffZzGUWt5aAtail mzVk61UT9kPIw== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E6E3F120748; Thu, 27 Oct 2022 12:42:28 -0400 (EDT) In-Reply-To: <83pmedl01p.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Oct 2022 19:10:42 +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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246331 Archived-At: Eli Zaretskii [2022-10-27 19:10:42] wrote: >> Date: Mon, 24 Oct 2022 01:06:49 +0800 >> From: Lin Jian via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> >> Steps to reproduce this bug: >> 1. emacs -q >> 2. (define-key input-decode-map [?w] [a-not-used-symbol-xxx-0]) >> 3. (define-key local-function-key-map [a-not-used-symbol-xxx-0] [a-not-used-symbol-xxx-1]) >> 4. (define-key key-translation-map [a-not-used-symbol-xxx-1] [a-not-used-symbol-xxx-2]) >> 5. (define-key key-translation-map [a-not-used-symbol-xxx-0] [a-not-used-symbol-xxx-3]) >> 6. C-h k w >> 7. check the *Messages* buffer, you will see >> >> (translated from w) is undefined >> >> This is good. >> 8. C-h k C-x w >> 9. check the *Messages* buffer, you will see >> >> C-x (translated from C-x w) is undefined >> >> I think this is a bug, which means local-function-key-map is not >> used. The expected result should be >> >> C-x (translated from C-x w) is undefined > > Stefan, any comments? Great bug report, thank you. Intriguing. :-) The corresponding code is quite tricky. Offhand I can't guess what's going on here, sorry. It will probably take single stepping through the `read_key_sequence` monster to try and figure out the reason (and maybe even end up discovering that it's a "feature", or more specifically that fixing it without breaking something else is nigh-on impossible). Stefan