3.3 Class Options

In the options-and-doc arguments to defclass, the following class options may be specified:

:documentation

A documentation string for this class.

If an Emacs-style documentation string is also provided, then this option is ignored. An Emacs-style documentation string is not prefixed by the :documentation tag, and appears after the list of slots, and before the options.

:allow-nil-initform

If this option is non-nil, and the :initform is nil, but the :type is specifies something such as string then allow this to pass. The default is to have this option be off. This is implemented as an alternative to unbound slots.

This option is specific to Emacs, and is not in the CLOS spec.

:abstract

A class which is :abstract cannot be instantiated, and instead is used to define an interface which subclasses should implement.

This option is specific to Emacs, and is not in the CLOS spec.

:custom-groups

This is a list of groups that can be customized within this class. This slot is auto-generated when a class is created and need not be specified. It can be retrieved with the class-option command, however, to see what groups are available.

This option is specific to Emacs, and is not in the CLOS spec.

:method-invocation-order

This controls the order in which method resolution occurs for methods in cases of multiple inheritance. The order affects which method is called first in a tree, and if cl-call-next-method is used, it controls the order in which the stack of methods are run.

Valid values are:

:breadth-first

Search for methods in the class hierarchy in breadth first order. This is the default.

:depth-first

Search for methods in the class hierarchy in a depth first order.

:c3

Searches for methods in a linearized way that most closely matches what CLOS does when a monotonic class structure is defined.

See Method Invocation, for more on method invocation order.

:metaclass

Unsupported CLOS option. Enables the use of a different base class other than standard-class.

:default-initargs

Unsupported CLOS option. Specifies a list of initargs to be used when creating new objects. As far as I can tell, this duplicates the function of :initform.

See CLOS compatibility, for more details on CLOS tags versus EIEIO-specific tags.