1

I really like easy-menu but have discovered an item separator problem; a minimum working example is given below. When I hybrid define-key-after with easy-menu-add-item, the item separators in the "Words and Lines" submenu are fine. However in the primary menu, "My-XEditing", the second item separator is missing.

Apparently, using this approach, easy-menu will only allow one item separator in the primary menu. Since this is the only easy-menu problem that I have, I want to avoid having to delve through elisp (keymaps). My guess is that a workaround might be found by grafting on easy-menu-define, but I can't figure out how.

(define-key-after global-map [menu-bar my-xediting]
    (cons "My-XEditing" (make-sparse-keymap "My-XEditing")))
(easy-menu-add-item nil '("My-XEditing") 
    ["Move Character Forward" forward-char t])
(easy-menu-add-item nil '("My-XEditing") "--")
(easy-menu-add-item nil '("My-XEditing") 
    ["Move Character Backward" backward-char t])
(easy-menu-add-item nil '("My-XEditing") "--")
(easy-menu-add-item nil '("My-XEditing")
    (easy-menu-create-menu "Words and Lines"
        '(["Move Word Backward" backward-word t]
        "--"
        ["Move Word Forward" forward-word t]
        "--"
        ["Move Line Backward" previous-line t]
        "--"
        ["Move Line Forward" next-line t])))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.