Currently, there's not a simple way of inserting a key binding into a keymap in alphabetical order. This would be nice for `mode-line-mode-menu'; to see the issue, you can run the following: emacs -Q ;; on the mode name in the mode-line ;; See the nice alphabetical list M-x ruler-mode ;; on the mode name in the mode-line again ;; "Ruler" is first(?!) I believe `ruler-mode' is the only place in Emacs itself that has this issue, but third-party packages (or user configs) might want to add to `mode-line-mode-menu'. For example, I prefer to get rid of the mode-line lighter for `company-mode' and put an item for it into `mode-line-mode-menu' for the rare times I want to check/change its status. Especially with packages that get loaded after startup, the current behavior could be somewhat confusing since the order items are added to the menu can vary. 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'. - Jim