>> Ok, I could add display-sort-function directly to the imenu completing-read >> that will depend on the value of display-sort-function. Then there will be >> no need to change the manual. > > Except we should then remove the reference to "menus", right? Because > if you do that, the customization of sorting order will affect both > the menus and the completion, right? Indeed, this will require removing the reference to the mouse menus. But when I tried to use imenu-sort-function for sorting the completions, I found a problem that makes such change impossible. The problem is that the default value of imenu-sort-function is nil. This means that by default the items on the mouse menu are unsorted. But the completions are sorted, and we can't change this default behavior. Therefore, imenu-sort-function can't define how the completions are sorted. So this is just a documentation task that is done in this patch: