Subject: Re: bug#52293: 29.0.50; [PATCH v2] Prevent further cases of duplicated separators in context menus

From: Juri Linkov <[email-masked]>
Date: Tue, 07 Dec 2021 10:19:20 +0200

> For the top separator, maybe instead of providing a function for users to
> put wherever they like in `context-menu-functions', we could just add it
> directly in `context-menu-map' immediately before calling the functions in
> `context-menu-functions'? Since it's supposed to be at the top, it doesn't
> make a lot of sense to be able to customize where it goes.
>
> It does makes sense to customize where `middle-separator' goes though; what
> the user considers the "middle" depends on what other menu items are
> normally present. However, if the user didn't include
> `context-menu-middle-separator', then
>
>   (define-key-after menu [foo] '(menu-item ...) 'middle-separator)
>
> just adds `foo' to the end of the menu. That seems ok to me. Then, adding
> after `top-separator' puts your item at the beginning of the menu, and
> adding after `middle-separator' puts your item at the middle or the end,
> depending on the user's configuration. How does that sound to you?

Thanks, this makes perfect sense.  I vote for pushing this to emacs-28,
so the authors of packages could rely on this scheme.