From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#74829: [PATCH] Show the keybinding next to command in calc's x Date: Thu, 12 Dec 2024 18:59:44 +0530 Message-ID: <8734itjagn.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="17984"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 74829@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 12 14:33:43 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 1tLjK1-0004Qn-M2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 14:33:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLjJR-00009Y-Vq; Thu, 12 Dec 2024 08:33:06 -0500 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 1tLjJP-00009H-Lg for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 08:33:04 -0500 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 1tLjJP-0008L5-DB for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 08:33:03 -0500 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:From:To:Subject; bh=Z6C+ZqI+gOBPZ8fypu8S/xxPYyflQ7j3R5cLeJYF2jk=; b=mDSlCa58FJf0JMuSaUHnImJfGOVP3uwLL/a62rydIEhAOLZV1lPGTVZAC4gcH4GIi7kQdYOaqAesmKl0N+FZwHu+gFYnZZBQj9U9OHxvv/ss8weOsC8lE12d5btWV3njKNYBWQvK3PCJ/mlsxiGmQsjVIr1P47GrOrY8DXZmBnILUwTO8m2+fmNvWD9HF3j/tf7dMJVpv6mn+e2tvdu+g3aQWbZTjng4H6eBdcf5XraWFyPA2gmzTQcl0K2R1KApGxbiYmpVUjWblc92aL31yAswSMlgBtL08v+qMAHoD8AdT/5antJjV9oE/bh+VE3jUpivwJVPagn6h0EBn7E3gA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLjJO-0000uA-7c for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 08:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Dec 2024 13:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17340103373385 (code B ref -1); Thu, 12 Dec 2024 13:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Dec 2024 13:32:17 +0000 Original-Received: from localhost ([127.0.0.1]:38196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLjIf-0000sW-69 for submit@debbugs.gnu.org; Thu, 12 Dec 2024 08:32:17 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLjIa-0000sJ-TB for submit@debbugs.gnu.org; Thu, 12 Dec 2024 08:32:15 -0500 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 1tLjGQ-0007Pp-R9 for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 08:29:58 -0500 Original-Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLjGJ-0006fm-OL for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 08:29:55 -0500 Original-Received: by mail-pj1-x1043.google.com with SMTP id 98e67ed59e1d1-2ee8e8e29f6so463115a91.0 for ; Thu, 12 Dec 2024 05:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734010189; x=1734614989; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=Z6C+ZqI+gOBPZ8fypu8S/xxPYyflQ7j3R5cLeJYF2jk=; b=lyjv/glJb55PaiNwuDvv28PStL131jSCXYBvN5NnroCfqEcfMXnFBFVHFl7rJtRZ/Y X+XIvEftUQftoik+dhC5pBB28HShQzXQU45Cj+VsMTYzcurjH08P2OvpqLHycm25JhaA wipSpZ6JxyRcGfn3ek53lJ+8zFxJYJ/wRtJQFbxcAPw5TdiJHGhBh6QVn6+r01YR67Vv x9WWiZuSuLoubHvIfTEnB0UaeHfdN9ioEluy9zJQpl/FWXV7/Los1BZdMlxS5pJSWdnr 9xbWMJZyAcYIiK0Z4iQHEp2V0jADL2A0PITI5IjKpGRjPtInahzCkJeRkkb30D0InnA0 95sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734010189; x=1734614989; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z6C+ZqI+gOBPZ8fypu8S/xxPYyflQ7j3R5cLeJYF2jk=; b=CyblU7+HlSYh7UnuPmPyOulMIcH/LOYUuNXN/VsXSUxLI0tq01Dleqe3/m+x0gDt/P QkHhsNZGxLAvB9h3BvDZJG/1096il1SIsZK8wPTZ0A+zxcgRrz7LbtAeARguc1AGmMft gdzkUEuLCnn4rNdGxh19jy+uJUOhj4VkbEl3Zp7CEwxokHnT2pvc7NvXXDJw4RGHKlVA Enpi1/R3hYRYim6xTZBhLdiRB0FxCHPsfgqOdStSOWh00gNdRW0f1FAo2jDBw6obs2Am ZMqMP3KuTAvWStRRQ+rck0zsF7i3T+wfVqNgywv1JC96+utMdjRbolp1YBjA3YjLM4qV /OhA== X-Gm-Message-State: AOJu0Yzlj5bGM5/HGbuuR1jZC2orQCdVNBAtDBxLnGmF4JcC5VXu9mdp QJTrg4Xixhbv8Ff/AJ1ctcg/9l3QhZx1hDQ+bF4zplDOadCaJc55eOPL4DR+ X-Gm-Gg: ASbGncutxC2iSs2m8a95dC3LpAJt865ThqwdohO6y7kEIngrr5/7YqwZWN3VvcVeswt t20BAa23WTEuOyzRVcWdSZjkNp5DxwTqgaaZU8VomZw1S9ozmVdcujx3F73f4rOmlro5LFejspF fylldTfivUkkOSSLfuZgCKK2fXLAuydlLo5zMK41bxpS6Rh5qDCbHh9gORV1TBRggUJpLywzmcv EVFG0GSm/nRit8JFxBku7d61CXuQ6rZsvKJxsXAOx6lwBLMuOA3TA== X-Google-Smtp-Source: AGHT+IEFdV8QnmjYsbfdq1GqOTgvk9pMHIAx4LJoEY2idh5PQiN5c7BihuRrLdwDWIuNKYUM4AQ63A== X-Received: by 2002:a17:90b:224c:b0:2ee:a6f0:f54 with SMTP id 98e67ed59e1d1-2f127fb5d43mr9937105a91.13.1734010189297; Thu, 12 Dec 2024 05:29:49 -0800 (PST) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d91a01sm1237712a91.8.2024.12.12.05.29.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 05:29:48 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1043.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:296913 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Attached patch uses M-x's :affixation-function to show the keybinding next to the command's name in calc's x command. In GNU Emacs 31.0.50 (build 27, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.2, Xaw scroll bars) of 2024-12-07 built on astatine Repository revision: 9ddec89e422d0dd6e9069731b8f2dd2c90aa5607 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d --without-gconf --without-libsystemd --with-cairo CFLAGS=-g3' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Show-the-keybinding-next-to-command-in-calc-s-x.patch >From 42d5d91d9fa31ad0f42ece300a869a0e22343e46 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 12 Dec 2024 18:58:37 +0530 Subject: [PATCH] Show the keybinding next to command in calc's x * lisp/calc/calc-ext.el (calc-execute-extended-command): Use M-x's :affixation-function to show the keybinding of the calc command next to its name. --- lisp/calc/calc-ext.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 25d2492b277..0cbd02be657 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1728,8 +1728,11 @@ calc-execute-extended-command (interactive "P") (let* ((prompt (concat (calc-num-prefix-name n) "M-x ")) (cmd (intern - (completing-read prompt obarray 'commandp t "calc-" - 'calc-extended-command-history)))) + (let ((completion-extra-properties + (list :affixation-function + #'read-extended-command--affixation))) + (completing-read prompt obarray 'commandp t "calc-" + 'calc-extended-command-history))))) (setq prefix-arg n) (command-execute cmd))) -- 2.45.2 --=-=-=--