[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode
From: |
Jim Porter |
Subject: |
bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode |
Date: |
Thu, 2 Dec 2021 10:47:06 -0800 |
On 12/1/2021 10:06 PM, Jim Porter wrote:
Sometimes, menu separators are doubled up in context-menu-mode.
I found another odd case, but I'm not 100% sure the best way to fix it:
emacs -Q --eval '(context-menu-mode)'
C-h o identity RET
;; Right-click somewhere in the Help buffer
There's a doubled separator after "Next Topic". Looking at the code,
this is because `help-mode-context-menu' inserts new items using
`define-key', which has the effect of putting the new items *before* the
(hidden) menu title. The resulting keymap ends up looking like this:
(keymap
(Previous\ Topic ...)
(Next\ Topic ...)
(help-mode-separator "--")
#("Context Menu" 0 12 (hide t))
(separator-undo "--")
...)
Since there's a hidden item (the keymap title) between the
`help-mode-separator' and `separator-undo'[1], the de-duplication
doesn't handle that. Is there a standard/common way of defining a key
such that it goes immediately *after* the keymap's title? I guess we
could add `context-menu-top-separator' as an anchor (by analogy to
`context-menu-middle-separator'), but maybe there's a simpler way...
[1] As an aside, is there a standard naming convention to use here?
Should "separator" go at the beginning of the name or the end?
bug#52237: [External] : bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode, Drew Adams, 2021/12/02
bug#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode,
Jim Porter <=