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.
Asked
Active
Viewed 117 times
1
-
I removed tag [menu-bar]. Did you mean tool-bar or menu-bar? – Drew Sep 03 '20 at 04: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 03 '20 at 04:43
-
If you really do mean menu-bar, and not tool-bar, then see [MenuBar+](https://www.emacswiki.org/emacs/MenuBarPlus) ([code](https://www.emacswiki.org/emacs/download/menu-bar%2b.el)). 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 03 '20 at 04:49
1 Answers
3
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)

David McCracken
- 111
- 6