Emacs Lisp

from Wikipedia, the free encyclopedia

Emacs Lisp ( elisp for short ) is a dialect of the Lisp programming language in which most of the GNU Emacs and XEmacs editors are programmed and which can also be used to expand the editors . Almost all editor functions are available as Lisp functions . The most basic ones, however, are implemented in C. Key combinations are assigned to the functions via a so-called keymap . Emacs Lisp is responsible for the extraordinary extensibility of this editor.

By default, Emacs provides the user with a buffer (text window) in which Lisp functions can be evaluated. Editor settings are recorded in Lisp variables . They can be set interactively or specified with an initialization file.

Source code and byte code

Emacs Lisp source code is saved in text files. The files have the file extension .el . An exception is the central configuration file, the commands of which are processed when the editor is called. Even if the name .emacs.el is generally allowed, it is usually called .emacs and is located in the home directory. This can also be set under Microsoft Windows by setting the environment variable HOME (and, since Windows programs sometimes have problems with the dot at the beginning, _emacs can also be used here). A Lisp interpreter executes the program text contained in the text files. Function definitions are read in and are available during the editor runtime. Functions and variables can be freely redefined or changed.

Most of the functions are only loaded when they are needed (via the autoload function ).

The basic functions of the editor are written in C. They are called primitives in English ; it is, so to speak, the built-in functions. These are used by the Lisp functions; but they cannot be changed. (Unless you rewrite them in C and recompile the whole editor, which is possible because Emacs is free software .)

Like the programming language Java , which was later developed, Emacs Lisp also offers the option of translating the source text into byte code (Menu Compile ). The files produced then have the extension .elc . The compiled programs require less memory and are loaded and executed more quickly.

Web links

Commons : Emacs Lisp  - collection of images, videos and audio files