Original author(s) | David A. Moon, Guy L. Steele Jr. |
---|---|
Developer(s) | Various free/libre software developers, including volunteers and commercial developers |
Initial release | 1976[1][2] |
Written in | Lisp, C |
Operating system | Cross-platform |
Type | Text editor |
Emacs /ˈiːmæks/ or EMACS (Editor MACroS)[3][4][5] is a family of text editors that are characterized by their extensibility.[6] The manual for the most widely used variant,[7]GNU Emacs, describes it as "the extensible, customizable, self-documenting, real-time display editor".[8] Development of the first Emacs began in the mid-1970s, and work on its direct descendant, GNU Emacs, continues actively as of 2021[update].
Emacs has over 10,000 built-in commands and its user interface allows the user to combine these commands into macros to automate work. Implementations of Emacs typically feature a dialect of the Lisp programming language that provides a deep extension capability, allowing users and developers to write new commands and applications for the editor. Extensions have been written to manage email, files, outlines, and RSS feeds,[9] as well as clones of ELIZA, Pong, Conway's Life, Snake and Tetris.[10]
The original EMACS was written in 1976 by David A. Moon and Guy L. Steele Jr. as a set of Editor MACroS for the TECO editor.[2][3][4][5][11] It was inspired by the ideas of the TECO-macro editors TECMAC and TMACS.[12]
The most popular, and most ported, version of Emacs is GNU Emacs, which was created by Richard Stallman for the GNU Project.[13]XEmacs is a variant that branched from GNU Emacs in 1991. GNU Emacs and XEmacs use similar Lisp dialects and are, for the most part, compatible with each other. XEmacs development is inactive.
Emacs is, along with vi, one of the two main contenders in the traditional editor wars of Unix culture. Emacs is among the oldest free and open source projects still under development.[14]
Emacs development began during the 1970s at the MIT AI Lab, whose PDP-6 and PDP-10 computers used the Incompatible Timesharing System (ITS) operating system that featured a default line editor known as Tape Editor and Corrector (TECO). Unlike most modern text editors, TECO used separate modes in which the user would either add text, edit existing text, or display the document. One could not place characters directly into a document by typing them into TECO, but would instead enter a character ('i') in the TECO command language telling it to switch to input mode, enter the required characters, during which time the edited text was not displayed on the screen, and finally enter a character (<esc>) to switch the editor back to command mode. (A similar technique was used to allow overtyping.) This behavior is similar to that of the program ed.
Richard Stallman visited the Stanford AI Lab in 1972 or 1974 and saw the lab's E editor, written by Fred Wright.[16] He was impressed by the editor's intuitive WYSIWYG (What You See Is What You Get) behavior, which has since become the default behavior of most modern text editors. He returned to MIT where Carl Mikkelsen, a hacker at the AI Lab, had added to TECO a combined display/editing mode called Control-R that allowed the screen display to be updated each time the user entered a keystroke. Stallman reimplemented this mode to run efficiently and then added a macro feature to the TECO display-editing mode that allowed the user to redefine any keystroke to run a TECO program.[5]
E had another feature that TECO lacked: random-access editing. TECO was a page-sequential editor that was designed for editing paper tape on the PDP-1 and typically allowed editing on only one page at a time, in the order of the pages in the file. Instead of adopting E's approach of structuring the file for page-random access on disk, Stallman modified TECO to handle large buffers more efficiently and changed its file-management method to read, edit, and write the entire file as a single buffer. Almost all modern editors use this approach.
The new version of TECO quickly became popular at the AI Lab and soon accumulated a large collection of custom macros whose names often ended in MAC or MACS, which stood for macro. Two years later, Guy Steele took on the project of unifying the diverse macros into a single set.[17] Steele and Stallman's finished implementation included facilities for extending and documenting the new macro set.[5] The resulting system was called EMACS, which stood for Editing MACroS or, alternatively, E with MACroS. Stallman picked the name Emacs "because <E> was not in use as an abbreviation on ITS at the time."[18] An apocryphal hacker koan alleges that the program was named after Emack & Bolio's, a popular Cambridge ice cream store.[19] The first operational EMACS system existed in late 1976.[20]
Stallman saw a problem in too much customization and de facto forking and set certain conditions for usage.[citation needed] He later wrote:[20]
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-10 running ITS. Its behavior was sufficiently different from that of TECO that it could be considered a text editor in its own right, and it quickly became the standard editing program on ITS. Mike McMahon ported Emacs from ITS to the TENEX and TOPS-20 operating systems. Other contributors to early versions of Emacs include Kent Pitman, Earl Killian, and Eugene Ciccarelli. By 1979, Emacs was the main editor used in MIT's AI lab and its Laboratory for Computer Science.[21]
In the following years, programmers wrote a variety of Emacs-like editors for other computer systems. These included EINE (EINE Is Not EMACS) and ZWEI[22] (ZWEI Was EINE Initially), which were written for the Lisp machine by Mike McMahon and Daniel Weinreb, and Sine (Sine Is Not Eine),[23] which was written by Owen Theodore Anderson. Weinreb's EINE was the first Emacs written in Lisp. In 1978, Bernard Greenberg wrote Multics Emacs almost entirely in Multics Lisp at Honeywell's Cambridge Information Systems Lab. Multics Emacs was later maintained by Richard Soley, who went on to develop the NILE Emacs-like editor for the NIL Project, and by Barry Margolin. Many versions of Emacs, including GNU Emacs, would later adopt Lisp as an extension language.
James Gosling, who would later invent NeWS and the Java programming language, wrote Gosling Emacs in 1981. The first Emacs-like editor to run on Unix, Gosling Emacs was written in C and used Mocklisp, a language with Lisp-like syntax, as an extension language.
Early Ads for Computer Corporation of America's CCA EMACS (Steve Zimmerman).[24] appeared in 1984.[25] 1985 comparisons to GNU Emacs, when it came out, mentioned free vs. $2,400.[26][irrelevant citation]
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 numbering skipped from 1 to 13.[27] In September 2014, it was announced on the GNU emacs-devel mailing list that GNU Emacs would adopt a rapid release strategy and version numbers would increment more quickly in the future.[28]
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.[29]
Most of GNU Emacs functionality is implemented through a scripting language called Emacs Lisp. Because about 70% of GNU Emacs is written in the Elisp extension language,[30] one only needs to port the C core which implements the Elisp interpreter. This makes porting Emacs to a new platform considerably less difficult than porting an equivalent project consisting of native code only.
GNU Emacs development was relatively closed 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 was then switched to the Bazaar DVCS. On November 11, 2014, development was moved to Git.[31]
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 were maintainers from 2008 to 2015.[32][33] John Wiegley was named maintainer in 2015 after a meeting with Stallman at MIT.[34] As of early 2014, GNU Emacs has had 579 individual committers throughout its history.[35]
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 early 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.[36] Lucid Emacs has since been renamed XEmacs. Its development is currently inactive, with the most recent stable version 21.4.22 released in January 2009 (while a beta was released in 2013), while GNU Emacs has implemented many formerly XEmacs-only features.[37][better source needed]
Other notable forks include:
In the past, projects aimed at producing small versions of Emacs proliferated. GNU Emacs was initially targeted at computers with a 32-bit flat address space and at least 1 MiB of RAM.[40] Such computers were high end workstations and minicomputers in the 1980s, and this left a need for smaller reimplementations that would run on common personal computer hardware. Today's computers have more than enough power and capacity to eliminate these restrictions, but small clones have more recently been designed to fit on software installation disks or for use on less capable hardware.[41]
Other projects aim to implement Emacs in a different dialect of Lisp or a different programming language altogether. Although not all are still actively maintained, these clones include:
Emacs is primarily a text editor and is designed for manipulating pieces of text, although it is capable of formatting and printing documents like a word processor by interfacing with external programs such as LaTeX, Ghostscript or a web browser. Emacs provides commands to manipulate and differentially display semantic units of text such as words, sentences, paragraphs and source code constructs such as functions. It also features keyboard macros for performing user-defined batches of editing commands.
GNU Emacs is a real-time display editor, as its edits are displayed onscreen as they occur. This is standard behavior for modern text editors but EMACS was among the earliest to implement this. The alternative is having to issue a distinct command to display text, (e.g. after modifying it). This is done in line editors, such as ed (unix), ED (CP/M), and Edlin (MS-DOS).
Almost all of the functionality in Emacs, including basic editing operations such as the insertion of characters into a document, is achieved through functions written in a dialect of the Lisp programming language. The dialect used in GNU Emacs is known as Emacs Lisp (ELisp). The ELisp layer sits atop a stable core of basic services and platform abstraction written in the C programming language. In this Lisp environment, variables and functions can be modified with no need to recompile or restart Emacs. Most configuration is stored in variables, and changed by simply changing variable values.
The main text editing data structure is called buffer containing text with additional attributes; the most important ones being: point (cursor location) and mark (another location, delimiting the selected region together with the point), the name of the file it is visiting (if applicable) and local values of ELisp variables specific to the buffer. Such local values specify in particular the set of active modes (exactly one major mode[clarification needed] typically adapting the editor to the content type of the buffer (like ELisp, C, HTML etc), and any number of minor modes[clarification needed] controlling other editor behaviors independent of content type). Any interaction with the editor (like key presses or clicking a mouse button) is realized by executing Elisp code, typically a command, which is a function explicitly designed for interactive use. Keys can be arbitrarily redefined and commands can also be accessed by name; some commands evaluate arbitrary Elisp code from buffers (e.g. eval-region
or eval-buffer
).
Buffers are displayed in windows, which are tiled portions of the terminal screen or the GUI window (called a frame in Emacs terms; multiple frames are possible). Depending on configuration, windows include scroll bars, line numbers, sometimes a 'header line' typically to ease navigation, and a mode line at the bottom (usually displaying buffer name, the active modes and point position of the buffer among others). The bottom of every frame is used for messages (then called 'echo area') and text input for commands (then called 'minibuffer').
Multiple windows can be opened onto the same buffer, for example to see different parts of a long text, and multiple buffers can share the same text, for example to take advantage of different major modes in a mixed-language file. The major mode can also be changed manually as needed with M-x <mode name>
.
(set-default-coding-systems 'utf-8)
(global-set-key (kbd "C-x C-b") 'ibuffer)
after-save-hook
)The first Emacs contained a help library that included documentation for every command, variable and internal function. Because of this, Emacs proponents described the software as self-documenting in that it presents the user with information on its normal features and its current state. Each function includes a documentation string that is displayed to the user on request, a practice that subsequently spread to programming languages including Lisp, Java, Perl, and Python. This help system can take users to the actual code for each function, whether from a built-in library or an added third-party library.
Emacs also has a built-in tutorial. Emacs displays instructions for performing simple editing commands and invoking the tutorial when it is launched with no file to edit. The tutorial is by Stuart Cracraft and Richard Stallman.
The Church of Emacs, formed by Richard Stallman, is a parody religion created for Emacs users.[50] While it refers to vi as the editor of the beast (vi-vi-vi being 6-6-6 in Roman numerals), it does not oppose the use of vi; rather, it calls it proprietary software anathema. ("Using a free version of vi is not a sin but a penance."[51]) The Church of Emacs has its own newsgroup, alt.religion.emacs,[52] that has posts purporting to support this parody religion. Supporters of vi have created an opposing Cult of vi.
Stallman has jokingly referred to himself as St I GNU cius, a saint in the Church of Emacs.[53]
There is folklore attributing a repetitive strain injury colloquially called Emacs pinky to Emacs' strong dependence on modifier keys,[54] although there have not been any studies done to show Emacs causes more such problems than other keyboard-heavy computer programs.
Users have addressed this through various approaches. Some users recommend simply using the two Control keys on typical PC keyboards like Shift keys while touch typing to avoid overly straining the left pinky, a proper use of the keyboard will reduce the RSI.[55] Software-side methods include:[56]
ergoemacs-mode
).[58]ace-jump-mode
[60] or elisp extensions that provide similar functionality of tiered navigation, first asking for a character then replacing occurrences of the character with access keys for cursor movement.evil-mode
, an advanced Vim emulation layer.god-mode
, which provides an approach similar to vim's with a mode for entering Emacs commands without modifier keys.evil-mode
and god-mode
.[61]viper-mode
that allows use of the vi key layout for basic text editing and the Emacs scheme for more advanced features.[63]M-x <command-name>
. M-x itself can also be rebound.Hardware solutions include special keyboards such as Kinesis's Contoured Keyboard, which places the modifier keys where they can easily be operated by the thumb, or the Microsoft Natural keyboard, whose large modifier keys are placed symmetrically on both sides of the keyboard and can be pressed with the palm of the hand.[54] Foot pedals can also be used.
The Emacs pinky is a relatively recent development. The Space-cadet keyboard on which Emacs was developed had oversized Control keys that were adjacent to the space bar and were easy to reach with the thumb.[65]
The word emacs is sometimes pluralized as emacsen, by phonetic analogy with boxen and VAXen, referring to different varieties of Emacs.[66]
For an editor to be called "emacs" the main requirement is that it be fully extensible with a real programming language, not just a macro language.
GNU Emacs is the most popular and widespread of the Emacs family of editors.
Finally, if you find yourself frustrated, try describing your problems to the famous psychotherapist Eliza. Just do M-x doctor.
"EMACS as such actually started out as a standards project," emails Guy Steele
A cocky novice once said to Stallman: 'I can guess why the editor is called Emacs, but why is the justifier called Bolio?'. Stallman replied forcefully, Names are but names, Emack & Bolio's is the name of a popular ice cream shop in Boston town. Neither of these men had anything to do with the software.' His question answered, yet unanswered, the novice turned to go, but Stallman called to him, 'Neither Emacs nor Bolio had anything to do with the ice cream shop, either.'[permanent dead link]
I wrote the second Emacs ever: the Lisp machine implementation, whose spec was "do what Stallman's PDP-10 (original) Emacs does", and then progressed from there. There's just a whole LOT of it. It took me and Mike McMahon endless hours to implement so many commands to make ZWEI/Zmacs.
Computer Corporation of America (CCA) EMACS, written by Steve Zimmerman
In retrospect 24.3 should have been named 25.1 and 24.4 should have been named 26.1. The .N thingy should really be kept only for bug-fix releases and neither of 24.3, 24.4, nor the previously planned 24.5 are bug-fix releases.
twenty-nine years of continuous development by no fewer than 579 people
There were people in those days, in 1985, who had one-megabyte machines without virtual memory. They wanted to be able to use GNU Emacs. This meant I had to keep the program as small as possible.
Modern computers have more than enough resources to start and run a full Emacs in a fraction of a second, and Emacs is probably what you want. Zile is a small, fast, and powerful Emacs clone. It is useful for small footprint installations (e.g. on floppy disk), machines with little memory, or quick editing sessions, especially on remote machines or as a different user, e.g. root.
In touch typing, modifiers comes in pairs, such as ⇧ Shift key. The accepted ergonomic way to press modifier combinations is using one hand to press the modifier key and the other to press the letter key. Using 2 hands avoids single-hand straining its muscle.
By: Wikipedia.org
Edited: 2021-06-18 15:17:48
Source: Wikipedia.org