From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Justin Burkett Newsgroups: gmane.emacs.bugs Subject: bug#71648: 30.0.50; Allow which-key to report on translation bindings Date: Wed, 19 Jun 2024 11:48:01 -0400 Message-ID: References: <87plsdxhnw.fsf@gmail.com> <867celoz4q.fsf@gnu.org> <864j9posjg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30476"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71648@debbugs.gnu.org, rpluim@gmail.com, jb@jeremybryant.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 19 17:50:25 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 1sJxZp-0007hT-6O for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jun 2024 17:50:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJxZY-0002ie-C4; Wed, 19 Jun 2024 11:50:08 -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 1sJxZP-0002i3-HO for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 11:49:59 -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 1sJxZP-0001kc-2A for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 11:49:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJxZS-0005bo-1f for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 11:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Justin Burkett Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jun 2024 15:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71648 X-GNU-PR-Package: emacs Original-Received: via spool by 71648-submit@debbugs.gnu.org id=B71648.171881216421468 (code B ref 71648); Wed, 19 Jun 2024 15:50:02 +0000 Original-Received: (at 71648) by debbugs.gnu.org; 19 Jun 2024 15:49:24 +0000 Original-Received: from localhost ([127.0.0.1]:49158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxYq-0005a9-7O for submit@debbugs.gnu.org; Wed, 19 Jun 2024 11:49:24 -0400 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:50409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxYn-0005Zq-AS for 71648@debbugs.gnu.org; Wed, 19 Jun 2024 11:49:22 -0400 Original-Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57cc1c00b97so5886783a12.0 for <71648@debbugs.gnu.org>; Wed, 19 Jun 2024 08:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burkett-cc.20230601.gappssmtp.com; s=20230601; t=1718812092; x=1719416892; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=znRCN38Nv4A3jVvAO3lkl1Z58QTzmfZMe/o5k31lKaA=; b=VnLCn7RVK5IcQtKwUleB8TgTEZfrbRJiWub91ueWOUUfazVaCQD74vhBtx0vPotyeK Q8DlQiO/OneYKuXkkzTPxA8eQN9IERyzLK4dOdUp8FvyQAXF6QxwlLfgrcV27MzHaCU0 cHk1hgpo5QSLALlwZBb2Ppe5sfwO1nLyIpFFoZpF/K+QlTD/d/LBcaxMOQSm5pp9VEf7 fM+9cYdBMY0/do6tHfqO4h+gfsDVvExA4UghzwylpMX0hybHs/yj09zGsn7nGVeoimO0 JW9B/PXWQK3iYwpHXx/X0upH8frROPA5US4PEPUX6wUx7I5A4QiG6Rv+vkStn74ltjAd 8rTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718812092; x=1719416892; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=znRCN38Nv4A3jVvAO3lkl1Z58QTzmfZMe/o5k31lKaA=; b=T8MAAEZ6zkBrVC8SOvEghCnWDV2hXV/SgRDGvbWgREBDqdHwTIozimTJ26u1mr0EEI ewtRqZxkF9u/xxEwKFNd9aQSi3vChMVyFRz2yy2w7aIEXLsz8WAyHgIQhp6K0EGAUdjP UUPYGH1/jmDxHRkK9/gQkJGKPlkhVQFMq1UmaKwZ0LFXsGiKGT2a3UafprUm3YHvz5wh hsLd7ZXb0kzGH7bMjo436Erak6r7spBW9mo2QffZRAadrwV8LgH3lE/3N7JYMomA1Zks RxvzNWDcrSXNxetA/1qYDk8EjCRBITWqm6BjwHQ3ByIclQQrY20AnvOSDOyArs37mxri Mqfw== X-Forwarded-Encrypted: i=1; AJvYcCWfUau5+OLcOgB1mytAmbddgBj2J8dczgNGOokjE7JKTqLkb8LTmApwg4oSvIxmJ3a/OmInBGJPYrNORCLlRPU7KI6UADQ= X-Gm-Message-State: AOJu0Yyd+IBBGEWoRW3a2YhOXnnYYiv+gvEHKhlkfFtFG8N4TEfAk7DM K8KHCrWpDoVUOT11qzcVNRS7GKoYe6+O6917kDUcKF+Pjj0SXfYXQ7dbHH5SQ8xDEAERmrcXenm QG4KGAQzDuE65MCTQVpi8cXAva2DSST09hMYceA== X-Google-Smtp-Source: AGHT+IEeygoeWAtMvVZIFvZjpAGLUArostBIdsoUNyqAHhrp6A80q9WTWREPjNhsE2ZM2Ve7L+g0z/yi/1dltvk+Y1w= X-Received: by 2002:a50:d54a:0:b0:57d:5ab:7a13 with SMTP id 4fb4d7f45d1cf-57d07eab9a7mr1650654a12.34.1718812091982; Wed, 19 Jun 2024 08:48:11 -0700 (PDT) In-Reply-To: <864j9posjg.fsf@gnu.org> 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:287491 Archived-At: On Wed, Jun 19, 2024 at 11:34=E2=80=AFAM Eli Zaretskii wrote= : > > > From: Justin Burkett > > Date: Wed, 19 Jun 2024 11:09:36 -0400 > > Cc: Robert Pluim , Jeremy Bryant , 71648@debbugs.gnu.org > > > > The purpose of which-key was to show the commands that are available > > following an incomplete key sequence. If I understand correctly, these > > maps don't hold commands and anyway would be processed before > > which-key "sees" the current incomplete key sequence. > > Everything in Emacs is a command. The specific sequences Robert was > talking about eventually insert characters, but they are still a > sequence of key events. So I'm not sure I understand how you > distinguish between them and what fundamental differences do you see. > Would you like to elaborate on how and why do you perceive these to be > different? > > > If I understand correctly, if "C-d x" translates to "C-c x" then > > which-key I believe would see the sequence "C-c x" and find the > > bindings following that sequence. I'm not sure how or why we would > > want to display the information that "C-d x" translates to "C-c x". > > I don't think this case is the most important or the most interesting. The purpose of the example was to show my (mis)understanding of how these maps work. I was under the impression from the info manual that translation keymaps map key sequences to other key sequences which are then mapped to "commands" (which might be just text to insert). Quoting the info manual: "When the =E2=80=98read-key-sequence=E2=80=99 function reads a key sequence= (*note Key Sequence Input::), it uses =E2=80=9Ctranslation keymaps=E2=80=9D to transla= te certain event sequences into others. The translation keymaps are =E2=80=98input-decode-map=E2=80=99, =E2=80=98local-function-key-map=E2=80= =99, and =E2=80=98key-translation-map=E2=80=99 (in order of priority). Translation keymaps have the same structure as other keymaps, but are used differently: they specify translations to make while reading key sequences, rather than bindings for complete key sequences. As each key sequence is read, it is checked against each translation keymap. If one of the translation keymaps binds K to a vector V, then whenever K appears as a sub-sequence _anywhere_ in a key sequence, that sub-sequence is replaced with the events in V." This reads to me like translation keymaps don't yield "commands" they act at an intermediate level. In any event, Robert's example was helpful, and I think that information would be useful to include in which-key.