From 2b123edcf6704952447dcba95c18f324397c17c6 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 18 Nov 2022 22:58:19 +0100 Subject: [PATCH] Fix easy menu separator in oldXMenu * lisp/emacs-lisp/easymenu.el (easy-menu-convert-item-1): Replace a string of dash with a menu separator as the doc says. (Bug#59370) --- lisp/emacs-lisp/easymenu.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 41e3a197af4..2a45c1ab1cc 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -390,10 +390,13 @@ ITEM defines an item as in `easy-menu-define'." (let ((key (easy-menu-intern name))) (cons key (and (not remove) - (cons 'menu-item - (cons label - (and name - (cons command prop))))))))) + (if (and (stringp label) + (seq-every-p (lambda (c) (char-equal c ?-)) label)) + menu-bar-separator + (cons 'menu-item + (cons label + (and name + (cons command prop)))))))))) (defun easy-menu-define-key (menu key item &optional before) "Add binding in MENU for KEY => ITEM. Similar to `define-key-after'. -- 2.39.2