Ensure there are no duplicate separators when creating a context menu
Previously, if there were three or more consecutive menu separators, not all of them would be removed. * lisp/mouse.el (context-menu-map): Ensure no duplicate separators (bug#52237).
This commit is contained in:
parent
d353c08d2b
commit
5db380abad
1 changed files with 4 additions and 4 deletions
|
@ -330,10 +330,10 @@ the function `context-menu-filter-function'."
|
|||
;; Remove duplicate separators
|
||||
(let ((l menu))
|
||||
(while (consp l)
|
||||
(when (and (equal (cdr-safe (car l)) menu-bar-separator)
|
||||
(equal (cdr-safe (cadr l)) menu-bar-separator))
|
||||
(setcdr l (cddr l)))
|
||||
(setq l (cdr l))))
|
||||
(if (and (equal (cdr-safe (car l)) menu-bar-separator)
|
||||
(equal (cdr-safe (cadr l)) menu-bar-separator))
|
||||
(setcdr l (cddr l))
|
||||
(setq l (cdr l)))))
|
||||
|
||||
(when (functionp context-menu-filter-function)
|
||||
(setq menu (funcall context-menu-filter-function menu click)))
|
||||
|
|
Loading…
Add table
Reference in a new issue