Function: define-overload

define-overload is a for define-overloadable-function, defined in mode-local.el.gz.

This macro is obsolete since 27.1; use define-overloadable-function instead.

Signature

(define-overload NAME ARGS DOCSTRING &rest BODY)

Documentation

Define a new function, as with defun, which can be overloaded.

NAME is the name of the function to create. ARGS are the arguments to the function. DOCSTRING is a documentation string to describe the function. The docstring will automatically have details about its overload symbol appended to the end. BODY is code that would be run when there is no override defined. The default is to call the function NAME-default with the appropriate arguments.

BODY can also include an override form that specifies which part of BODY is specifically overridden. This permits specifying common code run for both default and overridden implementations. An override form is one of:

  1. (:override [OVERBODY])
  2. (:override-with-args OVERARGS [OVERBODY])

OVERBODY is the code that would be run when there is no override defined. The default is to call the function NAME-default with the appropriate arguments deduced from ARGS. OVERARGS is a list of arguments passed to the override and NAME-default function, in place of those deduced from ARGS.

Probably introduced at or before Emacs version 27.1.

Aliases

define-overload (obsolete since 27.1)