GNU bug report logs -
#50067
Context menus
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 15 Aug 2021 08:52:01 UTC
Severity: normal
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> ** no multiple horizontal lines
>>>
>>> Sometimes I see double lines on the context menu. I think that there is
>>> no useful case to have double lines. To allow only one horizontal line
>>> would look cool.
>>
>> Right, double separators should be removed.
>
> OK.
This is not easy to do. Because there are menu-items
that use the filter :visible, e.g.:
(defun prog-context-menu (menu)
(require 'xref)
(define-key-after menu [prog-separator] menu-bar-separator
'mark-whole-buffer)
(define-key-after menu [xref-find-def]
'(menu-item "Find Definition" xref-find-definitions-at-mouse
:visible (save-excursion
(mouse-set-point last-input-event)
(xref-backend-identifier-at-point
(xref-find-backend)))
:help "Find definition of identifier")
'prog-separator)
So it's not known whether the menu-item will be displayed
until the menu is displayed. So there is no way to remove
a stray separator in the context-menu function that creates
the context menu.
Maybe such items should be rewritten to avoid the filter :visible,
e.g.:
(defun prog-context-menu (menu)
(require 'xref)
(define-key-after menu [prog-separator] menu-bar-separator
'mark-whole-buffer)
(when (save-excursion
(mouse-set-point last-input-event)
(xref-backend-identifier-at-point
(xref-find-backend)))
(define-key-after menu [xref-find-def]
'(menu-item "Find Definition" xref-find-definitions-at-mouse
:help "Find definition of identifier")
'prog-separator))
This bug report was last modified 3 years and 171 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.