World Library  
Flag as Inappropriate
Email this Article

GNU Emacs

Article Id: WHEBN0017698784
Reproduction Date:

Title: GNU Emacs  
Author: World Heritage Encyclopedia
Language: English
Subject: Emacs, GNU Debugger, Integrated development environment, ELIZA, Hemlock (editor)
Publisher: World Heritage Encyclopedia

GNU Emacs

GNU Emacs
Emacs logo
GNU Emacs 24.3.1 on GNOME 3
Original author(s) Richard Stallman and Guy L. Steele, Jr.
Developer(s) GNU Project
Initial release March 20, 1985 (1985-03-20)
Stable release 24.5 / 10 April 2015 (2015-04-10)
Preview release 24.4.91 / 8 March 2015 (2015-03-08)
Written in C, Emacs Lisp
Operating system Cross-platform to GNU, Linux, Windows, OS X, BSDs and more
Available in English
Type Text editor
License GNU GPLv3
Website /emacs/

GNU Emacs is the most popular and most ported Emacs text editor. It was created by GNU Project founder Richard Stallman. In common with other varieties of Emacs, GNU Emacs is extensible using a Turing complete programming language. GNU Emacs has been called "the most powerful text editor available today."[1] 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.[2] Throughout its history, GNU Emacs has been a central component of the GNU project, and a flagship of the free software movement.[3][4] The tag line for GNU Emacs is "the extensible self-documenting text editor".[5]


Richard Stallman, founder of the GNU Project and author of 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 major version skipped from "1" to "13". A new third version number was added to represent changes made by user sites.[6] In the current numbering scheme, a number with two components signifies a release version, with development versions having three components.[7]

GNU Emacs was later ported to Unix. 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' email subsystem in his 1986 cracking spree. in which he gained superuser access to Unix computers.[8]

Although users commonly submitted patches and Elisp code to the net.emacs newsgroup, GNU Emacs development wasn't relatively open 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 access. Development took place in a single CVS trunk until 2008, and today uses the Git[9] 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.[10] On September 21 2015 Monnier announced that he would be stepping down as maintainer effective with the feature freeze of Emacs 25.[11]


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.

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.

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 with "invariant sections" that require the inclusion of the same documents and that the manuals proclaim themselves as GNU Manuals.

Using GNU Emacs

Editing multiple Dired buffers in GNU Emacs
Editing C source code in GNU Emacs
Editing and compiling C++ code from GNU Emacs


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 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 shell-mode, running a Unix shell as inferior process, as well as 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.[12]

Users who prefer IBM Common User Access-style keys can use cua-mode, a package that originally was a third-party add-on but has been included in GNU Emacs since version 22.


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 structures known as buffers. Buffers may or may not be displayed onscreen, and all buffer features are accessible to an Emacs Lisp program as well as the user interface.[13] The user can create new buffers and dismiss unwanted ones, and several buffers can exist at the same time. Some 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 store temporary text, 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. These notifications are displayed briefly in the minubuffer, and GNU Emacs provides a *Messages* buffer that keeps a history of the most recent notifications of this type. Buffers which Emacs creates on its own are named with asterisks on each end, to distinguish from user buffers.

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. When so equipped, Emacs displays graphics files in buffers. Emacs is binary safe and 8-bit clean.[14]

Emacs can split the editing area into separate sections called "windows," a feature that has been available since 1975, predating the graphical user interface in common use. "Windows" in Emacs are similar to what other systems call "frames" or "panes" - a rectangular portion of the program's display that can be updated and interacted with independently. 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 files in the current directory, to display the source code of a program in one window while another displays a shell buffer with the results of compiling the program, 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 follow-mode, a minor mode that chains windows to display non-overlapping portions of a buffer. Using follow-mode, a single file can be displayed in multiple side-by-side windows that update appropriately when scrolled. 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. It is possible to create multiple frames on a text terminal; these are displayed stacked filling the entire terminal, and can be switched using the standard Emacs commands.[15]

Major modes

GNU Emacs can edit a variety of different types of text and adapts its behavior by entering add-on modes called "major modes." Defined major modes exist for many different file types including ordinary text files, the source code of many programming languages, HTML documents, and TeX and LaTeX documents. 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,"[16] 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, as required when editing a document in which multiple programming languages are embedded.


GNU Emacs Manual (cover art by Etienne Suvasa; cover design by Matt Lee)

Apart from the built-in documentation, GNU Emacs has an unusually long and detailed manual. 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, 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.


GNU Emacs has support for many alphabets, scripts, writing systems, and cultural conventions and provides spell-checking 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 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 enables visually impaired and blind users to control the editor through audio feedback.


GNU Emacs with AUCTeX, a set of tools for editing TeX and LaTeX documents

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, 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 source) 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 and install them.

A few examples include:


GNU Emacs often ran noticeably slower than rival text editors on the systems in which it was first implemented, because the loading and interpreting 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 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.[21]


GNU Emacs has become one of the most-ported non-trivial computer programs and runs on a wide variety of operating systems, including DOS, Microsoft Windows[22][23][24] and OpenVMS. Support for some "obsolete platforms was removed in Emacs 23.1", such as VMS and most Unix variants (except based those on Linux).[25] It is available for most Unix-like operating systems, such as Linux, the various BSDs, Solaris, AIX, HP-UX, IRIX and OS X,[26][27] and is often included with their system installation packages. Native ports of GNU Emacs exist for Android[28] and Nokia's Maemo.[29]

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 or by using a "widget toolkit" such as Motif, LessTif, or GTK+. GNU Emacs can also use the graphics systems native to OS X and Microsoft Windows to provide menubars, toolbars, scrollbars and context menus conforming more closely to each platform's look and feel.



XEmacs 21.5 on GNU/Linux

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 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.[30] 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.[31]

Other forks of GNU Emacs

Other forks, less known than XEmacs, include:

  • Meadow – a Japanese version for Microsoft Windows[32]
  • SXEmacs – Steve Youngs' fork of XEmacs[33]
  • Aquamacs – a version which focuses on integrating with the Apple Macintosh user interface

Release history

Version Release date Significant changes[34]
24.5 April 10, 2015 Mainly a bugfix release.[35][36]
24.4 October 20, 2014 Support for ACLs (access control lists) and digital signatures of Emacs Lisp packages. Improved fullscreen and multi-monitor support. Support for saving and restoring the state of frames and windows. Improved menu support on text terminals. Built-in web browser (M-x eww). A new rectangular mark mode (C-x SPC). File notification support.[37]
24.3 March 10, 2013 Generalized variables are now in core Emacs Lisp, an update for the Common Lisp emulation library, and a new major mode for Python.[38]
24.2 August 27, 2012 Bugfix release[39]
24.1 June 10, 2012 Emacs Lisp Package Archive, support for native color themes, optional GTK+3, support for bi-directional input, support for lexical scoping in emacs lisp[40]
23.4 January 29, 2012 Fixes a security flaw.[41]
23.3 March 10, 2011 Improved functionality for using Emacs with version control systems.
23.2 May 8, 2010 New tools for using Emacs as an IDE, including navigation across a project and automatic Makefile generation. New major mode for editing JavaScript source. The cursor is hidden while the user types.
23.1 July 29, 2009 Support for anti-aliased fonts on X through Xft,[42] better Unicode support, Doc-view mode and new packages for viewing PDF and PostScript files, connection to processes through D-Bus (dbus), connection to the GNU Privacy Guard (EasyPG), nXML mode for editing XML documents, Ruby mode for editing Ruby programs, and more. Use of the Carbon GUI libraries on Mac OS X was replaced by use of the more modern Cocoa GUI libraries.
22.3 September 5, 2008 GTK+ toolkit support, enhanced mouse support, a new keyboard macro system, improved Unicode support, and drag-and-drop operation on X. Many new modes and packages including a graphical user interface to GDB, Python mode, the mathematical tool Calc, and the remote file editing system Tramp ("Transparent Remote (file) Access, Multiple Protocol").[43]
22.2 March 26, 2008 New support for the Bazaar, Mercurial, Monotone, and Git version control systems. New major modes for editing CSS, Vera, Verilog, and BibTeX style files. Improved scrolling support in Image mode.
22.1 June 2, 2007 Support for the GTK+ graphical toolkit, support for drag-and-drop on X, support for the Mac OS X Carbon UI, org-mode version 4.67d included[44]
21.1 October 20, 2001 Support for displaying colors and some other attributes on terminals, built-in horizontal scrolling, sound support, wheel mouse support, improved menu-bar layout, support for images, toolbar, and tooltips, Unicode support
20.1 September 17, 1997 Multi-lingual support
19.34 August 22, 1996 bug fix release with no user-visible changes[45]
19.31 May 25, 1996[46] Emacs opens X11 frames by default, scroll bars on Windows 95 and NT, subprocesses on Windows 95, recover-session to recover multiple files after a crash, some doctor.el features removed to comply with the US Communications Decency Act[47]
19.30 November 24, 1995 Multiple frame support on MS Windows, menu bar available on text terminals, pc-select package to emulate common Windows and Macintosh keybindings.[48]
19.29 June 19, 1995[49]
19.28 November 1, 1994 First official v19 release. Support for multiple frames using the X Windowing System; VC, a new interface for version control systems, font-lock mode, hexl mode for hexadecimal editing.
19.7 May 22, 1993
18.59 October 31, 1992
18.53 February 23, 1989
18.52 August 17, 1988 spook.el a library for adding some "distract the NSA" keywords to every message you send.[50]
18.24 October 2, 1986 Server mode,[51]M-x disassemble, Emacs can open TCP connections, emacs -nw to open Emacs in console mode on xterms.
17.36 December 20, 1985 Backup file version numbers
16.56 July 15, 1985 First Emacs 16 release. Emacs-lisp-mode distinct from lisp-mode,[52] remove all code from Gosling Emacs due to copyright issues[53]
15.10 April 11, 1985
13.0? March 20, 1985


  1. ^
  2. ^
  3. ^
  4. ^
  5. ^
  6. ^
  7. ^
  8. ^
  9. ^ ]
  10. ^ ; see also "Stallman on handing over GNU Emacs, its future and the importance of nomenclature"
  11. ^
  12. ^
  13. ^
  14. ^
  15. ^
  16. ^
  17. ^
  18. ^
  19. ^
  20. ^
  21. ^
  22. ^
  23. ^
  24. ^
  25. ^
  26. ^
  27. ^
  28. ^
  29. ^
  30. ^
  31. ^
  32. ^ FrontPage - Meadow Wiki
  33. ^
  34. ^ Emacs Timeline. Retrieved on 2013-07-17.
  35. ^
  36. ^
  37. ^
  38. ^
  39. ^
  40. ^
  41. ^
  42. ^
  43. ^
  44. ^
  45. ^
  46. ^
  47. ^
  48. ^
  49. ^
  50. ^
  51. ^
  52. ^
  53. ^

Further reading

External links

  • Official website
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.