Emacs Lisp

It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.

Although the Common Lisp standard had yet to be formulated, Scheme existed at the time but Stallman chose not to use it because of its comparatively poor performance on workstations (as opposed to the minicomputers that were Emacs' traditional home), and he wanted to develop a dialect which he thought would be more easily optimized.

The development of Emacs Lisp was guided by the goal of providing data structures and features specific to making a versatile text editor over implementing a general-purpose programming language.

However, Emacs Lisp provides many features for navigating and modifying buffer text at a sentence, paragraph, or higher syntactic level as defined by modes.

This can also be written using the feature called advice, which allows the user to create wrappers around existing functions instead of defining their own.

This has the advantage of not requiring keybindings to be changed and working wherever the original function is called, as well as being simpler to write but the disadvantage of making debugging more complicated.

Emacs Lisp code is stored in filesystems as plain text files, by convention with the filename suffix ".el".

When the files are loaded, an interpreter component of the Emacs program reads and parses the functions and variables, storing them in memory.

Functions and variables can be freely modified and redefined without restarting the editor or reloading the config file.

In XEmacs, runtime loading of such primitives is possible, using the operating system's support for dynamic linking.

However, because errors in C code can easily lead to segmentation violations or to more subtle bugs, which crash the editor, and because writing C code that interacts correctly with the Emacs Lisp garbage collector is error-prone, the number of functions implemented as primitives is kept to a necessary minimum.

The "cl-lib" package, on the other hand, follows Emacs Lisp style guidelines more closely and prefixes each function and macro it defines with "cl-" (e.g., cl-defun, which doesn't conflict with the name of the built-in defun), avoiding the unexpected changes in behavior that could occur whenever the "cl" package was loaded.

The apel library aids in writing portable Emacs Lisp code, with the help of the polysylabi platform bridge.

[11] Like MacLisp, Emacs Lisp uses dynamic scope, offering static (or lexical) as an option starting from version 24.

[13][14] Before this option was added, one could use the lexical-let macro from the (now deprecated) "cl" package to provide effective lexical scope.

Firstly, it can easily lead to bugs in large programs, due to unintended interactions between variables in different functions.