From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#71648: 30.0.50; Allow which-key to report on translation bindings Date: Mon, 24 Jun 2024 15:14:34 +0200 Message-ID: <87a5jabhz9.fsf@gmail.com> References: <87plsdxhnw.fsf@gmail.com> <867celoz4q.fsf@gnu.org> <864j9posjg.fsf@gnu.org> <87v824vx14.fsf@gmail.com> <87msnfwtma.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71648@debbugs.gnu.org, Eli Zaretskii , jb@jeremybryant.net To: Justin Burkett Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 24 15:16:31 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 1sLjYd-0009rB-Ae for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 15:16:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLjYB-00041W-He; Mon, 24 Jun 2024 09:16:03 -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 1sLjY9-0003wn-H7 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 09:16:01 -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 1sLjY9-0005Yu-6q for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 09:16:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLjY9-00036O-Pe for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 09:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2024 13:16:01 +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.171923494511882 (code B ref 71648); Mon, 24 Jun 2024 13:16:01 +0000 Original-Received: (at 71648) by debbugs.gnu.org; 24 Jun 2024 13:15:45 +0000 Original-Received: from localhost ([127.0.0.1]:57284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLjXs-00035a-RC for submit@debbugs.gnu.org; Mon, 24 Jun 2024 09:15:45 -0400 Original-Received: from mail-wr1-f46.google.com ([209.85.221.46]:60465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLjXr-00035D-2n for 71648@debbugs.gnu.org; Mon, 24 Jun 2024 09:15:43 -0400 Original-Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3608e6d14b6so2866691f8f.0 for <71648@debbugs.gnu.org>; Mon, 24 Jun 2024 06:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719234876; x=1719839676; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Fr257C/ZSBr2rrrMm2sUpQlqsBanv17Xst/Z4lNX7D0=; b=Ol0TVCOqjWOBPvM+aJGRTjs5yEWeHqV35e+N8Q8+KkCOcoWJa8YvZlmTicVKd5qcb8 vnZYQpxQahn7p3Wt6RrTi6zmzq4UWurU9rGmZkVT4wGrrWVB8Elopmg30+n7p1aUKAAP if+Mj33PQBezwFasQt8wrU4Gj9JXQJFwDNYUG1f3x9wCgiq/9iaN+3gmba70Mo5sVmfp 5PomW1BUqCdt2wMAx7m7/O33aYTHAcaDwq1NPI+DiEFGh9zsXvXgzXuXc7nvAI1Ca/kt TGdFqQSDRHILbUxp8TasVdW6Pfeoak/eWOd7NySdv/7TGD55FAMdn3yDK1Ka1d3M18Uv L2Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719234876; x=1719839676; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fr257C/ZSBr2rrrMm2sUpQlqsBanv17Xst/Z4lNX7D0=; b=TpEb2/YMXfezaCQGnNOpv900gVoVbJB/bv1pmV4ADwZ0KW04LNIcqlNdTCt7emaP5j udCVSunfRoouwIY56eRqOQjVAwyQbpp6tOsl4GXC/v1WSYbB5wAnwjcRZItT8hcYJne8 jjU9B+t1PJDN801PTfVqE5sdBHCNSYPFdjbCYYC/YnW+OaNj4H+ziRVQDDGZAvasEWSf tybsZnQYB3RhtTnGKUMn7CfQXd+og8UoBJ1fZ+P7sI12ujFwOoG2T3YJOs4BNijHOfFr Oul3i3jz6Vr3qBCDj0fgBV3zi1W4T8k8ilURi+M/DIdQqsHoKso/Imfr7dqvstzNIA30 aZ6A== X-Gm-Message-State: AOJu0YzlBsDU1YjpztHMzO/+ZJ/P5r3ogYDkO/cqMRnFQVE3/DnpV2fB pQQhB/VjC1AvuV4WK8FZICJOQHDiCmtqWF1o6gxe6hi2zHWW++pvSPu3fw== X-Google-Smtp-Source: AGHT+IE1xuOt/ZH2mV2wxmpfZlItsxjj3yhgrpyhgRHaytDARdH8iXxm/dY0uMi7YY0I+0ETAFf34A== X-Received: by 2002:adf:a382:0:b0:362:f291:6f90 with SMTP id ffacd0b85a97d-366e9652bcemr2684999f8f.60.1719234875861; Mon, 24 Jun 2024 06:14:35 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3666dc46d50sm9699994f8f.67.2024.06.24.06.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 06:14:35 -0700 (PDT) In-Reply-To: (Justin Burkett's message of "Thu, 20 Jun 2024 11:40:57 -0400") 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:287839 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Thu, 20 Jun 2024 11:40:57 -0400, Justin Burkett said: Justin> That seems reasonable enough. How about doing both? Add the opt= ion and Justin> use key-translation-map for the default value. Patch against emacs-30 attached. Since which-key is new in emacs-30, I=CA=BCm assuming a NEWS entry is not required for this specific change. Eli, let me know if it should go to master instead. Robert --=20 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Show-entries-from-key-translation-map-in-which-key-m.patch >From d6dd58a0c75affb9ff18b4974ca5f4cd56eb2604 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Mon, 24 Jun 2024 15:09:00 +0200 Subject: [PATCH] Show entries from key-translation-map in which-key mode To: emacs-devel@gnu.org * lisp/which-key.el (which-key-extra-keymaps): New user option. (which-key--get-current-bindings): Consult it. (Bug#71648) --- lisp/which-key.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/which-key.el b/lisp/which-key.el index 91007ce4ada..a5075b3ba69 100644 --- a/lisp/which-key.el +++ b/lisp/which-key.el @@ -233,6 +233,15 @@ which-key-show-docstrings (const :tag "Replace command name with docstring" docstring-only)) :package-version "1.0" :version "30.1") +(defcustom which-key-extra-keymaps '(key-translation-map) + "List of extra keymaps to show entries from. +The default is to check `key-translation-map', which contains the +\\='C-x 8' bindings for entering common characters." + :type '(choice (list :tag "Translation map" (const key-translation-map)) + (const :tag "None" nil) + (repeat :tag "Custom" symbol)) + :package-version "1.0" :version "30.1") + (defcustom which-key-highlighted-command-list '() "Rules used to highlight certain commands. If the element is a string, assume it is a regexp pattern for @@ -1942,8 +1951,10 @@ which-key--get-keymap-bindings (defun which-key--get-current-bindings (&optional prefix filter) "Generate a list of current active bindings." - (let (bindings) - (dolist (map (current-active-maps t) bindings) + (let (bindings + (maps (nconc (current-active-maps t) + (mapcar #'symbol-value which-key-extra-keymaps)))) + (dolist (map maps bindings) (when (cdr map) (setq bindings (which-key--get-keymap-bindings -- 2.39.2 --=-=-=--