GNU bug report logs - #70576
[PATCH] `repeat-echo-message-string': support repeat keymap "hints"

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Thu, 25 Apr 2024 22:33:05 UTC

Severity: normal

Tags: fixed, moreinfo, patch

Found in version 30.0.5

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 70576 <at> debbugs.gnu.org (full text, mbox):

From: JD Smith <jdtsmith <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 70576 <at> debbugs.gnu.org
Subject: Re: bug#70576: [PATCH] `repeat-echo-message-string': support repeat
 keymap "hints"
Date: Sun, 28 Apr 2024 08:45:19 -0400
[Message part 1 (text/plain, inline)]

> On Apr 28, 2024, at 2:58 AM, Juri Linkov <juri <at> linkov.net> wrote
>> Of course a new wrapper macro could also be developed to ease this.
>> Do you anticipate any specific issues?
> 
> Here is what I recommend to do to simplify the definition of hints for users.
> 
> Like there can be a list of enter and exit commands in 'defvar-keymap':
> 
>  :repeat ‘(:enter (commands ...) :exit (commands ...))’
> 
> the same list could be used for hints:
> 
>  :repeat ‘(:enter (commands ...) :exit (commands ...) :hints ((command . hint) ...))’
> 
> This should be easier to document and to understand by users than
> a special syntax of cons for binding and the requirement to add :name.

Though it will require repetition and thus be subject to changed-here-but-not-there errors, this does look good and nicely groups the information under :repeat.  So this should work for all commands in the keymap:

> (defvar-keymap expreg-repeat-map
>    :doc "Repeat map for `expreg' actions."
>    :repeat '(:hints ((expreg-expand . "expand") (expreg-contract . "contract")))
>    "\\" 'expreg-expand
>    "|"  'expreg-contract)


If a hint is missing for a command, it should just have its key mentioned.  It looks like your idea would require changes to defvar-keymap.  Do you want to propose a patch?  We'd need some way to pass the hints in; perhaps the macro could set a property on the command symbol as you initially proposed.
[Message part 2 (text/html, inline)]

This bug report was last modified 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.