HOME

TheInfoList




GNU Emacs is 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 ...

free software
text editor A text editor is a type of computer program In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative programming, a ''computer program'' is ...

text editor
. It was created by
GNU Project The GNU Project () is 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 versi ...
founder
Richard Stallman Richard Matthew Stallman (; born March 16, 1953), also known by his initials, rms, is an American free software movement The free software movement is a social movement A social movement is a loosely organized effort by a large group of peo ...

Richard Stallman
. In common with other varieties of
Emacs Emacs or EMACS (Editor MACroS) is a family of text editor A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software, following the naming of Microsoft Notepad. Text editors a ...

Emacs
, GNU Emacs is extensible using a
Turing complete Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalysis, cryptanalyst, philosopher, and mathematical and theoretical biology, theoretical biologist. Turing was hig ...
programming language. GNU Emacs has been called "the most powerful text editor available today". With proper support from the underlying system, GNU Emacs is able to display files in multiple character sets, and has been able to simultaneously display most human languages since at least 1999. Throughout its history, GNU Emacs has been a central component of the
GNU GNU () is an extensive collection of 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 ...

GNU
project, and a flagship of the
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 ...

free software
movement. GNU Emacs is sometimes abbreviated as GNUMACS, especially to differentiate it from other EMACS variants. The tag line for GNU Emacs is "the extensible self-documenting text editor".


History

In 1976, Stallman wrote the first Emacs (“Editor MACroS”), and in 1984, began work on GNU Emacs, 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 ...

free software
alternative to the proprietary
Gosling Emacs Gosling Emacs (often shortened to "Gosmacs" or "gmacs") is a discontinued Emacs implementation written in 1981 by James Gosling in C (programming language), C. Gosling initially allowed Gosling Emacs to be redistributed with no formal restriction ...
. GNU Emacs was initially based on Gosling Emacs, but Stallman's replacement of its
Mocklisp Gosling Emacs (often shortened to "Gosmacs" or "gmacs") is a discontinued Emacs Emacs or EMACS (Editor MACroS) is a family of text editor A text editor is a type of computer program A computer program is a collection of instructions t ...
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 #REDIRECT Emacs Lisp #REDIRECT Emacs Lisp Emacs Lisp is a Dialect (computing), dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for ...
, 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 major version skipped from "1" to "13". A new third version number was added to represent changes made by user sites. In the current numbering scheme, a number with two components signifies a release version, with development versions having three components. GNU Emacs was later ported to the
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser Multi-user software is computer software Software is a collection of Instruction (computer science), instructions that tell a computer how to work. This is in contrast t ...

Unix
operating system An operating system (OS) is system software System software is software designed to provide a platform for other software. Examples of system software include operating systems (OS) like macOS, Linux, Android (operating system), Android and Mi ...

operating system
. It 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 Germany, German citizen, is best known for his endeavours as a hacker (computer security), hacker in the late 1980s. Alongside fellow hackers Dirk Brzezinski and Peter Carl, Hess hacked into networks of military and industrial compu ...

Markus Hess
exploited a security flaw in GNU Emacs's 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 An operating system (OS) is system software System software is software designed to provide a platform for other softwar ...
access to Unix computers. Although users commonly submitted patches and Elisp code to the net.emacs
newsgroup A Usenet newsgroup is a repository usually within the Usenet Usenet () is a worldwide distributed discussion system available on computers. It was developed from the general-purpose Unix-to-Unix Copy (UUCP) dial-up Dial-up Internet access ...
, participation in GNU Emacs development was relatively restricted 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 Eric Steven Raymond (born December 4, 1957), often referred to as ES ...
''. 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 today uses the
Git Git () is software for tracking changes in any set of files File or filing may refer to: Mechanical tools and processes * File (tool), used to remove fine amounts of material from a workpiece **Filing (metalworking), a material removal proc ...

Git
DVCS. 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 have overseen maintenance since 2008. On September 21, 2015 Monnier announced that he would be stepping down as maintainer effective with the feature freeze of Emacs 25. Longtime contributor John Wiegley was announced as the new maintainer on November 5, 2015.


Licensing

The terms of the
GNU General Public License The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software license A free-software license is a notice that grants the recipient of a piece of software extensive rights to modify and software distribu ...
(GPL) state that the Emacs source code, including both the C and Emacs Lisp components, are freely available for examination, modification, and redistribution. Older versions of the GNU Emacs documentation appeared under an ad-hoc license that required the inclusion of certain text in any modified copy. In the GNU Emacs user's manual, for example, this included instructions for obtaining GNU Emacs and Richard Stallman's essay '' The GNU Manifesto''. The XEmacs manuals, which were inherited from older GNU Emacs manuals when the fork occurred, have the same license. Newer versions of the documentation use the
GNU Free Documentation License The GNU Free Documentation License (GNU FDL or simply GFDL) is a copyleft Copyleft is the practice of granting the right to freely distribute and modify with the requirement that the same rights be preserved in derivative works created fr ...
with "invariant sections" that require the inclusion of the same documents and that the manuals proclaim themselves as ''GNU Manuals''. For GNU Emacs, like many other GNU packages, it remains policy to accept significant code contributions only if the
copyright Copyright is a type of intellectual property Intellectual property (IP) is a category of property Property is a system of rights that gives people legal control of valuable things, and also refers to the valuable things themselves. ...

copyright
holder executes a suitable disclaimer or assignment of their copyright interest to the
Free Software Foundation The Free Software Foundation (FSF) is a 501(c)(3) A 501(c)(3) organization is a corporation, trust, unincorporated association, or other type of organization exempt from federal income tax under section 501(c)(3) of Title 26 of the United States ...
. Bug fixes and minor code contributions of fewer than 10 lines are exempt. This policy is in place so that the FSF can defend the software in court if its
copyleft Copyleft is the practice of granting the right to freely distribute and modify intellectual property Intellectual property (IP) is a category of property Property is a system of rights that gives people legal control of valuable things ...

copyleft
license is violated. In 2011, it was noticed that GNU Emacs had been accidentally releasing some binaries without corresponding source code for two years, in opposition to the intended spirit of the GPL. Richard Stallman described this incident as ''"a very bad mistake"'', which was promptly fixed. The FSF didn't sue any downstream redistributors who unknowingly
violated ''Violated'' is a European-only Extended play, EP released by rap metal band Stuck Mojo. The album was released as a means of promoting the band for its first ever tour overseas in Europe. The EP includes a cover of Black Sabbath's "Sweet Leaf", ...
the GPL by distributing these binaries.


Using GNU Emacs


Commands

In its normal editing mode, GNU Emacs behaves like other text editors and allows the user to insert characters with the corresponding keys and to move the editing point with the arrow keys.
Escape key On computer keyboard A computer keyboard is a peripheral A peripheral or peripheral device is an auxiliary device used to put information into and get information out of the computer. The term peripheral device refers to all hardware comp ...
sequences or pressing the
control key In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and s ...

control key
and/or the
meta key The Meta key is a modifier key In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both comput ...
,
alt key :''For a list of keyboard shortcuts, see Table of keyboard shortcuts'' The Alt key (pronounced or ) on a computer keyboard is used to change (alternate) the function of other pressed keys. Thus, the Alt key is a modifier key In computing ...

alt key
or super keys in conjunction with a regular key produces modified keystrokes that invoke functions from the Emacs Lisp environment. Commands such as save-buffer and save-buffers-kill-emacs combine multiple modified keystrokes. Some GNU Emacs commands work by invoking an external program, such as ispell for spell-checking or
GNU Compiler Collection The GNU Compiler Collection (GCC) is an optimizing compiler In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an ...
(gcc) for program compilation, parsing the program's output, and displaying the result in GNU Emacs. Emacs also supports "inferior processes"—long-lived processes that interact with an Emacs buffer. This is used to implement , running a
Unix shell A Unix shell is a command-line interpreter or shell Shell may refer to: Architecture and design * Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness ...
as inferior process, as well as
read–eval–print loop A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming Computer programming is the process of designing and building an executable computer program to accomplish ...
(REPL) modes for various programming languages. Emacs' support for external processes makes it an attractive environment for interactive programming along the lines of
Interlisp Interlisp (also seen with a variety of capitalizations) is a programming environment built around a version of the programming language Lisp (programming language), Lisp. Interlisp development began in 1966 at Bolt, Beranek and Newman (renamed BBN ...
or
Smalltalk Smalltalk is an object-oriented programming, object-oriented, dynamically typed reflection (computer science), reflective programming language. Smalltalk was created as the language underpinning the "new world" of computing exemplified by "human ...

Smalltalk
. Users who prefer
IBM Common User Access Common User Access (CUA) is a standard for user interface In the industrial design Industrial design is a process of design A design is a plan or specification for the construction of an object or system or for the implementation of an a ...
-style keys can use , a package that originally was a third-party add-on but has been included in GNU Emacs since version 22.


Minibuffer

Emacs uses the "minibuffer," normally the bottommost line, to present status and request information—the functions that would typically be performed by
dialog box The dialog box (also called dialogue box (non-U.S. English) or just dialog) is a graphical control element ., 300px, right Image:GUI Frame.svg, upExample of enabled and disabled widgets; the frame (GUI), frame at the bottom is disabled, the ...
es in most GUIs. The minibuffer holds information such as text to target in a search or the name of a file to read or save. When applicable,
command-line completion Command-line completion (also tab completion) is a common feature of command-line interpreter A command-line interface (CLI) processes command (computing), commands to a computer program in the form of lines of text. The program which handles ...
is available using the tab and space keys.


File management and display

Emacs keeps text in
data structure In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of ...

data structure
s known as
buffers Buffer may refer to: Science * Buffer gas, an inert or nonflammable gas * Buffer solution, a solution used to prevent changes in pH * Buffering agent, the weak acid or base in a buffer solution * Lysis buffer, in cell biology * Metal ion buffer * ...
. Buffers may or may not be displayed onscreen, and all buffer features are accessible to both an
Emacs Lisp #REDIRECT Emacs Lisp #REDIRECT Emacs Lisp Emacs Lisp is a Dialect (computing), dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for ...
program and to the user interface. The user can create new buffers and dismiss unwanted ones, and many buffers can exist at the same time. There is no upper limit on the number of buffers Emacs allows, other than hardware memory limits. Advanced users may amass hundreds of open buffers of various types relating to their current work. Emacs can be configured to save the list of open buffers on exit, and reopen this list when it is restarted. Some buffers contain text loaded from
text file A text file (sometimes spelled textfile; an old alternative name is flatfile) is a kind of computer file A computer file is a computer resource for recording data Data (; ) are individual facts, statistics, or items of information, oft ...
s, which the user can edit and save back to permanent storage. These buffers are said to be "visiting" files. Buffers also serve to display other data, such as the output of Emacs commands,
dired Dired (for Directory Editor) is a computer program In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative programming, a ''computer program'' ...

dired
directory listings, documentation strings displayed by the "help" library and notification messages that in other editors would be displayed in a
dialog box The dialog box (also called dialogue box (non-U.S. English) or just dialog) is a graphical control element ., 300px, right Image:GUI Frame.svg, upExample of enabled and disabled widgets; the frame (GUI), frame at the bottom is disabled, the ...
. Some of these notifications are displayed briefly in the minibuffer, and GNU Emacs provides a buffer that keeps a history of the most recent notifications of this type. When the minibuffer is used for output from Emacs, it is called the "echo area". Longer notifications are displayed in buffers of their own. The maximum length of messages that will be displayed in the minibuffer is, of course, configurable. Buffers can also serve as input and output areas for an external process such as a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses ** Thin-shell structure Science Biology * Seashell, a hard out ...
or REPL. Buffers which Emacs creates on its own are typically named with
asterisk The asterisk , from Late Latin , from Ancient Greek , ''asteriskos'', "little star", is a Typography, typographical symbol. It is so called because it resembles a conventional image of a star (heraldry), star. Computer scientists and mathem ...

asterisk
s on each end, to distinguish from user buffers. The list of open buffers is itself displayed in this type of buffer. Most Emacs key sequences remain functional in any buffer. For example, the standard Ctrl-s isearch function can be used to search filenames in dired buffers, and the file list can be saved to a text file just as any other buffer. dired buffers can be switched to a writable mode, in which filenames and attributes can be edited textually; when the buffer is saved, the changes are written to the filesystem. This allows multiple files to be renamed using the search and replace features of Emacs. When so equipped, Emacs displays
image files Image file formats are standardized means of organizing and storing digital image A digital image is an image An image (from la, imago) is an artifact that depicts visual perception Visual perception is the ability to interp ...
in buffers. Emacs is binary safe and 8-bit clean. Emacs can split the editing area into separate non-overlapping sections called "windows," a feature that has been available since 1975, predating the graphical user interface in common use. In Emacs terminology, "windows" are similar to what other systems call "
frames A frame is often a structural system that supports other components of a physical construction and/or steel frame that limits the construction's extent. Frame and FRAME may also refer to: Arts and media Film and television *Frame (film), one of ...
" or " panes" a rectangular portion of the program's display that can be updated and interacted with independently. Each Emacs window has a
status bar A status bar is a graphical control element ., 300px, right Image:GUI Frame.svg, upExample of enabled and disabled widgets; the frame (GUI), frame at the bottom is disabled, they are grayed out. A graphical widget (also graphical control elem ...
called the "mode line" displayed by default at the bottom edge of the window. Emacs windows are available both in text-terminal and graphical modes and allow more than one buffer, or several parts of a buffer, to be displayed at once. Common applications are to display a
dired Dired (for Directory Editor) is a computer program In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative programming, a ''computer program'' ...

dired
buffer along with the contents of files in the current directory (there are special modes to make the file buffer follow the file highlighted in dired), to display the
source code In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and ...

source code
of a program in one window while another displays a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses ** Thin-shell structure Science Biology * Seashell, a hard out ...
buffer with the results of compiling the program, to run a debugger along with a shell buffer running the program, to work on code while displaying a
man page A man page (short for manual page) is a form of software documentation Software documentation is written text or illustration that accompanies computer software or is embedded in the source code. The documentation either explains how the softw ...
or other documentation (possibly loaded over the
World Wide Web The World Wide Web (WWW), commonly known as the Web, is an information system An information system (IS) is a formal, sociotechnical Sociotechnical systems (STS) in organizational development is an approach to complex organizational ...
using one of Emacs' built-in web browsers) or simply to display multiple files for editing at once such as a header along with its implementation file for C-based languages. In addition, there is , a minor mode that chains windows to display non-overlapping portions of a buffer. Using , a single file can be displayed in multiple side-by-side windows that update appropriately when scrolled. In addition, Emacs supports "narrowing" a buffer to display only a portion of a file, with top/bottom of buffer navigation functionality and buffer size calculations reflecting only the selected range. Emacs windows are tiled and cannot appear "above" or "below" their companions. Emacs can launch multiple "frames", which are displayed as individual
windows Microsoft Windows, commonly referred to as Windows, is a group of several proprietary {{Short pages monitor