Emacs W3
   HOME

TheInfoList



OR:

Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their
extensibility Extensibility is a software engineering and systems design principle that provides for future growth. Extensibility is a measure of the ability to extend a system and the level of effort required to implement the extension. Extensions can be th ...
. The manual for the most widely used variant, GNU Emacs, 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 of the
Lisp A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
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 File or filing may refer to: Mechanical tools and processes * File (tool), a tool used to ''remove'' fine amounts of material from a workpiece **Filing (metalworking), a material removal process in manufacturing ** Nail file, a tool used to gent ...
, 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 edge ...
, multimedia, git integration, and
RSS RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
feeds, as well as implementations of '' ELIZA'', '' Pong'', '' Conway's Life'', '' Snake'', ''
Dunnet Dunnet is a village in Caithness, in the Highland (council area), Highland area of Scotland. It is within the Parish of Dunnet. Village The village centres on the A836 road, A836–B855 road junction. The A836 leads towards John o' Groats ...
'', 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 program ...
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 for the GNU Project. 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 war The editor war is the rivalry between users of the Emacs and vi (now usually Vim, or more recently Neovim) text editors. The rivalry has become an enduring part of hacker culture and the free software community. The Emacs versus vi debate was o ...
s of Unix culture. Emacs is among the oldest free and open 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 La ...
, whose
PDP-6 The PDP-6, short for Programmed Data Processor model 6, is a computer developed by Digital Equipment Corporation (DEC) during 1963 and first delivered in the summer of 1964. It was an expansion of DEC's existing 18-bit systems to use a 36-bit da ...
and PDP-10 computers used the
Incompatible Timesharing System Incompatible Timesharing System (ITS) is a time-sharing operating system developed principally by the MIT Artificial Intelligence Laboratory, with help from Project MAC. The name is the jocular complement of the MIT Compatible Time-Sharing System ...
(ITS) operating system 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 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 (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 Macro (or MACRO) may refer to: Science and technology * Macroscopic, subjects visible to the eye * Macro photography, a type of close-up photography * Image macro, a picture with text superimposed * Monopole, Astrophysics and Cosmic Ray Observat ...
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 Five- and eight-hole punched paper tape Paper tape reader on the Harwell computer with a small piece of five-hole tape connected in a circle – creating a physical program loop Punched tape or perforated paper tape is a form of data storage ...
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 Apocrypha are works, usually written, of unknown authorship or of doubtful origin. The word ''apocryphal'' (ἀπόκρυφος) was first applied to writings which were kept secret because they were the vehicles of esoteric knowledge considered ...
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 A ...
alleges that the program was named after '' Emack & Bolio's'', a popular Boston 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 Earl Willard Killian (August 3, 1920 – September 21, 2022) was an American college sports head coach and athletic director. He coached Towson University's men's soccer, men's basketball, and baseball teams. He was the first head coach of all t ...
, and
Eugene Ciccarelli Eugene may refer to: People and fictional characters * Eugene (given name), including a list of people and fictional characters with the given name * Eugene (actress) (born 1981), Kim Yoo-jin, South Korean actress and former member of the sin ...
. 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 (German: "two") may refer to: * Zwei (band), a Japanese duo band * ZWEI, a text editor * '' Zwei: The Arges Adventure'', 2001 video game * '' Zwei: The Ilvard Insurrection'', 2008 video game * Zwei, a team in ''Infinite Ryvius'' anime serie ...
(''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 Brookl ...
, 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 Implementati ...
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'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 (communication), media: word of mouth, printing, Mail, postal systems, broadcasting, Telecommunications, electronic communication, or through the tes ...
and the Java programming language, wrote Gosling Emacs in 1981. The first Emacs-like editor to run on Unix, Gosling Emacs was written in C and used Mocklisp, 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 2010. ...
'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 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 Rapids are sections of a river where the river bed has a relatively steep gradient, causing an increase in water velocity and turbulence. Rapids are hydrological features between a ''run'' (a smoothly flowing part of a stream) and a '' cascade' ...
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 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 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 k ...
''. The project has since adopted a public development mailing list and anonymous
CVS CVS may refer to: Organizations * CVS Health, a US pharmacy chain ** CVS Pharmacy ** CVS Caremark, a prescription benefit management subsidiary * Council for Voluntary Service, England * Cable Video Store, former US pay-per-view service * CVS F ...
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 A committer is an individual who is permitted to modify the source code of a software project, that will be used in the project's official releases. To contribute source code to most large software projects, one must make modifications and then " ...
throughout its history.


XEmacs

Lucid Emacs, based on an early alpha version of GNU Emacs 19, was developed beginning in 1991 by Jamie Zawinski and others at Lucid Inc. One of the best-known early forks in free software 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 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 workstations and
minicomputer A minicomputer, or colloquially mini, is a class of smaller general purpose computers that developed in the mid-1960s and sold at a much lower price than mainframe and mid-size computers from IBM and its direct competitors. In a 1970 survey, ...
s in the 1980s, and this left a need for smaller reimplementations that would run on common personal computer 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 MicroEMACS is a small, portable Emacs-like text editor originally written by Dave Conroy in 1985, and further developed by Daniel M. Lawrence (1958–2010) and was maintained by him. MicroEMACS has been ported to many operating systems, including ...
, 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 OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
. *
JOVE Jupiter ( la, Iūpiter or , from Proto-Italic "day, sky" + "father", thus " sky father" Greek: Δίας or Ζεύς), also known as Jove (gen. ''Iovis'' ), is the god of the sky and thunder, and king of the gods in ancient Roman religion a ...
(Jonathan's Own Version of Emacs), Jonathan Payne's non-programmable Emacs implementation for UNIX-like 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 Mark of the Unicorn (MOTU) is a music-related computer software and hardware supplier. It is based in Cambridge, Massachusetts and has created music software since 1984. In the mid-1980s, Mark of the Unicorn sold productivity software and severa ...
. MINCE evolved into Final Word, which eventually became the Borland
Sprint Sprint may refer to: Aerospace *Spring WS202 Sprint, a Canadian aircraft design *Sprint (missile), an anti-ballistic missile Automotive and motorcycle *Alfa Romeo Sprint, automobile produced by Alfa Romeo between 1976 and 1989 *Chevrolet Sprint, ...
word processor. *
Perfect Writer Perfect Writer is a word processor computer program published by Perfect Software for CP/M, subsequently rewritten and released as Perfect II by Thorn EMI Computer Software for IBM PC compatible computers. It was written in C and famous for its st ...
, a
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system created in 1974 for Intel 8080/ 85-based microcomputers by Gary Kildall of Digital Research, Inc. Initial ...
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 Lua or LUA may refer to: Science and technology * Lua (programming language) * Latvia University of Agriculture * Last universal ancestor, in evolution Ethnicity and language * Lua people, of Laos * Lawa people, of Thailand sometimes referred t ...
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 Symbolic ...
, for the MIT Lisp Machine and its descendants, implemented in
ZetaLisp Lisp Machine Lisp is a programming language, a dialect of the language Lisp. A direct descendant of Maclisp, it was initially developed in the mid to late 1970s as the system programming language for the Massachusetts Institute of Technology ( ...
. * Climacs, a Zmacs-influenced variant implemented in
Common Lisp Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ''ANSI INCITS 226-1994 (S20018)'' (formerly ''X3.226-1994 (R1999)''). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived fro ...
. *
Epsilon Epsilon (, ; uppercase , lowercase or lunate ; el, έψιλον) is the fifth letter of the Greek alphabet, corresponding phonetically to a mid front unrounded vowel or . In the system of Greek numerals it also has the value five. It was der ...
, 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 w ...
, then
Common Lisp Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ''ANSI INCITS 226-1994 (S20018)'' (formerly ''X3.226-1994 (R1999)''). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived fro ...
. 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 derive ...
. 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 Symbolic ...
. 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, 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 (equivalent to Super) instead of the Control key. *
Eclipse (IDE) Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, un ...
provides a set of Emacs keybindings. *
Epsilon (text editor) Epsilon is a programmer's text editor modelled after Emacs. It resembles Emacs not only in its default keybindings and layout, but also in the fact that it has a Turing completeness, Turing-complete extension language in which much of its functional ...
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 provides a set of Emacs keybindings. *
JED Jed or JED may refer to: Places * Jed River, New Zealand * Jed Water, a river in Scotland * Jed, West Virginia, United States, an unincorporated community People and fictional characters * Jed (given name), a list of people and fictional charact ...
has an emulation mode for Emacs. * Joe's Own Editor emulates Emacs keybindings when invoked as . * MATLAB provides Emacs keybindings for its editor. *
KornShell KornShell (ksh) is a Unix shell which was developed by David Korn at Bell Labs in the early 1980s and announced at USENIX on July 14, 1983. The initial development was based on Bourne shell source code. Other early contributors were Bell ...
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 by interfacing with external programs such as LaTeX, Ghostscript or a web browser. Emacs provides commands to manipulate and differentially display
semantic Semantics (from grc, σημαντικός ''sēmantikós'', "significant") is the study of reference, meaning, or truth. The term can be used to refer to subfields of several distinct disciplines, including philosophy, linguistics and comput ...
units of text such as words, sentences, paragraphs and source code 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. 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 as ...
, 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,
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
, 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 In computer science, a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, a ...
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 The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribute ...
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) 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 interfaces, 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 Wind ...
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 computing, a keyboard shortcut also known as hotkey is a series of one or several keys to quickly invoke a software program or perform a preprogrammed action. This action may be part of the standard functionality of the operating system or ...
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 theo ...
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 A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
, Java, Perl, 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, 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 anathema. ("Using a
free Free may refer to: Concept * Freedom, having the ability to do something, without having to obey anyone/anything * Freethought, a position that beliefs should be formed only on the basis of logic, reason, and empiricism * Emancipate, to procur ...
version of vi is not a sin but a
penance Penance is any act or a set of actions done out of Repentance (theology), repentance for Christian views on sin, sins committed, as well as an alternate name for the Catholic Church, Catholic, Lutheran, Eastern Orthodox, and Oriental Orthodox s ...
.") The Church of Emacs has its own newsgroup, , 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 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 Vim means enthusiasm and vigor. It may also refer to: * Vim (cleaning product) * Vim Comedy Company, a movie studio * Vim Records * Vimentin, a protein * "Vim", a song by Machine Head on the album ''Through the Ashes of Empires'' * Vim (text ed ...
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 Application framework, framework for GNU Emacs. It can take advantage of all of GNU Emacs' features, including both Graphical user interface, graphical and Command-line interface, command-line user interfaces, and bei ...
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 An ergonomic keyboard is a computer keyboard Keyboard layout, designed with ergonomics, ergonomic considerations to minimize muscle strain, fatigue, and other problems. Features The common QWERTY keyboard layout is credited to the mechanical typew ...
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 The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for 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 GNU TeXmacs is a scientific word processor and typesetting component of the GNU Project. It originated as GNU Emacs with TeX functionalities, though it shares no code with those programs, while using TeX fonts. It is written and maintained by Jori ...
*
List of text editors The following is a list of notable text editors. Graphical and text user interface The following editors can either be used with a graphical user interface or a text user interface. Graphical user interface Text user interface Sys ...
* List of Unix commands * Integrated development environment


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