HOME

TheInfoList



OR:

GNU Emacs is a free software text editor. It was created by GNU Project founder Richard Stallman, based on the
Emacs 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, describes it as "the extensible, customizable, s ...
editor developed for Unix operating systems. GNU Emacs has been a central component of the GNU project and a flagship project of the free software movement. Its name has occasionally been shortened to GNUMACS. 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 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 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 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 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 (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. Although users commonly submitted patches and Elisp code to the net.emacs newsgroup, 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 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 today uses the 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. Wiegley was joined by Eli Zaretskii in July, 2016, and Lars Ingebrigtsen in September, 2020.


Licensing

The terms of the GNU General Public License (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 license for free documentation, designed by the Free Software Foundation (FSF) for the GNU Project. It is similar to the GNU General Public License, giving readers the r ...
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 holder executes a suitable disclaimer or assignment of their copyright interest to the Free Software Foundation. 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 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 may refer to: * ''Violated'' (EP), a 1996 EP by Stuck Mojo * ''Violated'' (1996 film), a Nigerian romantic drama film * '' Violated!'', a 1974 film directed by Albert Zugsmith. {{dab ...
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 sequences or pressing the control key and/or the meta key, 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 (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 as inferior process, as well as read–eval–print loop (REPL) modes for various programming languages. Emacs' support for external processes makes it an attractive environment for interactive programming along the lines of Interlisp or
Smalltalk Smalltalk is an object-oriented, dynamically typed reflective programming language. It was designed and created in part for educational use, specifically for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Ka ...
. Users who prefer IBM Common User Access-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 boxes 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 is available using the tab and space keys.


File management and display

Emacs keeps text in
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 ...
s known as buffers. Buffers may or may not be displayed onscreen, and all buffer features are accessible to both an Emacs Lisp 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 files, 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 directory listings, documentation strings displayed by the "help" library and notification messages that in other editors would be displayed in a dialog box. 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 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 typographical symbol. It is so called because it resembles a conventional image of a heraldic star. Computer scientists and mathematicians often voc ...
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 An Image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be c ...
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: Physical objects In building construction *Framing (co ...
" 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 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 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 of a program in one window while another displays a shell 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 or other documentation (possibly loaded over the World Wide Web 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 in a graphical environment. On a text terminal, multiple frames are displayed stacked filling the entire terminal, and can be switched using the standard Emacs commands.


Major modes

GNU Emacs can display or edit a variety of different types of text and adapts its behavior by entering add-on modes called "major modes". There are major modes for many different purposes including editing ordinary text files, the source code of many markup and programming languages, as well as displaying web pages, directory listings and other system info. Each major mode involves an Emacs Lisp program that extends the editor to behave more conveniently for the specified type of text. Major modes typically provide some or all of the following common features: * Syntax highlighting ("font lock"): combinations of fonts and colors, termed "faces," that differentiate between document elements such as keywords and comments. * Automatic indentation to maintain consistent formatting within a file. * The automatic insertion of elements required by the structure of the document, such as spaces, newlines, and parentheses. * Special editing commands, such as commands to jump to the beginning or the end of a function while editing a programming file or commands to validate documents or insert closing tags while working with markup languages such as XML.


Minor modes

The use of "minor modes" enables further customization. A GNU Emacs editing buffer can use only one major mode at a time, but multiple minor modes can operate simultaneously. These may operate directly on documents, as in the way the major mode for the C programming language defines a separate minor mode for each of its popular indent styles, or they may alter the editing environment. Examples of the latter include a mode that adds the ability to undo changes to the window configuration and one that performs on-the-fly syntax checking. There is also a minor mode that allows multiple major modes to be used in a single file, for convenience when editing a document in which multiple programming languages are embedded.


"Batch mode"

GNU Emacs supports the capability to use it as an interpreter for the Emacs Lisp language without displaying the text editor user interface. In batch mode, user configuration is not loaded and the terminal interrupt characters C-c and C-z will have their usual effect of exiting the program or suspending execution instead of invoking Emacs keybindings. GNU Emacs has
command line options A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
to specify either a file to load and execute, or an Emacs Lisp function may be passed in from the command line. Emacs will start up, execute the passed-in file or function, print the results, then exit. The shebang line #!/usr/bin/emacs --script allows the creation of standalone scripts in Emacs Lisp. Batch mode is not an Emacs mode ''per se'', but describes an alternate execution mode for the Emacs program.


Manuals

Apart from the built-in documentation, GNU Emacs has a detailed
manual Manual may refer to: Instructions * User guide * Owner's manual * Instruction manual (gaming) * Online help Other uses * Manual (music), a keyboard, as for an organ * Manual (band) * Manual transmission * Manual, a bicycle technique similar to ...
. An electronic copy of the ''GNU Emacs Manual'', written by Richard Stallman, is bundled with GNU Emacs and can be viewed with the built-in info browser. Two additional manuals, the ''Emacs Lisp Reference Manual'' by Bil Lewis, Richard Stallman, and Dan Laliberte and ''An Introduction to Programming in Emacs Lisp'' by
Robert Chassell Robert "Bob" Chassell was one of the founding directors of the Free Software Foundation (FSF). Life Bob was born on 22 August 1946, in Bennington, VT. He read economics at Peterhouse, Cambridge University. In 1985, he became one of the foun ...
, are included. All three manuals are also published in book form by the Free Software Foundation. The XEmacs manual is similar to the ''GNU Emacs Manual'', from which it forked at the same time that the XEmacs software forked from GNU Emacs.


Internationalization

GNU Emacs has support for many alphabets, scripts, writing systems, and cultural conventions and provides
spell-checking In software, a spell checker (or spelling checker or spell check) is a software feature that checks for misspellings in a text. Spell-checking features are often embedded in software or services, such as a word processor, email client, electronic d ...
for many languages by calling external programs such as ispell. Version 24 added support for bidirectional text and left-to-right and right-to-left writing direction for languages such as Arabic, Persian and Hebrew. Many character encoding systems, including UTF-8, are supported. GNU Emacs uses UTF-8 for its encoding as of GNU 23, while prior versions used their own encoding internally and performed conversion upon load and save. The internal encoding used by XEmacs is similar to that of GNU Emacs but differs in details. The GNU Emacs user interface originated in English and, with the exception of the beginners' tutorial, has not been translated into any other language. A subsystem called ''
Emacspeak Emacspeak is a free computer application, a speech interface, and an audio desktop (as opposed to a screen reader). It employs Emacs (which is written in C), Emacs Lisp, and Tcl. Developed principally by T. V. Raman (himself blind since chil ...
'' enables visually impaired and blind users to control the editor through audio feedback.


Extensibility

The behavior of GNU Emacs can be modified and extended almost without limit by incorporating Emacs Lisp programs that define new commands, new buffer modes, new keymaps, add command-line options, and so on. Many extensions providing user-facing functionality define a major mode (either for a new file type or to build a non-text-editing user interface); others define only commands or minor modes, or provide functions that enhance another extension. Many extensions are bundled with the GNU Emacs installation; others used to be downloaded as loose files (the Usenet newsgroup gnu.emacs.sources was a traditional means of distribution) but there has been a development of managed packages and package download sites since version 24, with a built-in package manager (itself an extension) to download, install, and keep them up to date. The list of available packages is itself displayed in an Emacs buffer set to major mode. Notable examples include: * AUCTeX, tools to edit and process TeX and LaTeX documents * dired, a file manager * Dissociated press, a
Racter ''Racter'' is an artificial intelligence computer program that generates English language prose at random. It was published in 1984 by Mindscape. History Racter, short for ''raconteur'', was written by William Chamberlain and Thomas Etter. The e ...
-like text generator * Doctor, an implementation of ELIZA *
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 ...
, a text adventure *
Emacs Web Wowser Emacs Web Wowser (a backronym of "eww") is a lightweight web browser within the GNU Emacs text editor. Eww can only do basic rendering of HTML; there is no capability for executing JavaScript or handling the intricacies of CSS. It was developed ...
(eww), a web browser. * Emacs Speaks Statistics (ESS) modes for editing statistical languages like R and SAS * ERC, an IRC client *
Eshell In computing, a command-line interpreter, or command language interpreter, is a blanket term for a certain class of programs designed to read lines of text entered by a user, thus implementing a command-line interface. Operating system shells ...
, a command line shell written in Emacs Lisp. This allows closer integration with the Emacs environment than standard shells such as bash or PowerShell, which are also available from within Emacs. For example, in Eshell, Elisp functions are available as shell commands and output from Unix commands can be redirected to an Emacs buffer. * Exwm, an X window manager allowing X11 apps to be run in an Emacs window. * Gnus, a full-featured
news client A newsreader is an application program that reads articles on Usenet distributed throughout newsgroups. Newsreaders act as clients which connect to a news server, via the Network News Transfer Protocol (NNTP), to download articles and post new ar ...
(newsreader) and email client and early evidence for Zawinski's Law * Magit, for working with the version control system Git * MULtilingual Enhancement to Emacs (
MULE The mule is a domestic equine hybrid between a donkey and a horse. It is the offspring of a male donkey (a jack) and a female horse (a mare). The horse and the donkey are different species, with different numbers of chromosomes; of the two pos ...
) allows editing of text in multiple languages in a manner somewhat analogous to Unicode * Org-mode for keeping notes, maintaining various types of lists, planning and measuring projects, and composing documents in many formats (such as
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
, HTML, or OpenDocument formats). There are static site generators using org mode, as well as an extension, Babel, allowing it to be used for literate programming. *
Planner Planner may refer to: * A personal organizer (book) for planning * Microsoft Planner * Planner programming language * Planner (PIM for Emacs) * Urban planner * Route planner * Meeting and convention planner * Japanese term for video game de ...
, a personal information manager * rcirc, an IRC client * Superior Lisp Interaction Mode for Emacs ( SLIME) extends GNU Emacs into a development environment for
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 ...
. With SLIME (written in Emacs Lisp) the GNU Emacs editor communicates with a Common Lisp system (using the SWANK backend) over a special communication protocol and provides such tools as a read–eval–print loop, a data inspector and a debugger. * Texinfo (Info), an online help-browser * Zone, a display hack mode incorporating various text effects.


Performance

GNU Emacs often ran noticeably slower than rival text editors on the systems in which it was first implemented, because the loading and
interpreting Interpreting is a translational activity in which one produces a first and final target-language output on the basis of a one-time exposure to an expression in a source language. The most common two modes of interpreting are simultaneous inter ...
of its Lisp-based code incurs a performance overhead. Modern computers are powerful enough to run GNU Emacs without slowdowns, but versions prior to 19.29 (released in 1995) couldn't edit files larger than 8 MB. The file size limit was raised in successive versions, and
32 bit In computer architecture, 32-bit computing refers to computer systems with a Central processing unit, processor, computer memory, memory, and other major system components that operate on data in 32-Bit, bit units. Compared to smaller bit widths, ...
versions after GNU Emacs 23.2 can edit files up to 512 MB in size. Emacs compiled on a 64-bit machine can handle much larger buffers. While primarily written in Emacs Lisp, Emacs can make use of C libraries to improve performance. For example, for parsing XML and JSON, Emacs can use libxml2 and libjansson, respectively, instead of the slower built-in Emacs Lisp libraries. Packages installed by the user can load dynamic modules. Since version 28.1, Emacs can natively compile Emacs Lisp files via libgccjit, as opposed to just byte compiling them.


Platforms

GNU Emacs is one of the most- ported non-trivial computer programs and runs on a wide variety of operating systems, including DOS, Windows and
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Ope ...
. Support for some "obsolete platforms was removed in Emacs 23.1", such as VMS and most commercial Unix variants. It is available for most Unix-like operating systems, such as Linux, the various BSDs,
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
, AIX,
HP-UX HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
and macOS, and is often included with their system installation packages. Native ports of GNU Emacs exist for
Android Android may refer to: Science and technology * Android (robot), a humanoid robot or synthetic organism designed to imitate a human * Android (operating system), Google's mobile operating system ** Bugdroid, a Google mascot sometimes referred to ...
and Nokia's Maemo. GNU Emacs runs both on text terminals and in graphical user interface (GUI) environments. On Unix-like operating systems, GNU Emacs can use the X Window System to produce its GUI either directly using
Athena widgets X Athena Widgets or Xaw is a GUI widget library for the X Window System. Developed as part of Project Athena, Xaw was written under the auspices of the MIT X Consortium as a sample widget set built on X Toolkit Intrinsics (Xt); Xt and Xaw are co ...
or by using a "widget toolkit" such as
Motif Motif may refer to: General concepts * Motif (chess composition), an element of a move in the consideration of its purpose * Motif (folkloristics), a recurring element that creates recognizable patterns in folklore and folk-art traditions * Moti ...
, LessTif, or
GTK+ GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprie ...
. GNU Emacs can also use the graphics systems native to macOS and Windows to provide menubars, toolbars,
scrollbar A scrollbar is an interaction technique or widget in which continuous text, pictures, or any other content can be scrolled in a predetermined direction (up, down, left, or right) on a computer display, window, or viewport so that all of the con ...
s and context menus conforming more closely to each platform's look and feel.


Forks


XEmacs

Lucid Emacs, based on an early version of GNU Emacs 19, was developed beginning in 1991 by Jamie Zawinski and others at Lucid Inc. One of the best-known 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. After Lucid filed for bankruptcy, Lucid Emacs was renamed XEmacs and remains the second most popular variety of Emacs, after GNU Emacs. XEmacs development has slowed, with the most recent stable version 21.4.22 released in January 2009, while GNU Emacs has implemented many formerly XEmacs-only features. This has led some users to proclaim XEmacs' death.


Other forks of GNU Emacs

Other forks, less known than XEmacs, include: * Meadow a Japanese version for Microsoft Windows * SXEmacs Steve Youngs' fork of XEmacs * Aquamacs a version which focuses on integrating with the Apple Macintosh user interface * Remacs a port of GNU Emacs to the Rust programming language.


Release history

Changes in each Emacs release are listed in a NEWS file distributed with Emacs. Changes brought about by ''downgrading'' to the previous release are listed in an "Antinews" file, often with some snarky commentary on why this might be desirable.


References


Further reading

* * * * *


External links

*
Unofficial Emacs wiki

Emacs - Free Software Directory
{{Authority control Emacs Free file comparison tools Free integrated development environments Free software programmed in C Free software programmed in Lisp Free text editors
Emacs 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, describes it as "the extensible, customizable, s ...
Hex editors Linux integrated development environments Linux text editors MacOS text editors OpenVMS text editors Software using the GPL license Text editors Unix text editors Windows text editors