Previous: Suffix Slots, Up: Classes and Methods [Contents][Index]
Suffix and group objects share two sets of predicate slots that control whether a group or suffix should be available depending on some state. Only one slot from each set can be used at the same time. It is undefined which slot is honored if you use more than one.
Predicates from the first group control whether the suffix is present in the menu at all.
if
Enable if predicate returns non-nil
.
if-not
Enable if predicate returns nil
.
if-non-nil
Enable if variable’s value is non-nil
.
if-nil
Enable if variable’s value is nil
.
if-mode
Enable if major-mode matches value.
if-not-mode
Enable if major-mode does not match value.
if-derived
Enable if major-mode derives from value.
if-not-derived
Enable if major-mode does not derive from value.
Predicates from the second group control whether the suffix can be invoked. The suffix is shown in the menu regardless, but when it is considered "inapt", then it is grayed out to indicated that it currently cannot be invoked.
inapt-if
Inapt if predicate returns non-nil
.
inapt-if-not
Inapt if predicate returns nil
.
inapt-if-non-nil
Inapt if variable’s value is non-nil
.
inapt-if-nil
Inapt if variable’s value is nil
.
inapt-if-mode
Inapt if major-mode matches value.
inapt-if-not-mode
Inapt if major-mode does not match value.
inapt-if-derived
Inapt if major-mode derives from value.
inapt-if-not-derived
Inapt if major-mode does not derive from value.
By default these predicates run when the prefix command is invoked,
but this can be changes, using the refresh-suffixes
prefix slot.
See Prefix Slots.
One more slot is shared between group and suffix classes, level
. Like
the slots documented above, it is a predicate, but it is used for a
different purpose. The value has to be an integer between 1
and 7. level
controls whether a suffix or a group should be
available depending on user preference.
See Enabling and Disabling Suffixes.
Previous: Suffix Slots, Up: Classes and Methods [Contents][Index]