A menu separator is a kind of menu item that doesn’t display any text—instead, it divides the menu into subparts with a horizontal line. A separator looks like this in the menu keymap:
where separator-type is a string starting with two or more dashes.
In the simplest case, separator-type consists of only dashes.
That specifies the default kind of separator. (For compatibility,
- also count as separators.)
Certain other values of separator-type specify a different style of separator. Here is a table of them:
An extra vertical space, with no actual line.
A single line in the menu’s foreground color.
A double line in the menu’s foreground color.
A single dashed line in the menu’s foreground color.
A double dashed line in the menu’s foreground color.
A single line with a 3D sunken appearance. This is the default, used separators consisting of dashes only.
A single line with a 3D raised appearance.
A single dashed line with a 3D sunken appearance.
A single dashed line with a 3D raised appearance.
Two lines with a 3D sunken appearance.
Two lines with a 3D raised appearance.
Two dashed lines with a 3D sunken appearance.
Two dashed lines with a 3D raised appearance.
You can also give these names in another style, adding a colon after
the double-dash and replacing each single dash with capitalization of
the following word. Thus,
"--:singleLine", is equivalent to
You can use a longer form to specify keywords such as
:visible for a menu separator:
(menu-item separator-type nil . item-property-list)
(menu-item "--" nil :visible (boundp 'foo))
Some systems and display toolkits don’t really handle all of these separator types. If you use a type that isn’t supported, the menu displays a similar kind of separator that is supported.