HOME

TheInfoList



OR:

Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant,
GNU Emacs GNU Emacs is a free software text editor. It was created by GNU Project founder Richard Stallman, based on the Emacs editor developed for Unix operating systems. GNU Emacs has been a central component of the GNU project and a flagship project ...
, describes it as "the extensible, customizable, self-documenting, real-time display editor". Development of the first Emacs began in the mid-1970s, and work on its direct descendant, GNU Emacs, continues actively; the latest version is 28.2, released in September 2022. Emacs has over 10,000 built-in commands and its user interface allows the user to combine these commands into macros to automate work. Implementations of Emacs typically feature a
dialect The term dialect (from Latin , , from the Ancient Greek word , 'discourse', from , 'through' and , 'I speak') can refer to either of two distinctly different types of linguistic phenomena: One usage refers to a variety of a language that is ...
of the Lisp programming language, allowing users and developers to write new commands and applications for the editor. Extensions have been written to, among other things, manage files, remote access, e-mail,
outlines Outline or outlining may refer to: * Outline (list), a document summary, in hierarchical list format * Code folding, a method of hiding or collapsing code or text to see content in outline form * Outline drawing, a sketch depicting the outer edg ...
,
multimedia Multimedia is a form of communication that uses a combination of different content forms such as text, audio, images, animations, or video into a single interactive presentation, in contrast to tradit ...
, git integration, and RSS feeds, as well as implementations of '' ELIZA'', '' Pong'', '' Conway's Life'', ''
Snake Snakes are elongated, limbless, carnivorous reptiles of the suborder Serpentes . Like all other squamates, snakes are ectothermic, amniote vertebrates covered in overlapping scales. Many species of snakes have skulls with several more ...
'', ''
Dunnet Dunnet is a village in Caithness, in the Highland area of Scotland. It is within the Parish of Dunnet. Village The village centres on the A836– B855 road junction. The A836 leads towards John o' Groats in the east and toward Thurso and ...
'', and '' Tetris''. The original EMACS was written in 1976 by
David A. Moon David A. Moon is a programmer and computer scientist, known for his work on the Lisp programming language, as co-author of the Emacs text editor, as the inventor of ephemeral garbage collection, and as one of the designers of the Dylan progra ...
and Guy L. Steele Jr. as a set of Editor MACroS for the TECO editor. It was inspired by the ideas of the TECO-macro editors TECMAC and TMACS. The most popular, and most ported, version of Emacs is GNU Emacs, which was created by
Richard Stallman Richard Matthew Stallman (; born March 16, 1953), also known by his initials, rms, is an American free software movement activist and programmer. He campaigns for software to be distributed in such a manner that its users have the freedom to ...
for the
GNU Project The GNU Project () is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and computing devices by collabor ...
. XEmacs is a variant that branched from GNU Emacs in 1991. GNU Emacs and XEmacs use similar Lisp dialects and are, for the most part, compatible with each other. XEmacs development is inactive. Emacs is, along with vi, one of the two main contenders in the traditional editor wars of
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
culture. Emacs is among the oldest
free and open source Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
projects still under development.


History

Emacs development began during the 1970s at the
MIT AI Lab Computer Science and Artificial Intelligence Laboratory (CSAIL) is a research institute at the Massachusetts Institute of Technology (MIT) formed by the 2003 merger of the Laboratory for Computer Science (LCS) and the Artificial Intelligence Lab ...
, whose PDP-6 and PDP-10 computers used the Incompatible Timesharing System (ITS)
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
that featured a default line editor known as Tape Editor and Corrector (TECO). Unlike most modern text editors, TECO used separate modes in which the user would either add text, edit existing text, or display the document. One could not place characters directly into a document by typing them into TECO, but would instead enter a character ('i') in the TECO command language telling it to switch to input mode, enter the required characters, during which time the edited text was not displayed on the screen, and finally enter a character () to switch the editor back to command mode. (A similar technique was used to allow overtyping.) This behavior is similar to that of the program ed.
Richard Stallman Richard Matthew Stallman (; born March 16, 1953), also known by his initials, rms, is an American free software movement activist and programmer. He campaigns for software to be distributed in such a manner that its users have the freedom to ...
visited the Stanford AI Lab in 1976 and saw the lab's ''E'' editor, written by Fred Wright. He was impressed by the editor's intuitive
WYSIWYG In computing, WYSIWYG ( ), an acronym for What You See Is What You Get, is a system in which editing software allows content to be edited in a form that resembles its appearance when printed or displayed as a finished product, such as a printed d ...
(What You See Is What You Get) behavior, which has since become the default behavior of most modern text editors. He returned to MIT where Carl Mikkelsen, a hacker at the AI Lab, had added to TECO a combined display/editing mode called ''Control-R'' that allowed the screen display to be updated each time the user entered a keystroke. Stallman reimplemented this mode to run efficiently and then added a macro feature to the TECO display-editing mode that allowed the user to redefine any keystroke to run a TECO program. E had another feature that TECO lacked: random-access editing. TECO was a page-sequential editor that was designed for editing paper tape on the PDP-1 at a time when computer memory was generally small due to cost, and it was a feature of TECO that allowed editing on only one page at a time sequentially in the order of the pages in the file. Instead of adopting E's approach of structuring the file for page-random access on disk, Stallman modified TECO to handle large buffers more efficiently and changed its file-management method to read, edit, and write the entire file as a single buffer. Almost all modern editors use this approach. The new version of TECO quickly became popular at the AI Lab and soon accumulated a large collection of custom macros whose names often ended in ''MAC'' or ''MACS'', which stood for ''macro''. Two years later, Guy Steele took on the project of unifying the diverse macros into a single set. Steele and Stallman's finished implementation included facilities for extending and documenting the new macro set. The resulting system was called EMACS, which stood for ''Editing MACroS'' or, alternatively, ''E with MACroS''. Stallman picked the name Emacs "because was not in use as an abbreviation on ITS at the time." An apocryphal
hacker koan The Jargon File is a glossary and usage dictionary of slang used by computer programmers. The original Jargon File was a collection of terms from technical cultures such as the MIT AI Lab, the Stanford AI Lab (SAIL) and others of the old ARPANET ...
alleges that the program was named after '' Emack & Bolio's'', a popular
Boston Boston (), officially the City of Boston, is the state capital and most populous city of the Commonwealth of Massachusetts, as well as the cultural and financial center of the New England region of the United States. It is the 24th- mo ...
ice cream store. The first operational EMACS system existed in late 1976. Stallman saw a problem in too much customization and ''de facto'' forking and set certain conditions for usage. He later wrote: The original Emacs, like TECO, ran only on the PDP-10 running ITS. Its behavior was sufficiently different from that of TECO that it could be considered a text editor in its own right, and it quickly became the standard editing program on ITS. Mike McMahon ported Emacs from ITS to the TENEX and TOPS-20 operating systems. Other contributors to early versions of Emacs include Kent Pitman, Earl Killian, and Eugene Ciccarelli. By 1979, Emacs was the main editor used in MIT's AI lab and its Laboratory for Computer Science.


Implementations


Early implementations

In the following years, programmers wrote a variety of Emacs-like editors for other computer systems. These included EINE (''EINE Is Not EMACS'') and ZWEI (''ZWEI Was EINE Initially''), which were written for the Lisp machine by Mike McMahon and
Daniel Weinreb Daniel L. Weinreb (January 6, 1959 – September 7, 2012) was an American computer scientist and programmer, with significant work in the environment of the programming language Lisp. Early life Weinreb was born on January 6, 1959, in Brookly ...
, and Sine (''Sine Is Not Eine''), which was written by Owen Theodore Anderson. Weinreb's EINE was the first Emacs written in Lisp. In 1978,
Bernard Greenberg Bernard S. Greenberg is a programmer and computer scientist, known for his work on Multics and the Lisp machine. Projects In 1978, Greenberg implemented Multics EmacsBernard S. Greenberg. ''Multics Emacs: The History, Design and Implementation ...
wrote
Multics Emacs Multics Emacs is an early implementation of the Emacs text editor. It was written in Maclisp by Bernard Greenberg at Honeywell's Cambridge Information Systems Lab in 1978, as a successor to the original 1976 TECO implementation of Emacs and a ...
almost entirely in Multics Lisp at
Honeywell Honeywell International Inc. is an American publicly traded, multinational conglomerate corporation headquartered in Charlotte, North Carolina. It primarily operates in four areas of business: aerospace, building technologies, performance ma ...
's Cambridge Information Systems Lab. Multics Emacs was later maintained by Richard Soley, who went on to develop the NILE Emacs-like editor for the NIL Project, and by Barry Margolin. Many versions of Emacs, including GNU Emacs, would later adopt Lisp as an extension language. James Gosling, who would later invent
NeWS News is information about current events. This may be provided through many different media: word of mouth, printing, postal systems, broadcasting, electronic communication, or through the testimony of observers and witnesses to event ...
and the Java programming language, wrote
Gosling Emacs Gosling Emacs (often shortened to "Gosmacs" or "gmacs") is a discontinued Emacs implementation written in 1981 by James Gosling in C. Gosling initially allowed Gosling Emacs to be redistributed with no formal restrictions, as required by the " ...
in 1981. The first Emacs-like editor to run on
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
, Gosling Emacs was written in C and used
Mocklisp Gosling Emacs (often shortened to "Gosmacs" or "gmacs") is a discontinued Emacs implementation written in 1981 by James Gosling in C. Gosling initially allowed Gosling Emacs to be redistributed with no formal restrictions, as required by the " ...
, a language with Lisp-like syntax, as an extension language. Early Ads for
Computer Corporation of America Computer Corporation of America (CCA) was a computer software and database systems company founded in 1965. It was best known for its Model 204 (M204) database system for IBM and compatible mainframes. It was acquired by Rocket Software in 20 ...
's ''CCA EMACS'' (Steve Zimmerman). appeared in 1984. 1985 comparisons to GNU Emacs, when it came out, mentioned free vs. $2,400.


GNU Emacs

Richard Stallman began work on GNU Emacs in 1984 to produce a
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, n ...
alternative to the proprietary Gosling Emacs. GNU Emacs was initially based on Gosling Emacs, but Stallman's replacement of its Mocklisp interpreter with a true Lisp interpreter required that nearly all of its code be rewritten. This became the first program released by the nascent GNU Project. GNU Emacs is written in C and provides Emacs Lisp, also implemented in C, as an extension language. Version 13, the first public release, was made on March 20, 1985. The first widely distributed version of GNU Emacs was version 15.34, released later in 1985. Early versions of GNU Emacs were numbered as ''1.x.x'', with the initial digit denoting the version of the C core. The ''1'' was dropped after version 1.12, as it was thought that the major number would never change, and thus the numbering skipped from ''1'' to ''13''. In September 2014, it was announced on the GNU emacs-devel mailing list that GNU Emacs would adopt a rapid release strategy and version numbers would increment more quickly in the future. GNU Emacs offered more features than Gosling Emacs, in particular a full-featured Lisp as its extension language, and soon replaced Gosling Emacs as the ''de facto'' Unix Emacs editor.
Markus Hess Markus Hess, a German citizen, is best known for his endeavours as a hacker in the late 1980s. Alongside fellow hackers Dirk Brzezinski and Peter Carl, Hess hacked into networks of military and industrial computers based in the United States, Eur ...
exploited a security flaw in GNU Emacs' email subsystem in his 1986 cracking spree in which he gained
superuser In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of t ...
access to Unix computers. Most of GNU Emacs functionality is implemented through a
scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
called Emacs Lisp. Because about 70% of GNU Emacs is written in the Emacs Lisp extension language, one only needs to port the C core which implements the Emacs Lisp interpreter. This makes porting Emacs to a new platform considerably less difficult than porting an equivalent project consisting of native code only. GNU Emacs development was relatively closed until 1999 and was used as an example of the ''Cathedral'' development style in ''
The Cathedral and the Bazaar ''The Cathedral and the Bazaar: Musings on Linux and Open Source by an Accidental Revolutionary'' (abbreviated ''CatB'') is an essay, and later a book, by Eric S. Raymond on software engineering methods, based on his observations of the Linux ...
''. The project has since adopted a public development mailing list and anonymous CVS access. Development took place in a single CVS trunk until 2008 and was then switched to the Bazaar DVCS. On November 11, 2014, development was moved to Git. Richard Stallman has remained the principal maintainer of GNU Emacs, but he has stepped back from the role at times. Stefan Monnier and Chong Yidong were maintainers from 2008 to 2015. John Wiegley was named maintainer in 2015 after a meeting with Stallman at MIT. As of early 2014, GNU Emacs has had 579 individual committers throughout its history.


XEmacs

Lucid Emacs, based on an early alpha version of GNU Emacs 19, was developed beginning in 1991 by
Jamie Zawinski Jamie Zawinski (born November 3, 1968), commonly known as jwz, is an American computer programmer, blogger and impresario. He is best known for his role in the creation of Netscape Navigator, Netscape Mail, Lucid Emacs, Mozilla.org, and XSc ...
and others at Lucid Inc. One of the best-known early forks in
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, n ...
development occurred when the codebases of the two Emacs versions diverged and the separate development teams ceased efforts to merge them back into a single program. Lucid Emacs has since been renamed XEmacs. Its development is currently inactive, with the most recent stable version 21.4.22 released in January 2009 (while a beta was released in 2013), while GNU Emacs has implemented many formerly XEmacs-only features.


Other forks of GNU Emacs

Other notable forks include: * Aquamacs – based on GNU Emacs (Aquamacs 3.2 is based on GNU Emacs version 24 and Aquamacs 3.3 is based on GNU Emacs version 25) which focuses on integrating with the Apple Macintosh user interface *
Meadow A meadow ( ) is an open habitat, or field, vegetated by grasses, herbs, and other non- woody plants. Trees or shrubs may sparsely populate meadows, as long as these areas maintain an open character. Meadows may be naturally occurring or arti ...
– a Japanese version for Microsoft Windows * SXEmacs – Steve Youngs' fork of XEmacs


Various Emacs editors

In the past, projects aimed at producing small versions of Emacs proliferated. GNU Emacs was initially targeted at computers with a 32-bit flat address space and at least 1 
MiB The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
of RAM. Such computers were high end
workstation A workstation is a special computer designed for technical or scientific applications. Intended primarily to be used by a single user, they are commonly connected to a local area network and run multi-user operating systems. The term ''workst ...
s and minicomputers in the 1980s, and this left a need for smaller reimplementations that would run on common
personal computer A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or te ...
hardware. Today's computers have more than enough power and capacity to eliminate these restrictions, but small clones have more recently been designed to fit on software installation disks or for use on less capable hardware. Other projects aim to implement Emacs in a different dialect of Lisp or a different programming language altogether. Although not all are still actively maintained, these clones include: * MicroEMACS, which was originally written by Dave Conroy and further developed by Daniel Lawrence and which exists in many variations. * mg, originally called MicroGNUEmacs and, later, mg2a, a public-domain offshoot of MicroEMACS intended to more closely resemble GNU Emacs. Now installed by default on OpenBSD. * JOVE (Jonathan's Own Version of Emacs), Jonathan Payne's non-programmable Emacs implementation for
UNIX-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems. *
MINCE Mince may refer to: * MINCE, an early text editor for CP/M microcomputers * Mincing, a food preparation technique in which food ingredients are finely divided * Ground meat, also known as ''mince'', meat that has been minced ** Ground beef, also ...
(MINCE Is Not Complete Emacs), a version for CP/M and later DOS, from Mark of the Unicorn. MINCE evolved into Final Word, which eventually became the Borland Sprint word processor. * Perfect Writer, a CP/M implementation derived from MINCE that was included circa 1982 as the default word processor with the very earliest releases of the Kaypro II and Kaypro IV. It was later provided with the Kaypro 10 as an alternative to WordStar. * Freemacs, a DOS version that uses an extension language based on text macro expansion and fits within the original 64
KiB The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
flat memory limit. * Zile. Zile was a recursive acronym for ''Zile Is Lossy Emacs'', but the project was rewritten in Lua and now gives the expansion as Zile Implements Lua Editors. The new Zile still includes an implementation of Emacs in Lua called Zemacs. There is also an implementation of vi called Zi. *
Zmacs Zmacs is one of the many variants of the Emacs text editor. Zmacs was written for the MIT Lisp machine and runs on its descendants (Symbolics Genera, LMI Lambda, TI Explorer). Zmacs is written in Lisp Machine Lisp (called ZetaLisp on Symbolics Li ...
, for the MIT Lisp Machine and its descendants, implemented in ZetaLisp. * Climacs, a Zmacs-influenced variant implemented in Common Lisp. * Epsilon, an Emacs clone by Lugaru Software. Versions for DOS, Windows, Linux, FreeBSD, Mac OS X and O/S 2 are bundled in the release. It uses a non-Lisp extension language with C syntax and used a very early concurrent command shell buffer implementation under the single-tasking MS-DOS. * PceEmacs is the Emacs-based editor for SWI-Prolog. * Amacs, an Apple II ProDOS version of Emacs implemented in 6502 assembly by Brian Fox. * Hemlock, originally written in
Spice Lisp Spice Lisp (Scientific Personal Integrated Computing Environment) is a programming language, a dialect of Lisp. Its implementation, originally written by Carnegie Mellon University's (CMU) Spice Lisp Group, targeted the microcode of the 16-bit wo ...
, then Common Lisp. A part of
CMU Common Lisp CMUCL is a free Common Lisp implementation, originally developed at Carnegie Mellon University. CMUCL runs on most Unix-like platforms, including Linux and BSD; there is an experimental Windows port as well. Steel Bank Common Lisp is derived f ...
. Influenced by
Zmacs Zmacs is one of the many variants of the Emacs text editor. Zmacs was written for the MIT Lisp machine and runs on its descendants (Symbolics Genera, LMI Lambda, TI Explorer). Zmacs is written in Lisp Machine Lisp (called ZetaLisp on Symbolics Li ...
. Later forked by Lucid Common Lisp (as Helix), LispWorks and Clozure CL projects. There is also a Portable Hemlock project, which aims to provide a Hemlock, which runs on several Common Lisp implementations. * umacs, an implementation under OS-9 *
edwin The name Edwin means "rich friend". It comes from the Old English elements "ead" (rich, blessed) and "ƿine" (friend). The original Anglo-Saxon form is Eadƿine, which is also found for Anglo-Saxon figures. People * Edwin of Northumbria (die ...
, an Emacs-like text editor included with MIT/GNU Scheme.


Editors with Emacs emulation

* The Cocoa text system uses some of the same terminology and understands many Emacs navigation bindings. This is possible because the native UI uses the
Command key The Command key (sometimes abbreviated as Cmd key), , formerly also known as the Apple key or open Apple key, is a modifier key present on Apple keyboards. The Command key's purpose is to allow the user to enter keyboard commands in applicat ...
(equivalent to Super) instead of the
Control key In computing, a Control key is a modifier key which, when pressed in conjunction with another key, performs a special operation (for example, ); similar to the Shift key, the Control key rarely performs any function when pressed by itself. ...
. *
Eclipse (IDE) Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in (computing), plug-in system for customizing the environment. It is the second-most-popular IDE for Java ...
provides a set of Emacs keybindings. * Epsilon (text editor) Defaults to Emacs emulation and supports a vi mode. *
GNOME Builder GNOME Builder is a general purpose integrated development environment (IDE) for the GNOME platform, primarily designed to aid in writing GNOME-based applications. It was initially released on March 24, 2015. The application's tagline is "A toolsm ...
has an emulation mode for Emacs. * GNU Readline is a line editor that understands the standard Emacs navigation keybindings. It also has a vi emulation mode. *
IntelliJ IDEA IntelliJ IDEA is an integrated development environment (IDE) written in Java for developing computer software written in Java, Kotlin, Groovy, and other JVM-based languages. It is developed by JetBrains (formerly known as IntelliJ) and is av ...
provides a set of Emacs keybindings. * JED has an emulation mode for Emacs. * Joe's Own Editor emulates Emacs keybindings when invoked as . *
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
provides Emacs keybindings for its editor. * KornShell has an Emacs line editing mode that predates Gnu Readline. * Visual Studio Code provides a
extension
to emulate Emacs keybindings. *
Oracle SQL Developer Oracle SQL Developer is an Integrated development environment (IDE) for working with SQL in Oracle databases. Oracle Corporation provides this product free; it uses the Java Development Kit. Features Oracle SQL Developer supports Oracle produ ...
can save and load alternative keyboard-shortcut layouts. One of the built-in layouts provides Emacs-like keybindings, including using different commands to achieve closer behavior.


Features

Emacs is primarily a text editor and is designed for manipulating pieces of text, although it is capable of formatting and printing documents like a
word processor A word processor (WP) is a device or computer program that provides for input, editing, formatting, and output of text, often with some additional features. Early word processors were stand-alone devices dedicated to the function, but current ...
by interfacing with external programs such as
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well. In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
, Ghostscript or a web browser. Emacs provides commands to manipulate and differentially display semantic units of text such as words, sentences, paragraphs and
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
constructs such as functions. It also features ''keyboard macros'' for performing user-defined batches of editing commands. GNU Emacs is a ''real-time display'' editor, as its edits are displayed onscreen as they occur. This is standard behavior for modern text editors but EMACS was among the earliest to implement this. The alternative is having to issue a distinct command to display text, (e.g. after modifying it). This is done in line editors, such as ed (unix), ED (CP/M), and Edlin (MS-DOS).


General architecture

Almost all of the functionality in Emacs, including basic editing operations such as the insertion of characters into a file, is achieved through functions written in a dialect of the Lisp programming language. The dialect used in GNU Emacs is known as Emacs Lisp (Elisp), and was developed expressly to port Emacs to GNU and
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
. The Emacs Lisp layer sits atop a stable core of basic services and platform abstraction written in the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well a ...
, which enables GNU Emacs to be ported to a wide variety of operating systems and architectures without modifying the implementation semantics of the Lisp system where most of the editor lives. In this Lisp environment, variables and functions can be modified with no need to rebuild or restart Emacs, with even newly redefined versions of core editor features being asynchronously compiled and loaded into the live environment to replace existing definitions. Modern GNU Emacs features both
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
and native code compilation for Emacs Lisp. All configuration is stored in variables, classes, and data structures, and changed by simply updating these live. The use of a Lisp dialect in this case is a key advantage, as Lisp syntax consists of so-called symbolic expressions (or sexprs), which can act as both evaluatable code expressions and as a data serialisation format akin to, but simpler and more general than, widely known ones such as
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
, JSON, and YAML. In this way there is little difference in practice between customising existing features and writing new ones, both of which are accomplished in the same basic way. The goal of Emacs' open design is to transparently expose Emacs' internals to the Emacs user during normal use in the same way that they would be exposed to the Emacs developer working on the git tree, and to collapse as much as possible of the distinction between using Emacs and programming Emacs, while still maintaining a stable, practical environment for novice users.


Interactive data

The main text editing data structure is the '' buffer'', a memory region containing data (usually text) with associated attributes. The most important of these are: * The ''point'': the editing cursor; * The ''mark'': a settable location which, along with the point, enables selection of * The ''region'': a conceptually contiguous collection of text to which editing commands will be applied; * The name and inode of the file the buffer is ''visiting'' (if any); * The ''default directory'', where any OS-level commands will be executed from by default; * The buffer's ''mode''s, including a ''major mode'' possibly several ''minor mode''s * The ''buffer encoding'', the method by which Emacs represents buffer data to the user; * and a variety of ''buffer local variable''s and Emacs Lisp state. ''Modes'', in particular, are an important concept in Emacs, providing a mechanism to disaggregate Emacs' functionality into sets of behaviours and keybinds relevant to specific buffers' data. ''Major modes'' provide a general package of functions and commands relevant to a buffer's data and the way users might be interacting with it (e.g. editing source code in a specific language, editing hex, viewing the filesystem, interacting with git, etc.), and ''minor modes'' define subsidiary collections of functionality applicable across many major modes (such as auto-save-mode). Minor modes can be toggled on or off both locally to each buffer as well as globally across all buffers, while major modes can only be toggled per-buffer. Any other data relevant to a buffer but not bundled into a mode can be handled by simply focussing that buffer and live modifying the relevant data directly. Any interaction with the editor (like key presses or clicking a mouse button) is realized by evaluating Emacs Lisp code, typically a ''command'', which is a function explicitly designed for interactive use. Keys can be arbitrarily redefined and commands can also be accessed by name; some commands evaluate arbitrary Emacs Lisp code provided by the user in various ways (e.g. a family of eval- region, buffer, and expression type commands). Even the simplest user inputs (such a
printable characters ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
) are effectuated as Emacs Lisp functions, such as the self-insert-command , bound to most keyboard keys in a typical text editing buffer by default, which parameterises itself with the locale-defined character associated with the key used to call it (e.g., pressing the key in a buffer that accepts text input evaluates the code (self-insert-command 1 ?f), which inserts 1 copy of the character constant ?f ''at point'').


Display

Because Emacs predates modern standard terminology for
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, ins ...
s, it uses somewhat divergent names for familiar interface elements. Buffers, the data that Emacs users interact with, are displayed to the user inside ''windows'', which are tiled portions of the terminal screen or the GUI window, which Emacs refers to as ''frames''. Depending on configuration, windows can include scroll bars, line numbers, sometimes a 'header line' typically to ease navigation, and a ''mode line'' at the bottom (usually displaying buffer name, the active modes and point position of the buffer among others). The bottom of every frame is used for output messages (then called 'echo area') and text input for commands (then called 'minibuffer'). In general, Emacs display elements (windows, frames, etc.) are not tied to any specific data or Emacs process. Buffers are not associated with windows, and multiple windows can be opened onto the same buffer, for example to see different parts of a long text side-by-side without scrolling, and multiple buffers can share the same text, for example to take advantage of different major modes in a mixed-language file. Similarly, Emacs instances are not associated with particular frames, and multiple frames can be opened displaying a single running Emacs process, e.g. a frame per screen in a multi-monitor setup, or a terminal frame connected via ssh from a remote system and a graphical frame displaying the same Emacs process via the local system's monitor, etc. Because of this separation of concerns, Emacs can display roughly similarly on any device more complex than a dumb terminal, including providing typical graphical
WIMP Wimp, WIMP, or Wimps may refer to: Science and technology * Weakly interacting massive particle, a hypothetical particle of dark matter * WIMP (computing), the "window, icon, menu, pointer" paradigm * WIMP (software bundle), the web stack of Windo ...
features on text terminals; though graphical frames are the preferred mode of display, providing a strict superset of the features of text terminal frames.


Customizability

* Keystrokes can be recorded into macros and replayed to automate complex, repetitive tasks. This is often done on an ad-hoc basis, with each macro discarded after use, although macros can be saved and invoked later. * At startup, Emacs executes an Emacs Lisp script named (recent versions also look for , , and ;, as well as similar variations on . Emacs reads first if it exists, and it can be used to configure or short-circuit core emacs features before they load, such as the graphical display system or package manager. It will then execute the first version or that it finds, ignoring the rest. This personal customization file can be arbitrarily long and complex, but typical content includes: ** Setting global variables or invoking functions to customize Emacs behaviour, for example ** Key bindings to override standard ones and to add shortcuts for commands that the user finds convenient but don't have a key binding by default. Example: ** Loading, enabling and initializing extensions (Emacs comes with many extensions, but only a few are loaded by default.) ** Configuring ''event hooks'' to run arbitrary code at specific times, for example to automatically recompile source code after saving a buffer () ** Executing arbitrary files, usually to split an overly long configuration file into manageable and homogeneous parts ( and are traditional locations for these personal scripts) * The ''customize'' extension allows the user to set configuration properties such as the color scheme interactively, from within Emacs, in a more user-friendly way than by setting variables in : it offers search, descriptions and help text, multiple choice inputs, reverting to defaults, modification of the running Emacs instance without reloading, and other conveniences similar to the
preferences In psychology, economics and philosophy, preference is a technical term usually used in relation to choosing between alternatives. For example, someone prefers A over B if they would rather choose A than B. Preferences are central to decision t ...
functionality of other programs. The customized values are saved in (or another designated file) automatically. * ''Themes'', affecting the choice of fonts and colours, are defined as Emacs Lisp files and chosen through the customize extension. * ''Modes'', which support editing a range of programming languages (e.g., emacs-lisp-mode, c-mode, java-mode, ESS for R) by changing fonts to highlight the code and keybindings modified (forword-function vs. forward-page). Other modes include ones that support editing spreadsheets (dismal) and structured text.


Self-documenting

The first Emacs contained a ''help'' library that included documentation for every command, variable and internal function. Because of this, Emacs proponents described the software as ''self-documenting'' in that it presents the user with information on its normal features and its current state. Each function includes a documentation string that is displayed to the user on request, a practice that subsequently spread to programming languages including Lisp,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
,
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
, and Python. This help system can take users to the actual code for each function, whether from a built-in library or an added third-party library. Emacs also has a built-in tutorial. Emacs displays instructions for performing simple editing commands and invoking the tutorial when it is launched with no file to edit. The tutorial is by Stuart Cracraft and Richard Stallman.


Culture


Church of Emacs

The ''Church of Emacs'', formed by
Richard Stallman Richard Matthew Stallman (; born March 16, 1953), also known by his initials, rms, is an American free software movement activist and programmer. He campaigns for software to be distributed in such a manner that its users have the freedom to ...
, is a parody religion created for Emacs users. While it refers to vi as the ''editor of the beast'' (vi-vi-vi being 6-6-6 in Roman numerals), it does not oppose the use of vi; rather, it calls it
proprietary software Proprietary software is software that is deemed within the free and open-source software to be non-free because its creator, publisher, or other rightsholder or rightsholder partner exercises a legal monopoly afforded by modern copyright and i ...
anathema. ("Using a free version of vi is not a sin but a penance.") The Church of Emacs has its own
newsgroup A Usenet newsgroup is a repository usually within the Usenet system, for messages posted from users in different locations using the Internet. They are discussion groups and are not devoted to publishing news. Newsgroups are technically disti ...
, , that has posts purporting to support this parody religion. Supporters of vi have created an opposing ''Cult of vi''. Stallman has jokingly referred to himself as ''St I  GNU cius'', a saint in the Church of Emacs.


Emacs pinky

There is folklore attributing a
repetitive strain injury A repetitive strain injury (RSI) is an injury to part of the musculoskeletal or nervous system caused by repetitive use, vibrations, compression or long periods in a fixed position. Other common names include repetitive stress disorders, cumula ...
colloquially called ''Emacs pinky'' to Emacs' strong dependence on modifier keys, although there have not been any studies done to show Emacs causes more such problems than other keyboard-heavy computer programs. Users have addressed this through various approaches. Some users recommend simply using the two Control keys on typical PC keyboards like Shift keys while touch typing to avoid overly straining the left pinky, a proper use of the keyboard will reduce the RSI. Software-side methods include: * Customizing the key layout so that the key is transposed with the key. Similar techniques include defining the key as an additional Control key or transposing the Control and Meta keys. * Software, such as xwrits or the built-in in Emacs, that reminds the user to take regularly scheduled breaks. * Using the ErgoEmacs keybindings (with minor mode ergoemacs-mode). * Customizing the whole keyboard layout to move statistically frequent Emacs keys to more appropriate places. * Packages such as ace-jump-mode or Emacs Lisp extensions that provide similar functionality of tiered navigation, first asking for a character then replacing occurrences of the character with access keys for cursor movement. * evil-mode, an advanced Vim emulation layer. * god-mode, which provides an approach similar to vim's with a mode for entering Emacs commands without modifier keys. * Using customized key layout offered by
Spacemacs Spacemacs is a configuration framework for GNU Emacs. It can take advantage of all of GNU Emacs' features, including both graphical and command-line user interfaces, and being executable under X Window System and within a Unix shell terminal. It ...
and Doom Emacs, projects where key is used as the main key for initiating control sequences. These projects also heavily incorporates both evil-mode and the latter god-mode. *
StickyKeys Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury. It serializes keystrokes instead of pressing multiple keys at a time, allowi ...
, which turns key sequences into key combinations. * Emacs' built-in ''viper-mode'' that allows use of the vi key layout for basic text editing and the Emacs scheme for more advanced features. * Giving a dual role to a more-comfortably accessed key such as the space bar so that it functions as a Control key when pressed in combination with other keys. Ergonomic keyboards or keyboards with a greater number of keys adjacent to the space bar, such as Japanese keyboards, allow thumb control of other modifier keys too like Meta or Shift. * Using a limited ergonomic subset of keybindings, and accessing other functionality by typing M-x <command-name>. M-x itself can also be rebound. * Driving Emacs through voice input. Hardware solutions include special keyboards such as Kinesis's Contoured Keyboard, which places the modifier keys where they can easily be operated by the thumb, or the
Microsoft Natural keyboard Microsoft has designed and sold a variety of ergonomic keyboards for computers. The oldest is the Microsoft Natural Keyboard, released in 1994, the company's first computer keyboard. The newest models are the Sculpt Ergonomic Keyboard (2013), the S ...
, whose large modifier keys are placed symmetrically on both sides of the keyboard and can be pressed with the palm of the hand. Foot pedals can also be used. The ''Emacs pinky'' is a relatively recent development. The Space-cadet keyboard on which Emacs was developed had oversized Control keys that were adjacent to the space bar and were easy to reach with the thumb.


Terminology

The word ''emacs'' is sometimes pluralized as ''emacsen'', by phonetic analogy with boxen and VAXen, referring to different varieties of Emacs.


See also

* Comparison of text editors * Conkeror * GNU TeXmacs * List of text editors * List of Unix commands *
Integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...


References


Bibliography

*
PDF
*
PDF
* * * * * * *


External links

*


Architectural overview
{{GNU 1970s in computing Computer-related introductions in 1976 1976 software Free file comparison tools Free integrated development environments Free software programmed in C Free software programmed in Lisp Free text editors GNU Project software Hex editors Linux integrated development environments Linux text editors MacOS text editors OpenVMS text editors Text editors Unix text editors Windows text editors