unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74829: [PATCH] Show the keybinding next to command in calc's x
@ 2024-12-12 13:29 Visuwesh
  2024-12-21  9:38 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Visuwesh @ 2024-12-12 13:29 UTC (permalink / raw)
  To: 74829

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Show-the-keybinding-next-to-command-in-calc-s-x.patch --]
[-- Type: text/patch, Size: 1267 bytes --]

From 42d5d91d9fa31ad0f42ece300a869a0e22343e46 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#74829: [PATCH] Show the keybinding next to command in calc's x
  2024-12-12 13:29 bug#74829: [PATCH] Show the keybinding next to command in calc's x Visuwesh
@ 2024-12-21  9:38 ` Eli Zaretskii
  2024-12-21  9:51   ` Visuwesh
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-12-21  9:38 UTC (permalink / raw)
  To: Visuwesh; +Cc: 74829

> From: Visuwesh <visuweshm@gmail.com>
> Date: Thu, 12 Dec 2024 18:59:44 +0530
> 
> Attached patch uses M-x's :affixation-function to show the keybinding
> next to the command's name in calc's x command.

Thanks.  Can you describe the effect of this change in Calc usage?
That is, what will users see after the change that they didn't see
before it?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#74829: [PATCH] Show the keybinding next to command in calc's x
  2024-12-21  9:38 ` Eli Zaretskii
@ 2024-12-21  9:51   ` Visuwesh
  2024-12-26  8:24     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Visuwesh @ 2024-12-21  9:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74829

[சனி டிசம்பர் 21, 2024] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm@gmail.com>
>> Date: Thu, 12 Dec 2024 18:59:44 +0530
>> 
>> Attached patch uses M-x's :affixation-function to show the keybinding
>> next to the command's name in calc's x command.
>
> Thanks.  Can you describe the effect of this change in Calc usage?
> That is, what will users see after the change that they didn't see
> before it?

Without the patch, x TAB in the Calc buffer shows in the *Completions*
buffer:

    calc-abs
    calc-abssqr

etc.  But with this patch, it instead shows

    calc-abs (A)
    calc-abssqr (fA)

as calc-abs is bound to the key 'A' (C-h w calc-abs RET confirms this).
This is similar to how M-x displays the keybinding next to the command
name in the *Completions* buffer.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#74829: [PATCH] Show the keybinding next to command in calc's x
  2024-12-21  9:51   ` Visuwesh
@ 2024-12-26  8:24     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-12-26  8:24 UTC (permalink / raw)
  To: Visuwesh; +Cc: 74829-done

> From: Visuwesh <visuweshm@gmail.com>
> Cc: 74829@debbugs.gnu.org
> Date: Sat, 21 Dec 2024 15:21:47 +0530
> 
> [சனி டிசம்பர் 21, 2024] Eli Zaretskii wrote:
> 
> >> From: Visuwesh <visuweshm@gmail.com>
> >> Date: Thu, 12 Dec 2024 18:59:44 +0530
> >> 
> >> Attached patch uses M-x's :affixation-function to show the keybinding
> >> next to the command's name in calc's x command.
> >
> > Thanks.  Can you describe the effect of this change in Calc usage?
> > That is, what will users see after the change that they didn't see
> > before it?
> 
> Without the patch, x TAB in the Calc buffer shows in the *Completions*
> buffer:
> 
>     calc-abs
>     calc-abssqr
> 
> etc.  But with this patch, it instead shows
> 
>     calc-abs (A)
>     calc-abssqr (fA)
> 
> as calc-abs is bound to the key 'A' (C-h w calc-abs RET confirms this).
> This is similar to how M-x displays the keybinding next to the command
> name in the *Completions* buffer.

Thanks, installed on the master branch, and closing the bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-26  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 13:29 bug#74829: [PATCH] Show the keybinding next to command in calc's x Visuwesh
2024-12-21  9:38 ` Eli Zaretskii
2024-12-21  9:51   ` Visuwesh
2024-12-26  8:24     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).