See Also

Emacs

Emacs is a class of text editor Text editor

A text editor is software application [i] used for editing plain text [i]. ... 

s, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. GNU Emacs, a part of the GNU project GNU

GNU is a free [i] operating system [i] consisting of a kernel [i], libraries [i] ... 

, is under active development and is the most popular version. The GNU Emacs manual describes it as "the extensible, customizable, self-documenting, real-time display editor." As of 2006 2006

2006 is a common year starting on Sunday [i] of the Gregorian calendar [i]. ... 

, the latest release of GNU Emacs is version 21.4. The original EMACS, a set of Editor MACroS for the TECO editor, was written in 1975 by Richard Stallman Richard Stallman

Richard Matthew Stallman is the founder of the free software movement [i], the GNU Project [i], the Free Software Foundation [i] ... 

, initially put together with Guy Steele.

Discussions

  Discussion Features

   Ask a question about 'Emacs'

   Start a new discussion about 'Emacs'

   Answer questions about 'Emacs'

   'Emacs' discussion forum


Encyclopedia

This article is about the text editor Text editor

A text editor is software application [i] used for editing plain text [i]. ... 

. For the unrelated Apple Apple Computer

Apple Computer, Inc. is an American [i] computer [i] technology [i] corporation [i] with ... 

 Macintosh Macintosh

The Macintosh, or Mac, is a line of personal computer [i]s designed, developed, manufactured, and ... 

 computer Computer

A computer is a machine [i] for manipulating data [i] according to a list of instructions [i] ... 

 model, see eMac EMac

The eMac, short for "education Mac", was a Macintosh [i] desktop computer made by Apple Computer [i] ... 

.



Emacs is a class of text editor Text editor

A text editor is software application [i] used for editing plain text [i]. ... 

s, possessing an extensive set of features, that are popular with computer programmers and other technically proficient computer users. GNU Emacs, a part of the GNU project GNU

GNU is a free [i] operating system [i] consisting of a kernel [i], libraries [i] ... 

, is under active development and is the most popular version. The GNU Emacs manual describes it as "the extensible, customizable, self-documenting, real-time display editor." As of 2006 2006

2006 is a common year starting on Sunday [i] of the Gregorian calendar [i].
... 

, the latest release of GNU Emacs is version 21.4.

The original EMACS, a set of Editor MACroS for the TECO editor, was written in 1975 by Richard Stallman Richard Stallman

Richard Matthew Stallman is the founder of the free software movement [i], the GNU Project [i], the Free Software Foundation [i] ... 

, initially put together with Guy Steele. It was inspired by the ideas of TECMAC and TMACS, a pair of TECO-macro editors written by Guy Steele, Dave Moon, Richard Greenblatt, Charles Frankston, and others. Many versions of Emacs have appeared over the years, but nowadays there are two that are commonly used: GNU Emacs, started by Richard Stallman Richard Stallman

Richard Matthew Stallman is the founder of the free software movement [i], the GNU Project [i], the Free Software Foundation [i] ... 

 in 1984 and still maintained by him, and XEmacs XEmacs

XEmacs is a text editor which is based on, and forked [i] from, the GNU Emacs [i] text editor. ... 

, a fork Fork

As a piece of cutlery [i] or kitchenware [i], a fork is a tool consisting of a handle with several narro ... 

 of GNU Emacs which was started in 1991 and has remained mostly compatible. Both use a powerful extension language, Emacs Lisp, that allows them to handle tasks ranging from writing and compiling Compiler

A compiler is a computer program [i] that translates text written in a computer language [i] into ano ... 

 computer programs to browsing the web Web browser

A web browser is a software application [i] that enables a user to display and int... 

.

In Unix Unix

Unix or UNIX is a computer [i] operating system [i] originally developed in the 1960s and 1970s by ... 

 culture, Emacs is one of the two main contenders in the traditional editor wars, the other being vi Vi

vi is a screen-oriented text editor [i] computer program [i] written by Bill Joy [i] in 1976 [i] for an... 

.

History

Emacs began life at the MIT AI Lab during the 1970s. Before its introduction, the default editor on the Incompatible Timesharing System , the operating system Operating system

An operating system is a software program [i] that manages the hardware [i] and software [i] ... 

 on the AI Lab's PDP-6 and PDP-10 PDP-10

The PDP-10 was a computer manufactured by Digital Equipment Corporation [i] from the late 1960s [i] on; ... 

 computers, was a line editor known as TECO. Unlike modern text editors, TECO treated typing, editing, and document display as separate modes, like the later vi would. Typing characters into TECO did not place those characters directly into a document; one had to write a series of instructions in the TECO command language telling it to enter the required characters, during which time the edited text was not displayed on the screen. This behavior is similar to the program ed, which is still in use.

Richard Stallman visited the Stanford AI Lab in 1974 or 1972 and saw the lab's "E" editor. The editor had an intuitive WYSIWYG WYSIWYG

WYSIWYG , is an acronym [i] for What You See Is What You Get ... 

 behavior as is used almost universally by modern text editors. Impressed by this feature, Stallman returned to MIT where Carl Mikkelsen, one of the hacker Hacker

A hacker is a person who creates and modifies computer software [i] and computer hardware [i], including ... 

s at the AI Lab, had added a display-editing mode called "Control-R" to TECO, allowing the screen display to be updated each time the user entered a keystroke. Stallman reimplemented this mode to run efficiently, then added a macro feature to the TECO display-editing mode, allowing the user to redefine any keystroke to run a TECO program.

The new version of TECO was instantly popular at the AI Lab, and soon there accumulated a large collection of custom macros, whose names often ended in "MAC" or "MACS", which stood for "macros". Two years later, Guy Steele took on the project of unifying the overly-diverse keyboard command sets into a single set. After one night of joint hacking by Steele and Stallman, the latter finished the implementation, which included facilities for extending and documenting the new macro set. The resulting system was called EMACS, which stood for "Editing MACroS". According to Stallman, he picked the name Emacs "because was not in use as an abbreviation on ITS at the time." It has also been pointed out that "Emack & Bolio's" was the name of a popular ice cream Ice cream

Ice cream is a frozen dessert [i] made from dairy product [i]s such as cream [i] , combined with... 

 store in Boston Boston, Massachusetts

Boston is the capital [i] of the Commonwealth [i] of Massachusetts [i] in the United States [i] ... 

, within walking distance of MIT. A text-formatting program used on ITS was later named BOLIO by Dave Moon, who frequented that store. However, Stallman did not like that ice cream, and did not even know of it when choosing the name "Emacs"; this ignorance is the basis of a Hacker koan, Emacs and Bolio).

Stallman realized the danger of too much customization and de-facto forking and set certain conditions for usage. He later wrote:
"EMACS was distributed on a basis of communal sharing, which means all improvements must be given back to me to be incorporated and distributed."


The original Emacs, like TECO, ran only on the PDP line. Its behavior was different enough from TECO to be considered a text editor in its own right. It quickly became the standard editing program on ITS. It was also ported from ITS to the Tenex and TOPS-20 operating systems by Michael McMahon, but not Unix, initially.

Other emacsen


Many Emacs-like editors were written in the following years for other computer systems, including SINE , EINE and ZWEI , which were written by Michael McMahon and Daniel Weinreb. In 1978, Bernard Greenberg wrote Multics Emacs at Honeywell Honeywell

Honeywell is a major American [i] multinational corporation [i] that produces electronic c ... 

's Cambridge Information Systems Lab.

The first Emacs-like editor to run on Unix Unix

Unix or UNIX is a computer [i] operating system [i] originally developed in the 1960s and 1970s by ... 

 was Gosling Emacs, written in 1981 by James Gosling James Gosling

James Gosling, Ph.D [i] is a famous software developer [i], best known as the fath ... 

 . It was written in C C (programming language)

The C programming language is a general-purpose, procedural [i], imperative [i] ... 

 and, notably, used a language with Lisp-like syntax known as Mocklisp as an extension language. In 1984 it was proprietary software.

GNU Emacs


In 1984, Stallman began working on GNU Emacs to produce a free software Free software

Free software, as defined by the Free Software Foundation [i], is software [i] which can be used, copied ... 

 alternative to Gosling Emacs; initially it was based on Gosling Emacs, but Stallman replaced the Mocklisp interpreter at its heart with a true Lisp interpreter, which entailed replacing nearly all of the code. It became the first program released by the nascent GNU project GNU

GNU is a free [i] operating system [i] consisting of a kernel [i], libraries [i] ... 

. GNU Emacs is written in C and provides Emacs Lisp  as an extension language. The first widely-distributed version of GNU Emacs was 15.34, which appeared in 1985.

Like Gosling Emacs, GNU Emacs ran on Unix; however, GNU Emacs had more features, in particular a full-featured Lisp as extension language. As a result, it soon replaced Gosling Emacs as the de facto Emacs editor on Unix.

Until 1999, GNU Emacs development was relatively closed, to the point where it was used as an example of the "Cathedral" development style in The Cathedral and the Bazaar The Cathedral and the Bazaar

The Cathedral and the Bazaar is an essay by Eric S. Raymond [i] on software engineering [i] methods ... 

. The project has since adopted a public development mailing list and anonymous CVS access. Development takes place in a single CVS trunk, which is at version 22.0.50. The current maintainer is Richard Stallman Richard Stallman

Richard Matthew Stallman is the founder of the free software movement [i], the GNU Project [i], the Free Software Foundation [i] ... 

.

XEmacs


Beginning in 1991, Lucid Emacs was developed by Jamie Zawinski and others at Lucid Inc., based on an early alpha version of GNU Emacs 19. The codebases soon diverged, and the separate development teams gave up trying to merge them back into a single program. This was one of the most famous early forks Fork

As a piece of cutlery [i] or kitchenware [i], a fork is a tool consisting of a handle with several narro ... 

 of a free software Free software

Free software, as defined by the Free Software Foundation [i], is software [i] which can be used, copied ... 

 program. Lucid Emacs has since been renamed XEmacs XEmacs

XEmacs is a text editor which is based on, and forked [i] from, the GNU Emacs [i] text editor. ... 

; it and GNU Emacs remain the two most popular varieties in use today.

Some people make a distinction between the capitalized word Emacs, which is used to refer to editors derived from versions created by Richard Stallman , and the lower-case word emacs, which is used to refer to the large number of independent emacs reimplementations. The word emacs is often pluralized as emacsen by analogy with oxen — for example, Debian Debian

Debian, organized by the Debian Project, is a widely used distribution [i] of free software [i] ... 

's basic Emacs package is named emacsen-common. The only plural given by the Collins English Dictionary is emacsen.

Other forks


GNU Emacs was initially targeted at computers with a 32-bit flat address space, and at least 1 MiB of RAM, at a time where such computers were considered high end. This left an opening for smaller reimplementations. Some noteworthy ones are listed here:

  • MicroEMACS, a very portable implementation originally written by Dave Conroy and further developed by Daniel Lawrence, which exists in many variations. The editor used by Linus Torvalds.
  • MG, originally called MicroGNUEmacs, an offshoot of MicroEMACS intended to more closely resemble GNU Emacs. Now installed by default on OpenBSD OpenBSD

    ! Computer [i] and operating system [i]

... 

.
  • JOVE , a non-programmable Emacs implementation for UNIX-like Unix-like

    A "Unix-like" operating system [i] is one that behaves in a manner similar to a Unix [i] system, while n... 

     systems by Jonathan Payne.
  • Freemacs, a DOS DOS

    DOS commonly refers to the family of closely related operating system [i]s which dominated the IBM PC compatible [i] ... 

     version with an extension language based on text macro expansion, all within the original 64 KiB flat memory limit.

Licensing


For GNU Emacs , it remains policy to accept significant code contributions only if the copyright Copyright

Copyright is a set of exclusive rights [i] regulating the use of a particular expression of an idea or ... 

 holder executes a suitable disclaimer or assignment of their copyright interest, although one exception was made to this policy for the MULE Mule

[i] [[horse]... 

  code since the copyright holder is the Japanese government and copyright assignment was not possible. This does not apply to extremely minor code contributions or bug fixes. There is no strict definition of minor, but as a guideline less than 10 lines of code is considered minor. This policy is intended to facilitate copyleft Copyleft

Copyleft is a play on the word copyright [i] and is the practice of using copyright law [i] to remove re ... 

 enforcement, so that the FSF can defend the software in a court case if one arises. This requirement by the GNU Emacs maintainers is assumed to affect contributions. Some people claim that it even affects performance, e.g. the inability of GNU Emacs to handle large files in an efficient manner could be blamed on the mentioned requirement repelling any serious developer. However, according to Stallman, it is more important for the program to be "free" than good in any other aspect. Enforcement provides legal confidence in the GNU Emacs free software license—the GNU General Public License GNU General Public License

The GNU General Public License is a widely used free software license [i], originally written by Richard Stallman [i] ... 

—and in the free software itself—an intellectual work with many copyrights and contributors.

Features

The remainder of this article discusses modern Emacs, GNU Emacs and XEmacs, the only incarnations of Emacs that are widely used today. The term "Emacs" will be used to refer to both programs, as they have very similar features; XEmacs started as a fork of GNU Emacs, and subsequent versions have remained more or less compatible with GNU Emacs.

In spite of—or perhaps because of—its venerable background, Emacs is one of the most powerful and versatile text editors in existence. It should be noted that it is primarily a text editor, not a word processor Word processor

A word processor is a computer [i] application [i] used for the production of any ... 

; its huge feature set is geared toward helping the user to manipulate pieces of text, rather than manipulating the font Typeface

In typography [i], a typeface consists of a coordinated set [i] of glyph [i]s designed with stylistic un ... 

 of the characters or printing documents . Emacs brings a host of features to bear on the deceptively simple-seeming task of text editing, ranging from commands to manipulate word Word

A word is a unit of language [i] that carries meaning [i] and consists of one or more morpheme [i]... 

s and paragraph Paragraph

A paragraph is a self-contained unit of a discourse in a written text [i] dealing with a particular poin ... 

s , to syntax highlighting Syntax highlighting

Syntax highlighting is a feature of some text editor [i]s that displays text—especially source code [i] ... 

 for making source code Source code

Source code is any series of statements written in some human-readable [i] computer programming language [i] ... 

 easier to read, to executing "keyboard macros" for performing arbitrary batches of editing commands defined by the user.

The rich variety of features found in Emacs is a result of its unusual design. Almost all of the functionality in the editor, ranging from basic editing operations such as the insertion of characters into a document to the configuration of the user interface, is controlled by a dialect of the Lisp programming language known as Emacs Lisp. In this Lisp environment, variables and even entire functions can be modified on the fly, without having to recompile or even restart the editor. As a result, the behavior of Emacs can be modified almost without limit, either directly by the user, or by loading bodies of Emacs Lisp code known variously as "libraries", "packages", or "extensions".

Emacs contains a large number of Emacs Lisp libraries, and more "third-party" libraries can be found on the Internet Internet

The Internet is the worldwide, publicly accessible network of interconnected computer network [i]s that ... 

. Many libraries implement computer programming aids, reflecting Emacs' popularity among programmers. Emacs can be used as an Integrated Development Environment , allowing programmers to edit, compile Compiler

A compiler is a computer program [i] that translates text written in a computer language [i] into ano ... 

, and debug their code within a single interface. Other libraries perform more unusual functions. A few examples are listed below:

  • Calc, a powerful numerical calculator Calculator

    A calculator is a device for performing calculation [i]s.... 

  • Calendar-mode, for keeping appointment calendars and diaries
  • Doctor, an implementation of ELIZA that performs basic Rogerian psychotherapy
  • Dunnet, a text adventure Interactive fiction

    Interactive fiction, often abbreviated IF, describes software [i] simulating env ... 

  • Ediff, for working with diff files interactively.
  • Emerge, for comparing files and combining them
  • Emacs/W3, a web browser Web browser

    A web browser is a software application [i] that enables a user to display and int... 

  • ERC, an IRC Internet Relay Chat

    Internet Relay Chat is a form of realtime internet [i] chat [i]. ... 

     client
  • Gnus, a full-featured newsreader and email client E-mail client

    An e-mail client, also called a mail user agent , is a computer program [i] that is used to read a... 

  • MULE Mule

    [i] [[horse]... 

    , MultiLingual extensions to Emacs, allowing editing text written in multiple languages, somewhat analogous to Unicode Unicode

    Unicode is an industry standard [i] designed to allow text [i] and symbols from all of the writing systems [i] ... 

  • Info, an online help-browser
  • Emacs-wiki, LISP based wiki software for Emacs
  • Planner , A Personal Information Manager for Emacs
  • Tetris Tetris

    Tetris is widely known as one of the most popular computer puzzle game [i] of all time . ... 

  • Pong Pong

    PONG is a video game [i] by Atari [i], based on the sport of table tennis [i] ... 




The downside to Emacs' Lisp-based design is a performance overhead resulting from loading and interpreting the Lisp code. On the systems in which Emacs was first implemented, Emacs was often noticeably slower than rival text editors. Several joke acronyms allude to this: Eight Megabytes And Constantly Swapping , Emacs Makes A Computer Slow, Eventually Mallocs All Computer Storage, and Eventually Makes All Computers Sick. However, modern computers are fast enough that Emacs is seldom felt to be slow. In fact, Emacs starts up more quickly than most modern word processors. Other joke acronyms describe the user interface: Escape Meta Alt Control Shift.

Platforms

Emacs is one of the most ported non-trivial computer programs in the world. It runs on a wide variety of operating system Operating system

An operating system is a software program [i] that manages the hardware [i] and software [i] ... 

s, including most Unix Unix

Unix or UNIX is a computer [i] operating system [i] originally developed in the 1960s and 1970s by ... 

-like systems , MS-DOS MS-DOS

MS-DOS is an operating system [i] commercialized by Microsoft [i]. ... 

, Microsoft Windows Microsoft Windows

Microsoft Windows is a family of operating system [i]s by Microsoft [i].... 

 and OpenVMS OpenVMS

OpenVMS is the name of a high-end computer server [i] operating system [i] that runs on the VAX [i] and ... 

. Unix systems, both free and proprietary, frequently provide Emacs bundled with the operating system Operating system

An operating system is a software program [i] that manages the hardware [i] and software [i] ... 

.

Emacs runs on both text terminal Data terminal

A data terminal, text terminal, or often just terminal is a serial computer interface for te... 

s and graphical user interface Graphical user interface

A graphical user interface , is a particular case of user interface [i] for interacting with a computer [i] ... 

  environments. On Unix Unix

Unix or UNIX is a computer [i] operating system [i] originally developed in the 1960s and 1970s by ... 

-like operating systems, Emacs uses the X Window System X Window System

In computing [i], the X Window System provides windowing [i] for bitmap [i] ... 

 to produce its GUI, either directly or using a "widget toolkit" such as Motif, LessTif, or GTK+ GTK+

The GIMP Toolkitabbreviated, and almost exclusively known, as GTK+is one of the two most popular widget toolkit [i] ... 

. Emacs can also use the native graphical systems of Mac OS X and Microsoft Windows Microsoft Windows

Microsoft Windows is a family of operating system [i]s by Microsoft [i].... 

. The graphical interface provides menubar Menu (computing)

In computing [i] and telecommunication [i]s, a menu is a list of commands presented to an operator by a ... 

s, toolbar Toolbar

In a graphical user interface [i] on a computer monitor [i] a toolbar is a row, column, or block of onsc ... 

s, scrollbar Scrollbar

A scrollbar, or slider, is a graphical widget [i] in a GUI [i] with which continuous text, ... 

s, and context menu Context menu

The term context menu is commonly used for menus which pop up when clicking an item in a graphical user interface [i] ... 

s.

Editing modes

Emacs adapts its behavior to the type of text it is editing by entering editing modes called "major modes". Major modes are defined for ordinary text files, source code Source code

Source code is any series of statements written in some human-readable [i] computer programming language [i] ... 

 for many programming language Programming language

A programming language is an artificial language [i] that can be used to control [i] ... 

s, HTML HTML

In computing, HyperText Markup Language is a predominant markup language [i] for the creation of web page [i] ... 

 documents, TeX TeX

TeX is a typesetting [i] system created [i] by Donald Knuth [i]. ... 

 and LaTeX LaTeX

,
written as LaTeX in plain text, is a document preparation system [i] for the
... 

 documents, and many other types of text. Each major mode tweaks certain Emacs Lisp variables to make Emacs behave more conveniently for the particular type of text. In particular, they usually implement syntax highlighting Syntax highlighting

Syntax highlighting is a feature of some text editor [i]s that displays text—especially source code [i] ... 

, using different fonts or colors to display keywords, comments, and so forth. Major modes also provide special editing commands; for example, major modes for programming languages usually define commands to jump to the beginning and the end of a function.

The behavior of Emacs can be further customized using "minor modes". While only one major mode can be associated with a buffer at a time, multiple minor modes can be simultaneously active. For example, the major mode for the C programming language defines a different minor mode for each of the popular indent styles.

Customization

Many users of Emacs customize the editor to suit their needs. There are three primary ways to customize Emacs. The first is the customize extension, which allows the user to set common customization variables, such as the colour scheme, using a graphical interface. This is intended for Emacs beginners who do not want to work with Emacs Lisp code.

The second is to collect keystrokes into macros and replay them to automate complex, repetitive tasks. This is often done on an ad-hoc basis and each macro discarded after use, although macros can be saved and invoked at need.

The third method for customizing Emacs is using Emacs Lisp. Usually, user-supplied Emacs Lisp code is stored in a file called .emacs, which is loaded when Emacs starts up. The .emacs file is often used to set variables and key bindings different from the default setting, and to define new commands that the user finds convenient. Many advanced users have .emacs files hundreds of lines long, with idiosyncratic customizations that cause Emacs to diverge wildly from the default behavior.

If a body of Emacs Lisp code is generally useful, it is often packaged as a library and distributed to other users. Many such third-party libraries can be found on the Internet; for example, there is a library called for editing . There is even a Usenet newsgroup, [news://gnu.emacs.sources gnu.emacs.sources], which is used for posting new libraries. Some third-party libraries eventually make their way into Emacs, thus becoming a "standard" library.

Documentation

The first Emacs included a powerful help library that can display the documentation for every single command, variable, and internal function. Because of this, Emacs was described as "self-documenting". This feature makes Emacs' documentation very accessible. For example, the user can find out about the command bound to a particular keystroke simply by entering C-h k , followed by the keystroke. Each function included a documentation string, specifically to be used for showing to the
user on request. The practice of giving functions documentation strings subsequently spread to various programming
languages such as Lisp and Java Java (programming language)

Java is an object-oriented [i] programming language [i] developed by James Gosling [i] ... 

.

The Emacs help system is useful not only for beginners, but also for advanced users writing Emacs Lisp code. If the documentation for a function or variable is not enough, the help system can be used to browse the Emacs Lisp source code for both built-in libraries and installed third-party libraries. It is therefore very convenient to program in Emacs Lisp using Emacs itself.

Apart from the built-in documentation, Emacs has an unusually long, detailed and well-written manual. An electronic copy of the GNU Emacs Manual, written by Richard Stallman, is included with GNU Emacs and can be viewed with the built-in Info browser. XEmacs has a similar manual, which forked from the GNU Emacs Manual at the same time as the XEmacs software. Two other manuals, the Emacs Lisp Reference Manual by Bill Lewis, Richard Stallman, and Dan Laliberte, and Programming in Emacs Lisp by Robert Chassell, are also included. Apart from the electronic versions, all three manuals are also available in book form, published by the Free Software Foundation Free Software Foundation

The Free Software Foundation is a non-profit corporation founded in October 1985 by [[Richard Stallman]... 

.

Emacs also has a built-in tutorial. When Emacs is started with no file to edit, it displays instructions for performing simple editing commands and invoking the tutorial.

Internationalization

Emacs supports the editing of text written in many human languages Language

A language is a system [i] of [i]s, such as voice sounds, gestures or written symbol [i]... 

. There is support for many alphabets, scripts, writing systems, and cultural conventions. Emacs provides spell checking for many languages by calling external programs such as ispell. Many encoding systems, including UTF-8 UTF-8

UTF-8 is a variable-length [i] character encoding [i] for Unicode [i] created b ... 

, are supported. XEmacs version 21.5 has partial Unicode Unicode

Unicode is an industry standard [i] designed to allow text [i] and symbols from all of the writing systems [i] ... 

 support. Emacs 21.4 has similar support; Emacs 22 will be better. All of these efforts use an Emacs-specific encoding internally, necessitating conversion upon load and save. UTF-8 UTF-8

UTF-8 is a variable-length [i] character encoding [i] for Unicode [i] created b ... 

 will become the Emacs-internal encoding in some later version of XEmacs 21.5, and likely in Emacs 23.

However, the Emacs user interface is in English, and has not been translated into any other language, with the exception of the beginners' tutorial.

For visually impaired and blind users, there is a subsystem called Emacspeak which allows the editor to be used through audio feedback only.

License

The source code, including both the C and Emacs Lisp components, is freely available for examination, modification, and redistribution, under the terms of the GNU General Public License GNU General Public License

The GNU General Public License is a widely used free software license [i], originally written by Richard Stallman [i] ... 

 . Older versions of the GNU Emacs documentation were released under an ad-hoc license which required the inclusion of certain text in any modified copy. In the GNU Emacs user's manual, for example, this included how to obtain GNU Emacs and Richard Stallman's political essay "The GNU Manifesto". The XEmacs manuals, which were inherited from older GNU Emacs manuals when the fork occurred, have the same license. The newer versions of the GNU Emacs documentation, meanwhile, uses the GNU Free Documentation License GNU Free Documentation License

The GNU Free Documentation License is a copyleft [i] license [i] for free content [i], designed by the ... 

 and makes use of "invariant sections" to require the inclusion of the same documents, additionally requiring that the manuals proclaim themselves as GNU Manuals.

Using Emacs


Commands

From the Unix shell, a file can be opened for editing by typing "emacs [filename]". If the filename you entered does not exist a file will be created with that name. For example "emacs xorg.conf" will edit the xorg.conf file in the current directory, if it exists. However, Emacs documentation recommends starting Emacs without a file name, to avoid the bad habit of starting a separate Emacs for each file you edit. Visiting all files in a single Emacs process is the way to get the full benefit of Emacs.

In the normal editing mode, Emacs behaves just like other text editors: the character keys insert the corresponding characters, the arrow keys move the editing point, backspace deletes text, and so forth. Other commands are invoked with modified keystrokes, pressing the control key Control key

In computing [i], a Control key is a key which, when pressed in conjunction with another key, will perfo ... 

 and/or the meta key/alt key Alt key

The Alt key on an IBM PC keyboard [i] is the key located immediately to either side of the Space bar [i] ... 

 in conjunction with a regular key. Every editing command is actually a call to a function in the Emacs Lisp environment. Even a command as simple as typing a to insert the character a involves calling a function--in this case, self-insert-command.

Some of the basic commands are shown below. More can be found at List of Emacs commands. The control key [Ctrl] is denoted by a capital C, and the meta or alt [Alt] key by a capital M.
Command Keystroke Description
forward-word M-f Move forward past one word.
search-word C-s Search a word in the buffer.
undo C-/ Undo last change, and prior changes if pressed repeatedly.
keyboard-quit C-g Abort the current command.
fill-paragraph M-q Wrap text in a paragraph.
find-file C-x C-f Visit a file in its own editor buffer.
save-buffer C-x C-s Save the current editor buffer in its visited file.
save-with-newname C-x C-w Save the current editor buffer as a file with the name you specify.
save-buffers-kill-emacs C-x C-c Offer to save changes, then exit Emacs.
set-marker C-[space]Set a marker from where you want to cut or copy.
cut C-w Cut all text between the marker and the cursor.
copy M-w Copy all text between the marker and the cursor.
paste C-y Paste text from the emacs clipboard
kill buffer C-x k Kill the current buffer


Note that the commands save-buffer and save-buffers-kill-emacs use multiple modified keystrokes. For example, C-x C-c means: while holding down the control key, press x; then, while holding down the control key, press c. This technique, allowing more commands to be bound to the keyboard than with the use of single keystrokes alone, was popularized by Emacs, which got it from TECMAC, one of the TECO macro collections that immediately preceded Emacs. It has since made its way into modern code editors like Visual Studio Microsoft Visual Studio

Microsoft Visual Studio is an integrated development environment [i] by Microsoft [i]. ... 

.

When Emacs is running a graphical interface, many commands can be invoked from the menubar or toolbar instead of using the keyboard. However, many experienced Emacs users prefer to use the keyboard because it is faster and more convenient once the necessary keystrokes have been memorized.

Some Emacs commands work by invoking an external program , parsing the program's output, and displaying the result in Emacs.

Minibuffer

The minibuffer, normally the bottommost line, is where Emacs requests information.
Text to target in a search, the name of a file to read or save, and similar information
is entered in the minibuffer. When applicable, tab completion is usually available.

File management and display

Emacs keeps text in objects called buffers. The user can create new buffers and dismiss unwanted ones, and several buffers can exist at the same time. Most buffers contain text loaded from text files, which the user can edit and save back to disk. Buffers are also used to store temporary text, such as the documentation strings displayed by the help library.

In both text terminal and graphical modes, Emacs is able to split the editing area into separate sections , so that more than one buffer can be displayed at a time. This has many uses. For example, one section can be used to display the source code Source code

Source code is any series of statements written in some human-readable [i] computer programming language [i] ... 

 of a program, while another displays the results from compiling the program. In graphical environments, Emacs can also launch multiple graphical-environment windows Window

----

A window is an opening in an otherwise solid and opaque surface through which light and, sometimes... 

, known as "frames" in the context of Emacs.

Emacs Pinky

Because of Emacs' dependence on the modifier keys, in particular the control key is pressed with the pinky finger Little finger

[i] from the [[Dutch language|Dutch]... 

, heavy Emacs users have experienced pain in their pinky fingers . This has been dubbed the "Emacs Pinky", and vi Vi

vi is a screen-oriented text editor [i] computer program [i] written by Bill Joy [i] in 1976 [i] for an... 

 advocates often cite it as a reason to switch to vi. To alleviate this situation, many Emacs users transpose the left control key and the left caps-lock key or define both as control keys. There are also Kinesis's Contoured Keyboard available which reduce the strain by moving the modifier keys altogether so that they are in a position to be easily pushed by the thumb, and Microsoft Natural keyboard Microsoft Natural keyboard

The Microsoft Natural Keyboard is a computer keyboard [i] that was introduced by Microsoft [i] in 1995 [i] ... 

 that has large modifier keys placed symmetrically on both sides of the keyboard so that they can be pressed with palm.

See also

  • List of text editors List of text editors

    The following is a list of text editor [i]s. ... 

  • Comparison of text editors


  • Emacs-wiki
  • GNU TeXmacs GNU TeXmacs

    GNU TEXMACS is a free [i] scientific word processor [i] component of the GNU [i] project, ... 

  • List of Unix programs

References


External links


Official


Emacs for MS Windows and Mac OS
  • Aqua Emacs.
  • Carbon Emacs.

History & Misc


Wiki & Forums
  • – community site dedicated to documenting and discussing Emacs
  • Chinese Emacs Wiki.
  • [irc://freenode.net/emacs] Emacs IRC Internet Relay Chat

    Internet Relay Chat is a form of realtime internet [i] chat [i]. ... 

     Channel on freenode.net
  • [news://comp.emacs comp.emacs] Emacs newsgroup