Emacs

Emacs is a family of text editors having an extensible whole of functionalities and which is very popular among the programmers and more generally people having technical skills on the computers.

The original EMACS, meaning E diting MAC ro' running one TECO , i.e. “Macro S of edition for TECO”, was written in 1975 by Richard Stallman, initially with Guy Steele. It was inspired by the ideas developed in TECMAC and TMACS, two plays of macros of edition for TECO, in particular written by Guy Steele, Dave Moon, Richard Greenblatt and Charles Frankston.

Many versions of Emacs appeared in the following years, but currently two versions are really dominating: GNU Emacs, initiated in 1984 by Richard Stallman, who maintains it today still, and XEmacs, a Fork of GNU Emacs begun in 1991, which remains mainly compatible.

These two versions use a powerful language of extension, Emacs Lisp, which allows the assumption of responsibility of tasks evolved/moved, such as the writing and the compilation of program S, the Navigation on the WEB, the reading of the discussion forums or the Email.

In the culture UNIX, Emacs is traditionally one of the two belligerents of the war of the editors, his opponent being VI (or its equivalent improved Vim).

History

Emacs was born with the MIT AI Lab in the Années 1970. Before his creation, the editor by defect on ITS, the Operating system of the computers PDP-6 and PDP-10 of AI Lab, was an editor line-by-line known under the name of TECO. Contrary to the modern text editors, TECO treated the seizure, the edition and the posting of the document like separated modes, such as VI did it later. The seizure of characters in TECO did not insert the characters directly in the document; it was necessary to give a sequence of instructions in the process control language of TECO to ask him to insert the desired characters. During this time, the published text was not posted with the screen. This behavior is similar to that of the program ED, always used nowadays.

In 1972 (or 1974), Richard Stallman visits the Stanford AI Lab and sees the editor E . This last has an interface intuitive WYSIWYG, as that which universally all the modern editors adopted. Impressed by this functionality, Richard Stallman turns over to the MIT, where Carl Mikkelsen, one of the Hacker S of AI Lab, has just added to TECO the edition-posting mode called Control-R , which refreshes the screen on each time the user presses on a key. Stallman récrit this mode so that it functions effectively, then adds the possibility to him of carrying out macros, which makes it possible the user to redefine any key so that it carries out a program TECO.

This new version of TECO is immediately popular in AI Lab, and a vast personalized collection of macros is quickly accumulated, these last having very often a name ending in “MAC” or “MACS”, which means “macros”. Two years later, Guy Steele takes the project to unify the too great diversity of the command sets keyboards in a single play. After one night of hacking between Steele and Stallman, this last finishes the coding, which includes facilities to extend and document the new handset of macros. The system is then called “EMACS”, which means “Editing MACroS” (“macros of French edition”). According to Stallman, it chose the name “ Emacs because was not used as abbreviation on ITS at this time. ” It was as noted as “Emack & Bolio' S” was the name of a popular merchant of ice cream with Boston, with some steps of MIT. A text editor used on ITS was called later BOLIO by Dave Moon, which attended the merchant. However, Stallman did not like these ice creams, and did not even know them when it chose the name “Emacs”.

Stallman then carries out the danger of a too great possible personalization and forks de facto. It lays down certain conditions with its use, which it writes later:

" EMACS was distributed one has off basis communal sharing, which means all improvements must Be given back to me to Be incorporated and distributed."
Free translation: “Emacs is placed at the disposal on the basis of a Community division, which means that all the improvements must be to me sent to integrate them and to distribute them. ”

The original Emacs, just like TECO, functioned only on PDP-10. Many an Emacs or comparable were then written in the following years for other computing systems, in particular SINE ( SINE Is Not EMACS , “Sine is not EMACS”), EINE ( EINE Is Not EMACS ) and ZWEI ( ZWEI Was EINE Initially , “ZWEI was EINE before”) for the Machine Lisp, which was written by Michael McMahon and Daniel Weinreb (these names mean “one” and “two” in German). In 1978, Bernard Greenberg writes Emacs for Multics in Cambridge Information Systems Lab of Honeywell. Multics Emacs is written in Maclisp, a dialect of Computer programming language Lisp. The extensions of the users are also written in Lisp. The choice of Lisp authorizes an extensibility up to that point unknown, and was taken again by many Emacs later.

Although EMACS was designed with TECO, its behavior is sufficiently different so that it can be regarded as a text editor to whole share. It quickly became the standard editor on ITS. It also was carried of ITS towards the operating systems Tenex and TOPS-20 by Michael McMahon, but not immediately on Unix. The first editor similar to Emacs to be functioned on UNIX is Gosling Emacs, developed by James Gosling in 1981. He is written in language C and with the characteristic to use a language, Mocklisp, whose syntax is inspired by Lisp, like language for the extensions. In 1984, there remains a Logiciel owner.

In 1984, Stallman starts to work on GNU Emacs to produce a Free software like alternative to Gosling Emacs. Based in the beginning on Gosling Emacs, Stallman ended up replacing the interpreter interns Mocklisp by a true Lisp interpreter, which involved the replacement of practically all the code. It then becomes the first program distributed by the incipient project GNU. GNU Emacs is written out of C and provides Emacs Lisp (itself written into C) like language of extension. The first largely distributed version of GNU Emacs is the 15.34, published in 1985 (versions 2 to 12 never existed, the first versions were numbered 1.x.y, but shortly after the version 1.12, the decision to give up the 1. was taken, because it seemed established that the major number would never change. Version 13, it publicly distributed first, was published the March 20th 1985).

Just like Gosling Emacs, GNU Emacs functions on UNIX; however, GNU Emacs has much more functionalities, particularly complete a Lisp environment like language of extension. So it replaces soon Gosling Emacs as editor Emacs de facto on UNIX.

Started in 1991, Lucid Emacs was developed by Jamie Zawinski as well as other people of Lucid Inc., on the basis of a version alpha of GNU Emacs 19. The bases of codes quickly diverged, and the two development teams gave up the judicious attempts at fusion to lead to a single program. It is about the one of the most famous Fork S of a Free software. Lucid Emacs has had for summer renamed XEmacs. It remains, with GNU Emacs, one of the alternatives of Emacs most used to date.

GNU Emacs was initially planned for machines having a space of addressing of 32 bits and having one megabyte of RAM, which at that time held it for machines considered as high-of-range. This fact left place to reduced versionsplus. Among most remarkable:

  • MicroEMACS, a very portable version, originally written by Dave Conroy, and then developed by Daniel Lawrence, and who exists under many alternatives. It is the editor used by Linus Torvalds.

  • MG (editor), initially called MicroGNUEmacs, a ramification of MicroEMACS designed to resemble GNU Emacs more. It is now installed by defect on OpenBSD.

  • JOVE ( Jonathan' S Own Version off Emacs ), a nonprogrammable version of Emacs for the systems UNIX and assimilated, written by Jonathan Payne.

  • Freemacs, a version DOS with a language of extension based on a pile, the whole within the limit of 64 KB random access memory.

Functionalities

The continuation of this article relates to mainly GNU Emacs and XEmacs, the two alternatives of Emacs most largely used currently. The term Emacs refers to the two programs, because their functionalities are very similar. XEmacs began like a clone from GNU Emacs, and its later versions remained more or less compatible with GNU Emacs.

Thanks to, or perhaps because of, its worthy grandfather, Emacs is one of the most powerful text editors and most general-purpose. It is advisable however to recall that it acts above all of a text editor , and not of a Word processing . Its very many functionalities are intended to help the user to handle pieces of text, rather than to handle font faces or to print documents (although Emacs of it is able). Emacs proposes a multitude of functionalities to achieve the wrongfully simple task to publish text, since the handling of the words and the paragraphs (to erase them, them move, to move there, etc), until the syntactic to facilitate the reading of the Source code, while passing by the Macro S with the keyboard, to carry out any sequence or not, interactive Coloration, of orders defined by the user.

The richness of functionalities offered by Emacs is the result of an unusual design. Practically all the functionalities of the editor, since the operations of basic edition like the insertion of a character in a file until the configuration of the user interface, are controlled by the means of a dialect of the computer programming language Lisp, called Emacs Lisp. In this Lisp environment, the variables and even the function S can be modified with the flight, without it being necessary of recompiler or to even start again the editor. So the behavior of Emacs can be changed almost without limits, that it is by the user, or (more generally) by charging with important portions of code, called libraries (“libraries”), packages (“parcelling”) or extensions .

Emacs includes a great number of libraries Emacs Lisp, and many others, independent, can be found on Internet. Many libraries propose facilities for the programmers, reflecting the popularity of Emacs among the data processing specialists. Emacs can be used like a Environnement of development integrated (EDI), making it possible to the programmers to modify, to compile and débuguer their code since a single interface. Other libraries have less usual functions, for example:

  • Calc , a powerful Computer numerical;

  • Calendar-mode, to manage its timetable;
  • Doctor , a version of ELIZA which proposes a basic psychotherapy Rogerienne;
  • Dunnet, a play of adventure in text mode;
  • Ediff, to work in an interactive way with the files of Diff érences;
  • Emerges, to compare files and to amalgamate them;
  • Emacs/W3, a Navigator Web;
  • ERC (Emacs), a Customer IRC;
  • Gnus, a customer complete email and news;
  • MULE, MUltiLingual extensions to Emacs , allowing the text-editing writes in several alphabets and several languages, similar to Unicode;
  • Information, a navigator Hypertext for on line help;
  • Tetris .

The disadvantage of the design based on Lisp is the overcost in term of power processor to charge and interpret the Lisp code. On the systems on which it was initially developed, Emacs was often definitely slower than the rival text editors. Many jokes with acronyms refer there: Eight Megabytes And Constantly Swapping (“eight mégas and rows continuously”, at the time where 8 Mo represented much memory), Emacs Makes has Computer Slow fox trot (“Emacs slows down your computer”), and Eventually Malloc S All Computer Storage (“Ends up consuming all the memory”). However, the modern computers are now rather fast so that it is rare that Emacs appears slow. Actually, Emacs starts more quickly than the majority of the modern word processing. Some claim that Emacs is the Acronyme of Esc Meta Alt Control Shift because of some of the combinations to the keyboard, considered to be complicated, of its interface.

Modes of edition

Emacs adapts its behavior to the type of text in the course of edition while passing from a mode of edition to another. These modes are called major modes . They are defined for the ordinary textual files, the Source code many Computer programming language, the documents HTML, TeX, LaTeX, etc Each mode major adjusts certain Lisp variables of Emacs so that it behaves in a way more adapted to the type of the textual file in the course of edition. The modes implement in particular the syntactic Coloration. They provide also particular format controls; for example, the major modes of the computer programming languages define usually orders to go at the beginning or the end of a function.

The behavior of Emacs can be more personalized by using minor modes . Whereas only one major mode can be associated with a plug, several minor modes can be activated simultaneously. For example, the major mode for the Langage C defines a minor mode for each convention of Indentation.

Personalization

Many users personalize Emacs so that he meets their specific needs. There exist three manners of personalizing Emacs. The first is the extension customize , which makes it possible the user to fix the value of the common variables of personalization, such as the play of color of the graphical interface. It is planned for the users beginning with Emacs, who do not want or cannot work in Lisp.

The second manner consists in collecting the sequences of keys in Macro S and them rejouer to automate the painful and repetitive tasks. These macros is often created for the occasion and is destroyed immediately after their use, although it is possible to record them to call upon them later.

The third method to personalize Emacs is to use Emacs Lisp. Usually, the code Emacs Lisp produced by the user is recorded in a file called .emacs, which is charged when Emacs starts. The file .emacs is often used to fix the value of variables and the short cuts when they differ from the adjustments by defect, or to define new orders that the user judges useful. Certain senior users have a .emacs containing several hundreds of lines, with personalizations changing considerably the behavior owing to lack of Emacs.

If a portion of code Emacs Lisp is useful to all, it is often put in a library and is distributed to the other users. It is possible to find many libraries on Internet. For example, the library called makes it possible to publish them. There exists even a newsgroup Usenet allowing poster the new libraries gnu.emacs.sources. Some of these libraries end up making their way and become “standard libraries” of Emacs.

Documentation

The first Emacs included a powerful library called help , which makes it possible to post the documentation of any order, variable or internal function. For this reason, Emacs is described as car-documented (what does not mean only it writes its own documentation, but which it is able to present it to the user). This functionality makes the documentation of Emacs very accessible. For example, the user can find documentation in connection with a sequence of keys by simply typing C-h k (which carries out the order describe-key) followed sequence. Each function includes a chain documentation, especially designed to be posted if the user asks of the assistance about it. Nowadays, various computer programming languages use a similar principle (for example Lisp, Java or Python).

The assistance system ( help ) of Emacs is intended only to the beginners. It is also useful for the experienced users who write Lisp code. If the documentation of a variable or a function is insufficient, the system help makes it possible to sail in the source code Emacs Lisp of the libraries standards and independent. So it is very convenient to write programs out of Emacs Lisp with Emacs itself.

In addition to the integrated assistance system, Emacs has a very long, very detailed and very readable Manuel. A copy (electronic) of GNU Emacs Manual , written by Richard Stallman, is included with Emacs and can be consulted with the navigator interns Info. XEmacs has a similar handbook, result of a fork of the handbook of GNU Emacs dating from the fork of XEmacs. Two other handbooks, Emacs Lisp Refers Manual of Bill Lewis, Richard Stallman and daN Laliberte, and Programming in Emacs Lisp of Robert Chassell is also included. In addition to their electronic version, all these handbooks are available in the shape of books, published by the Free Software Foundation.

Emacs also proposes a Tutoriel integrated. When Emacs is started without file to publish, it posts instructions to carry out tasks of simple edition and to call upon the tutoriel.

Internationalization

Emacs allows the text-editing written in various languages. It supports several alphabets, writings, written forms and cultural conventions. Emacs is able to carry out the handwriting verification for many languages by calling upon external programs, such as Ispell. Many a encoding of text is recognized and usable, including UTF-8. XEmacs 21.5 can manage Unicode completely, and this functionality is under development in GNU Emacs. However, the interface of Emacs is in English and was not translated in other languages.

For the users badly or blind men, there exists a subsystem called Emacspeak , which makes it possible to use the editor through sound interactions exclusively.

Platforms

Emacs is one of the non-trivaux computer programs more carried. It functions on a great number of operating systems, in particular the majority of the systems UNIX (GNU/Linux, the various systems BSD, Solaris, AIX, Mac OS X, etc), MS-DOS, Microsoft Windows and OpenVMS.

Emacs functions with identical in a console or a graphic Environnement. On the systems of the type UNIX, Emacs uses X Window System for its graphical interface, either directly, or by calling upon a library of Widget S like Motif, LessTif or GTK+. Emacs is also able to use the native graphic systems of Mac OS X (thanks to the API Carbon) and of Microsoft Windows. The graphical interface proposes menu bars and tools, scroll bars and menus contextual.

License

The source code, that they are the components C or Emacs Lisp, is freely available to be consulted, modified and redistributed, under the conditions of LPG. The old versions of the documentation of GNU Emacs were published under ad hoc license, which required the inclusion of a particular text in the modified copies. For example, in the user manual of GNU Emacs, this text indicated how to obtain GNU Emacs, as well as the political test of Richard Stallman " The Proclamation GNU ". The handbooks of XEmacs, derived from the handbooks of GNU Emacs, inherited the same license. Since, the new versions of documentation GNU Emacs use GFDL and make use of the invariant section to impose the inclusion of the same documents, as well as the fact that these handbooks car-proclaim GNU Manuals .

To use Emacs

Orders

In a Shell UNIX, a file can be open to modify it by typing emacs . If the selected file does not exist, the file corresponding is created. For example, emacs xorg.conf publishes the file xorg.conf located in the current directory, if there exists. However, documentation recommends to start Emacs without indicating file, to avoid the bad habits to launch of the emacs distinct for each published file. To consult all the files with a single Emacs is the best means of drawing advantage from Emacs.

In the normal mode of edition, Emacs behaves like the majority of the text editors: the alphanumeric keys (a, b, c, 1, 2, 3, etc) insert the character corresponding, the fléchées keys move the cursor, backspace erases characters, so on. The other orders are called upon with combinations of keys, while pressing on the key Ctrl and/or Meta / Alt at the same time as an alphanumeric key. Each format control actually amounts calling a function of the environment Emacs Lisp. Even a simple order as to type a to insert the character has causes the call of a function, in fact self-insert-command.

The following table shows basic commands.

note: The key is indicated using a C capital and or with a M majuscule.

The orders save-buffer and save-buffers-kill-emacs use a sequence of combinations. For example, C-x C-c means: whereas the key Ctrl remains inserted, press on the key X ; then, now Ctrl inserted, support on C . This technique, giving access more orders than it does not have keys there on the keyboard, was popularized by Emacs, which took it again TECMAC, one of the plays of macros which preceded Emacs slightly. It is now used in certain recent text editors, such as that of Visual Studio.

When Emacs functions in graphic mode, of many orders can be called upon since the tool or menu bars rather than with the keyboard. However, much of experienced users prefer to use the keyboard, because it makes it possible to be faster and is much more convenient once the combinations of memorized corresponding keys.

Certain Emacs orders function by calling upon an external program (like Ispell for the handwriting verification, or GCC for the compilation of the programs), by analyzing the data which it produces and by posting the result in Emacs.

The minibuffer

The minibuffer , usually the line of bottom, is the place where Emacs requires information during the execution of certain orders. The text to be sought or replace, the name of the file to reading or writing and all other information of this kind are seized in the minibuffer. When it is possible, the Complètement (with the key ) is generally available.

Management of the files and posting

Emacs memorizes the text in objects called buffers (“plug”). The user can create new buffers and remove those of which it is not useful any more, several buffers being able to exist simultaneously. The majority of the buffers contain text charged since a Textual file, that the user can modify then to record on the disc. The buffers also make it possible to store text temporarily, like the chains of documentation posted by the library help .

In the graphic mode as in text mode, Emacs is able to share the zone of edition in several sections (called Windows , “windows”, since 1975, which can be a source of confusion on the systems having the concept of window already), so that several buffers can be posted at the same time. Among the uses: a section can post the Source code of a program, while an other watch the result of compilation. In a graphic environment, Emacs can also manage several chart windows, which are then indicated by the term frame .

Orthography

Certain people make a distinction between the word capitalized Emacs , which makes it possible to appoint the editors derived from the versions create by Richard Stallman (in particular GNU Emacs and XEmacs), and the word into tiny emacs , which makes it possible to indicate the many versions independent of Emacs.

The English plural of emacs is usually emacsen , by analogy with the plural of oxen (meaning “French ox”, and whose singular is OX ). The French literature uses sometimes emacsen and sometimes emacs .

See too

Related articles

Random links:Vice-admiral | Usual international law | Hamoir (dancer) | Zaječar | Corcoran mark | Fart