|
From: | Jim Porter |
Subject: | Re: [WIP PATCH] Adding keys to keymaps in alphabetical order (for use with `mode-line-mode-menu') |
Date: | Sun, 20 Jun 2021 22:31:44 -0700 |
On 6/19/2021 5:31 AM, Lars Ingebrigtsen wrote:
Jim Porter <jporterbugs@gmail.com> writes:I've attached a simple patch that fixes this by adding a `define-key-sorted' function. I imagine it still needs some work to handle more complex cases, but it works well enough for `mode-line-mode-menu'.Hm... instead of adding a new function, perhaps it would make more sense to just make the mode menu sort entries before displaying?
That would also work, and have the added benefit that it's resilient even if a package neglects to use `define-key-sorted'.
I'll look into the best way to trigger a sort just before opening the menu. Ideally, we could avoid re-sorting every time (unless the list has changed), but that might be more work than it's worth, given that the list is unlikely to be more than a few dozen elements.
- Jim
[Prev in Thread] | Current Thread | [Next in Thread] |