Does Elisp allow the equivalent of an alias for a function name?
1 Answers
Yes. You can have any number of aliases for the same function.
To do that, use defalias
(or fset
, but defalias
is generally recommended).
Example: define mop
as an alias for means-of-production
.
(defalias 'mop 'means-of-production)
C-h f defalias
says:
defalias
is a built-in function inC source code
.(defalias SYMBOL DEFINITION &optional DOCSTRING)
Set
SYMBOL
's function definition toDEFINITION
.Associates the function with the current load file, if any.
The optional third argument
DOCSTRING
specifies the documentation string forSYMBOL
; if it is omitted ornil
,SYMBOL
uses the documentation string determined byDEFINITION
.Internally, this normally uses
fset
, but ifSYMBOL
has adefalias-fset-function
property, the associated value is used instead.The return value is undefined.
See also the Elisp manual, node Defining Functions.

- 75,699
- 9
- 109
- 225