diff options
author | Manuel Giraud <manuel@ledu-giraud.fr> | 2022-11-18 22:58:19 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2022-11-25 00:53:16 +0100 |
commit | 2b123edcf6704952447dcba95c18f324397c17c6 (patch) | |
tree | 9da9520cab4364aa7aa59232e59b2578e3e268f6 /lisp/emacs-lisp | |
parent | b0fa3b1a1f31c158131325f0f451c960ec54d938 (diff) | |
download | emacs-2b123edcf6704952447dcba95c18f324397c17c6.tar.gz emacs-2b123edcf6704952447dcba95c18f324397c17c6.tar.bz2 emacs-2b123edcf6704952447dcba95c18f324397c17c6.zip |
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)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easymenu.el | 11 |
1 files 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'. |