emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ideas to improve the output of C-h m?


From: Clément Pit-Claudel
Subject: Re: Ideas to improve the output of C-h m?
Date: Fri, 1 May 2020 23:24:04 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Hi Stefan,

On 01/05/2020 19.02, Stefan Kangas wrote:
> Thank you for working on this.  I like the look of the screenshot, but
> you didn't include a patch.  If you could provide one, I may be able
> to give you more useful feedback on the basis of testing it.

Thanks a lot for having a look.  I have attached the code; this version is 
extracted from biblio.el, for which it was originally written.  After loading 
it you should be able to use M-x help-with-major-mode and M-: (help-with-keymap 
occur-mode-map), for example.

There are shortcomings in the current implementation (it iterates over nested 
keymaps to flatten them, and that part is likely incomplete), including the 
fact that it displays <remap …> rather than actual keybindings when a keymap 
includes remapping.  All of these would have to be ironed out as part of 
turning this into a patch extending the existing facilities, of course.

> One related idea comes to mind: (…)> It would be useful, I think, if the mode 
> author was able to customize
> the listing of commands while also "automatically" using the best
> standard for displaying them (with the added faces, indentation, etc.
> as you suggest) rather than having to write a doc string manually to
> achieve it.  For example, maybe we could come up with a way to group
> commands by categories and then have them displayed under proper
> headlines in key binding listings.

Yes, that would be great.  If the current discussion does get somewhere, it 
would be a natural next step to work on, I think.

> Footnotes:
> 1. As an aside, I have started converting 'substite-command-keys' from
> C to Lisp some time ago, but I got stuck somewhere and didn't complete
> it.  I hope I can find the energy and time to finish that job.

I think they may be some overlap with the code I posted, as I had to write much 
of the iteration over keymaps from scratch.  Maybe both implementations can 
benefit from each other and we can get something done together.  Or maybe I can 
be the first client of your new code :)

Cheers,
Clément.

Attachment: help-with-major-mode.el
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]