From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66755: 30.0.50; how do i lookup a key but also respect key translations? Date: Thu, 26 Oct 2023 10:22:08 +0300 Message-ID: <83msw5hmqn.fsf@gnu.org> References: <87ttqeja59.fsf@strawberrytea.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33383"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66755@debbugs.gnu.org To: StrawberryTea , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 26 09:22:48 2023 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 1qvuhb-0008SP-Qe for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Oct 2023 09:22:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvuhO-0005GG-0h; Thu, 26 Oct 2023 03:22:34 -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 1qvuhM-0005Fm-19 for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 03:22:32 -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 1qvuhL-000717-PQ for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 03:22:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvuhq-0001B6-6I for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 03:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Oct 2023 07:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66755 X-GNU-PR-Package: emacs Original-Received: via spool by 66755-submit@debbugs.gnu.org id=B66755.16983049614499 (code B ref 66755); Thu, 26 Oct 2023 07:23:02 +0000 Original-Received: (at 66755) by debbugs.gnu.org; 26 Oct 2023 07:22:41 +0000 Original-Received: from localhost ([127.0.0.1]:60507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvuhV-0001AV-69 for submit@debbugs.gnu.org; Thu, 26 Oct 2023 03:22:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvuhP-0001AB-GU for 66755@debbugs.gnu.org; Thu, 26 Oct 2023 03:22:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvugp-0006zV-Ac; Thu, 26 Oct 2023 03:21:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Tx4CX2mR+NmuTRI47tjinahl4rsGNqHkkui6YxrT1wQ=; b=gZXIEqWidKin bHGC1MuEoCbMUgCHy2Ny8Cn4iP3CJOR1/ZU/ek10fhKVJ1YOo0a6mnpKlMYVcnZAqUyWw0/vzZJ2E zGMv2q7M9By+wAcxJqmCTuN5DsKc9S2MT8iMtKFH2cF0Uo173ynvVMD6g/RA2ERNDx4XBN9e56IQx rL//Ve34nL4syhcN32DfHCD/LYDi2wBLgULCC1P0YwcH6GNRrRgwe3UHBZUtmkrnIL89Usk+8JSen ep5E882yLyJlwH+QXjj+mpxm6bO7kQDcSlVtuViGcH7886oP0B9a1VgcczS2sT5sneXx8WXzaWVbs IA7ce8Fi8B47L3iTWuWbBg==; In-Reply-To: <87ttqeja59.fsf@strawberrytea.xyz> (message from StrawberryTea on Wed, 25 Oct 2023 22:57:58 -0500) 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:273248 Archived-At: > From: StrawberryTea > Date: Wed, 25 Oct 2023 22:57:58 -0500 > > > Hello. So I am trying to define a function which obtains the command > that would be called if 'corfu-mode' was not enabled: > > (defun +corfu--get-passthrough-command () > (keymap-lookup > (thread-last > (current-active-maps t) > (delq corfu-map) > (delq (and (featurep 'evil) > (evil-get-auxiliary-keymap corfu-map evil-state)))) > (key-description (this-command-keys-vector)))) > > But the issue is basically that > > (keymap-lookup (current-active-maps t) > (key-description (vector 'backspace))) > > returns nil whereas > > (keymap-lookup (current-active-maps t) (key-description (vector ?\C-?))) > > returns 'lispy-delete-backward' which is the command I actually want > returned. When I run 'describe-key-briefly' and type , I get > > DEL (translated from ) runs the command lispy-delete-backward > > but I don't know how to look up that translation from Elisp. I looked at > the code for 'help.el' and found the above description comes from > 'read-key-sequence' returning 'C-?' and 'this-single-command-raw-keys' > returning '[backspace]' but 'read-key-sequence' is defined in C and I > don't know how trigger it's translation logic programmatically from > Elisp. Perhaps Stefan (CC'ed) could help you. Btw, this kind of questions should be posted to help-gnu-emacs@gnu.org, not here.