How is a separator added to the main toolbar? I have no trouble adding an icon/item with tool-bar-add-item but can't find a way to add a separator.

  • I removed tag [menu-bar]. Did you mean tool-bar or menu-bar?
    – Drew
    Sep 3, 2020 at 4:41
  • What do you mean by "separator", here? Just some visible indication, e.g., to group icons? If so, you can probably just add an icon that looks like a separator, for a pseudo-tool that does nothing.
    – Drew
    Sep 3, 2020 at 4:43
  • If you really do mean menu-bar, and not tool-bar, then see MenuBar+ (code). It provides a menu-bar divider, to separate local from global menus. You might check its code, for one way to do that. Look for menu-bar-divider-menu in the code.
    – Drew
    Sep 3, 2020 at 4:49

1 Answer 1


I have found how to do this. I had experimented with this before posting the question but thought that it didn't work because the toolbar is not automatically redrawn. The following does work.

(define-key-after (default-value 'tool-bar-map)
    [separator-4] menu-bar-separator) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.