emacs not to be confused with emac this article is about the class of text editors for the most popular current example see gnu emacs emacs imks is a family of text editors that are characterized by their extensibility emacs has over 10000 builtin commands many of which are macros themselves 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 the original emacs was written in 1976 by carl mikkelsen david a moon and guy l steele jr as a set of editor macros for the teco editor the most popular and most ported version of emacs is gnu emacs which was created by richard stallman for the gnu project 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 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 open source projects still under development history editing c source code in gnu emacs editing compiling and executing c code from gnu emacs the interface of emacs was influenced by the design of the symbolics spacecadet keyboard emacs development began during the 1970s at the mit ai lab whose pdp6 and pdp10 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 labs e editor written by fred wright e had another feature that teco lacked randomaccess editing teco was a pagesequential editor that was designed for editing paper tape on the pdp1 and typically allowed editing on only one page at a time in the order of the pages in the file instead of adopting es approach of structuring the file for pagerandom access on disk stallman modified teco to handle large buffers more efficiently and changed its filemanagement 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 stallman saw a problem in too much customization and de facto forking and set certain conditions for usage 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 pdp10 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 tops20 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 mits ai lab and its laboratory for computer science other early implementations in the following years programmers wrote a variety of emacslike editors for other computer systems these included eine eine is not emacs and zwei which was written by owen theodore anderson weinrebs eine was the first emacs written in lisp in 1978 bernard greenberg wrote multics emacs almost entirely in multics lisp at honeywells cambridge information systems lab multics emacs was later maintained by richard soley who went on to develop the nile emacslike 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 emacslike editor to run on unix gosling emacs was written in c and used mocklisp a language with lisplike syntax as an extension language gnu emacs gnu emacs gnu emacs running in a text console gnu emacs running on microsoft windows 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 stallmans 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 1534 released later in 1985 early versions of gnu emacs were numbered as 1xx with the initial digit denoting the version of the c core the 1 was dropped after version 112 as it was thought that the major number would never change and thus the numbering skipped from 1 to 13 gnu emacs was later ported to unix it offered more features than gosling emacs in particular a fullfeatured 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 gnu emacs uses a layered architecture with a turing complete language running on top of a smaller central core because about 70 of gnu emacs is written in the elisp extension language and the set of features implemented in elisp code are automatically present once the c core which implements the elisp interpreter weighing 247kloc as of version 244 has been ported porting emacs to a new platform is considerably less difficult than porting an equivalent project consisting of native code only theoretically only the core must be ported to the new platform once the core is ported the portions implemented in the language above take minimal work to bring over 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 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 20082015 xemacs xemacs xemacs 215 on gnulinux 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 bestknown 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 other forks of gnu emacs other forks less known than xemacs include remacs a port of gnu emacs to the rust programming language meadow a japanese version for microsoft windows sxemacs steve youngs fork of xemacs aquamacs based on gnu emacs aquamacs 32 is based on gnu emacs version 24 and aquamacs 33 is based on gnu emacs version 25 which focuses on integrating with the apple macintosh user interface various emacs editors the mg tiny emacslike editor in openbsd 53 editing ruby source code zmacs an emacs for lisp machines in the past projects aimed at producing small versions of emacs proliferated gnu emacs was initially targeted at computers with a 32bit flat address space and at least 1mib of ram 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 in more recent times small clones have been designed to fit on software installation disks 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 microemacs which was originally written by dave conroy and further developed by daniel lawrence and which exists in many variations mg originally called micrognuemacs and later mg2a a publicdomain offshoot of microemacs intended to more closely resemble gnu emacs now installed by default on openbsd notgnu a small fast proprietary freeware implementation for dos win16 win32 and linux by julie melbin jove jonathans own version of emacs jonathan paynes nonprogrammable emacs implementation for unixlike systems mince mince is not complete emacs a version for cpm and later dos from mark of the unicorn mince evolved into final word which eventually became the borland sprint word processor perfect writer a cpm implementation derived from mince that was included circa 1982 as the default word processor with the very earliest releases of the kaypro ii and kaypro iv it was later provided with the kaypro 10 as an alternative to wordstar freemacs a dos version that uses an extension language based on text macro expansion and fits within the original 64 kib flat memory limit zile zile was a recursive acronym for zile is lossy emacs but the project was rewritten in lua and now gives the expansion as zile implements lua editors the new zile still includes an implementation of emacs in lua called zemacs there is also an implementation of vi called zi zmacs for the mit lisp machine and its descendants implemented in zetalisp climacs a zmacsinfluenced variant implemented in common lisp qemacs a small editor by fabrice bellard with utf8 capability that can quickly edit files as large as hundreds of mib in size epsilon an emacs clone by lugaru software versions for dos windows linux freebsd mac os x and os 2 are bundled in the release it uses a nonlisp extension language with c syntax and used a very early concurrent command shell buffer implementation under the singletasking msdos pceemacs is the emacsbased editor for swiprolog emact a 1986 fork of microemacs by christian jullien emact source code is available at sourceforge amacs an apple ii prodos version of emacs implemented in 6502 assembly by brian fox hemlock originally written in spice lisp then common lisp a part of cmu common lisp influenced by zmacs later forked by lucid common lisp as helix lispworks and clozure cl projects there is also a portable hemlock project which aims to provide a hemlock which runs on several common lisp implementations umacs an implementation under os9 editors with emacs emulation yi an editor that is written and extensible in haskell and has an emulation mode for emacs joes own editor emulates emacs keybindings when invoked as jmacs jed has an emulation mode for emacs eclipse ide provides a set of emacs keybindings intellij idea provides a set of emacs keybindings epsilon text editor defaults to emacs emulation and supports a vi mode the cocoa text system uses some of the same terminology and understands many emacs navigation bindings this is possible because the native ui uses the command key equivalent to super instead of the control key sublime text can emulate some of emacs behavior with the sublemacspro plugin visual studio emacs keys provides a set of emacs keybindings for visual studio users gnu readline is a line editor that understands the standard emacs navigation keybindings it also has a vi emulation mode gnome builder has an emulation mode for emacs features 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 userdefined batches of editing commands gnu emacs is a realtime 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 functionality instead of having to issue a separate command to insert new edits into the existing text as in vi general architecture 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 emacs lisp elisp a dialect of the lisp programming language 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 emacs operates on data structures called buffers containing text with additional attributes every buffer maintains its own 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 the set of active modes exactly one major mode which control editor behaviour through variables elisp code can be executed interactively through named commands which can be bound to key presses or accessed by name some commands evaluate arbitrary elisp code from buffers eg evalregion or evalbuffer 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 unless configured otherwise windows include scroll bars line numbers a header line at the top usually displaying the buffer title or filename and a mode line at the bottom usually listing the active modes and point position of the buffer 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 mixedlanguage file the mode can also be changed manually as needed with mx mode name customizability keystrokes can be recorded into macros and replayed to automate complex repetitive tasks this is often done on an adhoc basis with each macro discarded after use although macros can be saved and invoked later at startup emacs executes an emacs lisp script named emacs recent versions also look for emacsel and emacsdinitel emacs will execute the first one it finds ignoring the rest this personal customization file can be arbitrarily long and complex but typical content includes setting global variables or invoking functions to customize emacs behaviour for example setdefaultcodingsystems utf8 key bindings to override standard ones and to add shortcuts for commands that the user finds convenient but dont have a key binding by default example globalsetkey kbd cx cb ibuffer loading enabling and initializing extensions emacs comes with many extensions but only a few are loaded by default configuring event hooks to run arbitrary code at specific times for example to automatically recompile source code after saving a buffer aftersavehook executing arbitrary files usually to split an overly long configuration file into manageable and homogeneous parts emacsd and elisp are traditional locations for these personal scripts the customize extension allows the user to set configuration properties such as the color scheme interactively from within emacs in a more userfriendly way than by setting variables in emacs it offers search descriptions and help text multiple choice inputs reverting to defaults modification of the running emacs instance without reloading and other conveniences similar to the preferences functionality of other programs the customized values are saved in emacs or another designated file automatically themes affecting the choice of fonts and colours are defined as elisp files and chosen through the customize extension selfdocumenting 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 selfdocumenting 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 builtin library or an added thirdparty library emacs also has a builtin 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 culture church of emacs editor war richard stallman as st ignucius a saint in the church of emacs the church of emacs formed by richard stallman is a parody religion created for emacs users 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 ignucius a saint in the church of emacs emacs pinky there is folklore attributing a repetitive strain injury colloquially called emacs pinky to emacs strong dependence on modifier keys although there have not been any studies done to show emacs causes more such problems than other keyboardheavy 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 customizing the key layout so that the control key is transposed with the caps lock key software such as xwrits or the builtin typebreakmode in emacs that reminds the user to take regularly scheduled breaks using the ergoemacs keybindings with minor mode ergoemacsmode customizing the whole keyboard layout to move statistically frequent emacs keys to more appropriate places packages such as acejumpmode 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 evilmode an advanced vim emulation layer godmode which provides an approach similar to vims with a mode for entering emacs commands without modifier keys using customized key layout offered by spacemacs a project where space key is used as the main key for initiating control sequences the project also heavily incorporates both evilmode and godmode stickykeys which turns key sequences into key combinations emacs builtin vipermode that allows use of the vi key layout for basic text editing and the emacs scheme for more advanced features giving a dual role to a morecomfortably accessed key such as the space bar so that it functions as a control key when pressed in combination with other keys ergonomic keyboards or keyboards with a greater number of keys adjacent to the space bar such as japanese keyboards allow thumb control of other modifier keys too like meta or shift using a limited ergonomic subset of keybindings and accessing other functionality by typing mx commandname mx itself can also be rebound driving emacs through voice input hardware solutions include special keyboards such as kinesiss 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 foot pedals can also be used the emacs pinky is a relatively recent development the spacecadet 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 terminology the word emacs is sometimes pluralized as emacsen by phonetic analogy with boxen and vaxen referring to different varieties of emacs emacs in popular culture in the movie the internship 2013 at 012101 nick campbell asks it occurred to me why not use emacs rather than vi as the default editor for ubuntu to which dana replies thats actually a very good thought nick on the television series silicon valley season 3 episode 6 richard asks i mean why not just use vim over emacs to which winnie replies i do use vim over emacs to which richard responds oh god help us free software portal comparison of text editors conkeror gnu texmacs list of text editors list of unix programs integrated development environment notes pdf stallman richard m 1981 html stallman richard m 2002 gnu emacs manual 15th ed gnu press isbn188211485x stallman richard m 2002 my lisp experiences and the development of gnu emacs retrieved 20070201 chassel robert j 2004 an introduction to programming in emacs lisp gnu press isbn1882114566 glickstein bob april 1997 writing gnu emacs extensions oreilly associates isbn1565922611 cameron debra elliott james loy marc raymond eric rosenblatt bill december 2004 learning gnu emacs 3rd edition oreilly associates isbn0596006489 finseth craig a 1991 the craft of text editing or emacs for the modern world springerverlag co isbn9781411682979 thompson adrienne g 2009 macsimizing teco retrieved 20120226 wikiquote has quotations related to emacs wikimedia commons has media related to emacs wikibooks has more on the topic of emacs official website reviewed entry in the free software directory wikemacs emacswiki emacsfamily list of emacs implementations architectural overview famous emacs users one of the oldest rivalries in computing emacs vs vi vte emacsimplementationsgnu andderivative gnu emacs xemacs sxemacs aquamacs other climacs epsilon freemacs eine gosling emacs mocklisp hemlock jove mg microemacs mince multics emacs perfect writer spacemacs gnu texmacs vile zile zmacs zwei modes auctex dired dunnet emacs speaks statistics emacspeak emms erc eww gnus orgmode planner rcirc reftex slime w3m internals emacs lisp apel mule other conkeror dissociated press editor war emacs on wikimedia commons emacs on wikiquotes vtegnu projecthistory gnu manifesto free software foundation europe india latin america history of free software licenses gnu general public license gnu lesser general public license gnu affero general public license gnu free documentation license gpl linking exception software gnu variants hurd linuxlibre glibc bash coreutils findutils build system gcc binutils gdb grub gnome gnustep gimp gnu ring gnu emacs gnu texmacs gnu octave gnu r gsl gmp gnu electric gnu archimedes gnunet gnu privacy guard gnuzilla icecat gnu health gnumed gnu lilypond gnu go gnu chess gnash guix guix system distribution more publicspeakers alexandre oliva benjamin mako hill bradley m kuhn eben moglen federico heinz georg c f greve john sullivan loc dachary matt lee nagarjuna g ricardo galli richard stallman robert j chassell other topics gnulinux naming controversy revolution os free software foundation antiwindows campaigns defective by design 