How is this Emacs different from all other Emacses? -*-Outline-*-This file describes the differences between GNU Emacs 19, TwenexEmacs, Gosling Emacs (including the commercial versions by Unipress)and CCA Emacs.* Copyright (c) 1985 Richard M. Stallman Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and permission notice are preserved, and that the distributor grants the recipient permission for further redistribution as permitted by this notice. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them.Updated March 1993 for Emacs 19 by Eric S. Raymond* How is this Emacs different from Twenex Emacs?** Fundamental concepts.*** There is no concept of "typeout" in GNU Emacs.Any time that a command wants to display some output,it creates a buffer (usually with a name surrounded by asterisks)and displays it in a window.This provides some advantages: you can edit some more while looking at the output; you can copy parts of the output into other buffers.It also has a disadvantage that you must type a commandin order to make the output disappear.You can use C-x 1 to get rid of all windows except theselected one. To be more selective, you can switch tothe window you want to get rid of and then type C-x 0(delete-window).You also need to type a command to scroll the otherwindow if not all the output fits in it. Meta-Control-vwill usually do the job.*** There is no concept of a "subsystem" in GNU Emacs.Where Twenex Emacs would use a subsystem, GNU Emacsinstead creates a buffer and redefines commands in it.For example, when you send mail in GNU Emacs, you usea buffer named *mail* which is in Mail Mode. You canswitch away from this buffer to any other buffer andresume normal editing; then switch back and resumecomposing mail. You do not have to "exit" fromcomposing mail in order to do ordinary editing.This has many advantages, but it also has a disadvantage:Subsystems in Emacs tend to have "exit" commands that return youto whatever you were doing before entering the subsystem.In GNU Emacs the idea of what to return to is not well defined,so it is not clear what an "exit" command should do.The only way to "exit" in general is to type C-x b, C-x C-f, orsome other suitable command to switch buffers. Somesubsystem-like major modes, such as Info and Mail mode, providecommands to "exit" by switching to the previously selectedbuffer.*** Files are always visited in their own buffers.Beginning users of Twenex Emacs were told how to editusing a single buffer and reading one file after anotherinto that buffer. Use of a new buffer for each file wasregarded as a more advanced mode.In GNU Emacs, the idea of using a single buffer for variousfiles, one by one, has been dropped, given that the addressspace is expected to be large enough for many buffers. C-xC-f (find-file), which behaves nearly the same as in TwenexEmacs, is in GNU Emacs the canonical way for all users tovisit files.Various commands need to read files into Emacs in the courseof their execution. In Twenex Emacs the user must tell themwhether to reuse buffers or create new ones, using the variableTags Find File. In GNU Emacs, these commands always useC-x C-f.The command C-x C-v does still exist; it kills the currentbuffer and reads the specified file into a new buffer.It is equivalent to kill-buffer followed by find-file.Since there is no reusing of buffers, there is no point incalling the initial buffer "main". So the initial bufferin GNU Emacs is called "*scratch*" and is intended for typingLisp expressions to be evaluated.*** File name defaulting.GNU Emacs records a separate working directory for each buffer.Normally this is the directory on which the buffer's fileresides; for buffers not visiting any file, it is copied fromthe buffer that was current when it was created. The current buffer'sworking directory can be printed with M-x pwd and set with M-x cd.GNU Emacs shows you the default directory by inserting it inthe minibuffer when a file name is being read. You can typethe filename you want at the end of the default as if thedefault were not there, or you can edit and alter the default.If you want file /lose/big when the default /foo/defaultdir/has been inserted for you, you need not kill the default; simplytype at the end of it: /foo/defaultdir//lose/big. Such a filename is not ordinarily considered valid, but GNU Emacsconsiders it equivalent to /lose/big.Likewise, if you want file quux in your home directory, just add~/quux to the end of the supplied text, to get/foo/defaultdir/~/quux. GNU Emacs sees "/~" and throws awayeverything before the "~".You can refer to environment variables also within file names.$ followed by the environment variable name is replaced by thevariable's value. The variable name should either be followedby a nonalphanumeric character (which counts as part of thefile name) or be surrounded by braces {...} (which do not countas part of the file name). Thus, if variable USER has value "rms","x/$USER-foo" is expanded to "x/rms-foo", and "x${USER}foo"is expanded to "xrmsfoo". Note that this substitution is notperformed by the primitive file operation functions of GNU Emacs,but rather by the interactive file name reader. It is alsoavailable as a separate primitive, in the functionsubstitute-in-file-name.*** Exit commands C-z, C-x C-c and C-x C-z.There are two ways to exit GNU Emacs: killing and suspending.Killing is like what Control-c does to ordinary Unix programs.In GNU Emacs, you type C-x C-c to kill it. (This offers tosave any modified file buffers before really killing Emacs.)Suspending is like what Control-z does to ordinary Unix programs.To suspend GNU Emacs, type C-x C-z, or type just C-z.Note that C-z suspends ordinary programs instantly, butEmacs does not suspend until it reads the C-z.Usually it is better to suspend: once a system is smartenough to have job control, why ever kill an editor?You'll just have to make a new one in a minute.This is why the convenient command C-z is provided forsuspending.C-c is used as a prefix key for mode-specific commands and for users'own commands. We deliberately do not make C-c ever kill Emacs,because it should not be so easy to do something irreversible.*** Quitting with C-g.If you type C-g while GNU Emacs is waiting for input, itis an ordinary command (which is defined to beep). If youtype C-g while Lisp code is executing, it sets a flag whichcauses a special signal, nearly the same as an error, tohappen at the next safe place in Lisp execution. This usuallyhas the effect of aborting the current command in a safe way.Because at times there have been bugs causing GNU Emacs to loopwithout checking the quit flag, a special feature causesGNU Emacs to be suspended immediately if you type a second C-gwhile the flag is already set. So you can always get outof GNU Emacs. Normally GNU Emacs recognizes and clears the quit flagquickly enough to prevent this from happening.When you resume GNU Emacs after a suspension caused by multiple C-g, itasks two questions before resuming execution: Checkpoint? Dump core?Answer each one with `y' or `n' and a Return. `y' to Checkpoint? causes immediate auto-saving of all buffers in which auto-saving is enabled. `y' to Dump core? causes an illegal instruction to be executed. This is to enable a wizard to figure out why GNU Emacs was looping without checking for quits. Execution does not continue after a core dump. If you answer `n', execution continues.With luck, GNU Emacs will ultimately check the quit flag,and quit normally. If not, and you type another C-g, itis suspended again.If GNU Emacs is not really hung, just slow, you may invokethe double C-g feature without really meaning to. Then justresume and answer `n' to both questions, and you willarrive at your former state. Presumably the quit youwanted will finish happening soon.These questions are not asked if you suspend GNU Emacs with the C-zcommand. Continuing GNU Emacs after a C-z takes you straight backinto editing.*** Undoing with C-x u or C-_You can undo many commands--up to 10,000 characters worth.Each time you type C-x u or C-_, another command or batch of changeis undone. Undo information is stored per buffer, and the undocommand always applies to the current buffer. A numeric argumentserves as a repeat count.Consecutive self-inserting characters are undone in groups of twenty.*** Different character set.GNU Emacs does not expect anyone ever to have a keyboard in whichthe Control key sets an independent bit which may accompany anycharacter. The only control characters that can exist are theASCII control characters.There is, as a result, no "control prefix" character.*** Control-h is the Help character.I'm amazed it took me so long to get this idea. In Twenex Emacs, C-hand C-b are equivalent commands, making C-h redundant. C-h is notonly easy to type, it is mnemonic for "Help". So in GNU Emacs theHelp character is C-h.*** Completion is done by TAB, not ESC.ESC in the minibuffer is a Meta prefix, same as at top level.*** The string-argument reader is the minibuffer is an editor window.In GNU Emacs, the line at the bottom of the screen is the minibuffer.Commands that want string arguments always use this line to read them,and you can use the ordinary Emacs editing commands to edit theinput. You can terminate input with Return because Return is definedas the exit-minibuffer command when in the minibuffer. If youare using a command that needs several arguments, terminate eachone with Return. You cannot separate arguments with Escapethe way you would in Twenex Emacs.The minibuffer window does not overlay other editor windows;it is a nearly ordinary editor window which lacks a mode lineand is "turned off" when not in use. While it IS in use, youcan switch windows to and from the minibuffer, kill text in otherwindows and yank in the minibuffer, etc.You can even issue a command that uses the minibuffer while in theminibuffer. This gets you temporarily into a recursive minibuffer.However, this is allowed only if you enable it, since it could beconfusing for beginners.When you exit the minibuffer, the cursor immediately moves back tocolumn zero of the minibuffer line, to show you that the exitcommand has been obeyed. The minibuffer contents remain on the screenuntil the end of the command, unless some other text is displayed there.A single Control-g exits the minibuffer.*** There are no &'s or ^R's or spaces in function names.For example, the function which is called ^R Forward Wordin Twenex Emacs is called forward-word in GNU Emacs.*** The extension language is Lisp rather than TECO.Libraries must be written in Lisp. Meta-ESC reads a Lispexpression, evaluates it, and prints the result. Note thatMeta-ESC is "disabled" by default, so that beginning usersdo not get into the minibuffer by accident in a confusing way.Data types available include integers (which double as characters),strings, symbols, lists, vectors, buffers, buffer pointers,windows, and process channels.For now, to learn about writing Lisp code for GNU Emacs, read some ofthe source code, which is in directory ../lisp. Read the GNU Emacs LispReference Manual. Also, all Lisp primitives have self-documentation you canread with C-h f.*** Enabling the error handler.GNU Emacs has a Lisp debugger/stepper/trace package, but normallyerrors do not enter the debugger because that is slow, and unlikely tobe of interest to most users. Set the variable debug-on-error to t tocause errors to invoke the debugger. Set debug-on-quit to cause quitsignals (caused by C-g) to invoke the debugger.** Other changes.*** More than two windows are allowed.C-x 2 splits the current window into two windows, one above the other. Initially they both display the same buffer. C-x 2 now accepts a numeric argument to specify the number of lines to give to the uppermost of the two windows it makes.C-x 0 kills the current window, making all others larger.C-x 1 kills all windows except the current one.C-x O switches to the next window down. It rotates from the bottom one to the top one. An argument serves as a repeat count; negative arguments circulate in the reverse order.If the same buffer is displayed in several windows,changes made in it are redisplayed in all of them.*** Side by side windows are supported.The command C-x 3 splits the current window intotwo side-by-side windows.C-x } makes the selected window ARG columns wider at theexpense of the windows at its sides. C-x { makes the selectedwindow ARG columns narrower. An argument to C-x 5 specifieshow many columns to give to the leftmost of the two windows made.*** Horizontal scrolling of the lines in a window is implemented.C-x < (scroll-left) scrolls all displayed lines left,with the numeric argument (default 1) saying how far to scroll.When the window is scrolled left, some amount of the beginningof each nonempty line is replaced by an "$".C-x > scrolls right. If a window has no text hidden at the leftmargin, it cannot be scrolled any farther right than that.When nonzero leftwards scrolling is in effect in a window.lines are automatically truncated at the window's right marginregardless of the value of the variable truncate-lines in thebuffer being displayed.*** Return key does not use up empty lines.In Twenex Emacs, the Return command advances over an existingempty line in some cases. In GNU Emacs, the Return command alwaysmakes inserts a newline. Twenex Emacs was designed at a time whenmost display terminals did not have the ability to scroll partof the screen, and using existing empty lines made redisplay faster.Nowadays, terminals that cannot scroll part of the screen are rare,so there is no need to make Return behave in a more complicated manner.*** Help m.Typing C-h m displays documentation of the current major mode.,telling you what special commands and features are availableand how to use them or get more information on them.This is simply the documentation, as a function, of thesymbol which is the value of major-mode. Each major modefunction has been given documentation intended for C-h m.*** Display-hiding features.**** Hiding indented linesThe command C-x $ with numeric argument N causes lines indented by Nor more columns to become invisible. All you see is " ..." appendedto the previous line, in place of any number of consecutive invisiblelines.**** Outline Mode.Outline mode is designed for editing outline-structuredfiles, such as this one.Headings should be lines starting with one or more asterisks.Major headings have one asterisk, subheadings two, etc.Lines not starting with asterisks are body text.You can make the body under a heading, or the subheadingsunder a heading, temporarily invisible, or visible again.Invisible lines are attached to the end of the previous lineso they go with it if you kill it and yank it back.Commands:Meta-} next-visible-heading move by visible headingsMeta-{ previous-visible-heading move by visible headingsMeta-x hide-body make all body text invisible (not headings).Meta-x show-all make everything in buffer visible.The remaining commands are used when dot is on a heading line.They apply to some of the body or subheadings of that heading.C-c C-h hide-subtree make text and subheadings invisible.C-c C-s show-subtree make text and subheadings visible.C-c C-i show-children make direct subheadings visible. No effect on body, or subheadings 2 or more levels down. With arg N, affects subheadings N levels down.M-x hide-entry make immediately following body invisible.M-x show-entry make it visible.M-x hide-leaves make text under heading and under its subheadings invisible. The subheadings remain visible.M-x show-branches make all subheadings at all levels visible.*** C mode is fancy.C mode assumes that you put the initial open-brace ofa function definition at the beginning of a line.If you use the popular indenting style that puts thisopen-brace at the end of a line containing a type declaration,YOU WILL LOSE: C mode does not know a function starts there.Open-brace at the beginning of a line makes it possiblefor C mode to find function boundaries with total reliability;something I consider vital and which cannot be doneif the other style is used.The Tab command indents C code very cleverly.I know of only one cases in which Tab does not indent C code nicely: Expressions continued over several lines with few parentheses. Tab does not know the precedences of C operators, so it does not know which lines of the expression should go where. Using parentheses to indicate the nesting of operators except within a line makes this problem go away.The indenting algorithm is entirely written in Lisp.Tab with a numeric argument in Twenex Emacs indentsthat many lines. It is different in GNU Emacs: it meansto shift all the lines of a bracketed expression by thesame amount as the line being indented. For example, if you have if (foo) { hack (); /** Well? */ }and type C-u Tab on the line with the open brace, you get if (foo) { hack (); /* Well? */ }from indenting the brace line and then shifting thelines within the braces rigidly with the first one.Meta-Control-q works as in Lisp mode; it should beused with dot just before a bracketed grouping, andindents each line INSIDE that grouping using Tab.If used instead of C-u Tab in the previous example, it makes if (foo) { hack (); /* Well? */ }Meta-Control-h puts mark at the end of the current C functionand puts dot before it.Most other Meta-Control commands intended for Lisp expressionswork usefully in C mode as well.*** Meta-g (fill-region) is different.In Twenex Emacs, Meta-g fills the region with no paragraphboundaries except for blank and indented lines. In GNU Emacs,it divides the region into paragraphs in the same manner asMeta-], and fills each paragraph separately. There is alsothe function fill-region-as-paragraph which fills the regionregarding at as a single paragraph regardless even of blankor indented lines.*** Indented Text Mode instead of Edit Indented Text.Twenex Emacs has a command Edit Indented Text which temporarilyalters some commands for editing indented paragraphs.GNU Emacs has instead a separate major mode, Indented Text Mode,which is different from ordinary Text Mode in just the samealterations. Specifically, in Indented Text Mode,Tab runs the function indent-relative, and auto filling indentsthe newly created lines.*** But rectangle commands are implemented.C-x r r stores the rectangle described by dot and markinto a register; it reads the register name from the keyboard.C-x r g, the command to insert the contents of a register,can be used to reinsert the rectangle elsewhere.Other rectangle commands include open-rectangle: insert a blank rectangle in the position and size described by dot and mark, at its corners; the existing text is pushed to the right. clear-rectangle: replace the rectangle described by dot ane mark with blanks. The previous text is deleted. delete-rectangle: delete the text of the specified rectangle, moving the text beyond it on each line leftward. kill-rectangle like delete-rectangle but also stores the text of the rectangle in the "rectangle kill buffer". More precisely, it stores the text as a list of strings (one string for each line) in the variable killed-rectangle. yank-rectangle inserts the text of the last killed rectangle. extract-rectangle and delete-extract-rectangle these functions return the text of a rectangle as a list of strings. They are for use in writing other functions that operate on rectangles. *** Keyboard MacrosThe C-x ( command for defining a keyboard macro can in GNU Emacsbe given a numeric argument, which means that the new macrostarts out not empty but rather as the same as the lastkeyboard macro entered. In addition, that last keyboardmacro is replayed when the C-x ( is typed. C-x ( with anargument is thus equivalent to typing plain C-x ( and thenretyping the last keyboard macro entered.The command write-kbd-macro and append-kbd-macro can be used tosave a keyboard macro definition in a file. It is represented asa Lisp expression which, when evaluated, will define the keyboardmacro. write-kbd-macro writes the specified file from scratch,whereas append-kbd-macro adds to any existing text in the file.Both expect the keyboard macro to be saved to be specified byname; this means you must use the command name-last-kbd-macro togive the macro a name before you can save it.*** The command to resume a terminated tags-search or tags-query-replaceis Meta-comma in GNU Emacs.*** Auto Save is on by default.Auto Save mode is enabled by default in all buffersthat are visiting files.The file name used for auto saving is made by prepending"#" to the file name visited.*** Backup files.Since Unix stupidly fails to have file version numbers,GNU Emacs compensates slightly in the customary fashion:when a file is modified and saved for the first time ina particular GNU Emacs run, the original file is renamed,appending "~" to its name. Thus, foo.c becomes foo.c~.Emacs can also put a version number into the name of the backup file,as in foo.c.~69~ for version number 69. This is an optional featurethat the user has to enable.*** Mode Line differences.Each window in GNU Emacs has its own mode line, which alwaysdisplays the status of that window's buffer and nothing else.The mode line appears at the bottom of the window. It isfull of dashes, to emphasize the boundaries between windows,and is displayed in inverse video if the terminal supports it.The information usually available includes:*** Local Modes feature changed slightly.GNU Emacs supports local mode lists much like those in Twenex Emacs,but you can only set variables, not commands. You writeLocal variables:tab-width: 10end:in the last page of a file, if you want to make tab-width be ten in afile's buffer. The value you specify must be a Lisp object!It will be read, but not evaluated. So, to specify a string,you MUST use doublequotes. For "false", in variables whosemeanings are true or false, you MUST write nil .Two variable names are special: "mode" and "eval".Mode is used for specifying the major mode (as in Twenex Emacs).mode: textspecifies text mode. Eval is used for requesting the evaluationof a Lisp expression; its value is ignored. Thus,eval: (set-syntax-table lisp-mode-syntax-table)causes Lisp Mode syntax to be used.Note that GNU Emacs looks for the string "Local variables:"whereas Twenex Emacs looks for "Local modes:". This incompatibilityid deliberate, so that neither one will see local settingsintended for the other.*** Lisp code libraries.Libraries of commands, and init files, are written in Lisp.libraries conventionally have names ending in .el, while theinit file is named .emacs and is in your home directory.Use Meta-x load-library to load a library. Most standard librariesload automatically if you try to use the commands in them.Meta-x byte-compile-file filenamecompiles the file into byte code which loads and runs fasterthan Lisp source code. The file of byte code is given a namemade by appending "c" to the end of the input file name.Meta-x byte-recompile-directory directorynamecompiles all files in the specified directory (globbing not allowed)which have been compiled before but have been changed since then.Meta-x load-library automatically checks for a compiled filebefore loading the source file.Libraries once loaded do not retain their identity within GNUEmacs. Therefore, you cannot tell just what was loaded from alibrary, and you cannot un-load a library. Normally, librariesare written so that loading one has no effect on the editingoperations that you would have used if you had not loaded thelibrary.*** Dired features.You can do dired on partial directories --- any patternthe shell can glob. Dired creates a buffer named afterthe directory or pattern, so you can dired several differentdirectories. If you repeat dired on the same directory orpattern, it just reselects the same buffer. Use Meta-x Reverton that buffer to read in the current contents of the directory.*** Directory listing features.C-x C-d now uses the default output format of `ls',which gives just file names in multiple columns.C-u C-x C-d passes the -l switch to `ls'.Both read a directory spec from the minibuffer. It canbe any pattern that the shell can glob.*** Compiling other programs.Meta-x compile allows you to run make, or any other compilationcommand, underneath GNU Emacs. Error messages go into a buffer whosename is *compilation*. If you get error messages, you can use thecommand C-x ` (that is a backquote) to find the text of the nexterror message.You must specify the command to be run as an argument to M-x compile.A default is placed in the minibuffer; you can kill it and startfresh, edit it, or just type Return if it is what you want.The default is the last compilation command you used; initially,it is "make -k".*** Searching multiple files.Meta-x grep searches many files for a regexp by invoking grepand reading the output of grep into a buffer. You can thenmove to the text lines that grep found, using the C-x ` commandjust as after M-x compile.*** Running inferior shells.Do Meta-x shell to make an inferior shell together with a bufferwhich serves to hold "terminal" input and output of the shell.The shell used is specified by the environment variable ESHELL,or by SHELL if ESHELL is not set.Use C-h m whilst in the *shell* buffer to get more detailed info.The inferior shell loads the file .emacs_csh or.emacs_sh(or similar using whatever name the shell has) when it starts up.M-! executes a shell command in an inferior shelland displays the output from it. With a prefix argument,it inserts the output in the current buffer after dotand sets the mark after the output. The shell commandgets /dev/null as its standard input.M-| is like M-! but passes the contents of the regionas input to the shell command. A prefix argument makesthe output from the command replace the contents of the region.*** Sending mail.Once you enter Mail Mode using C-x m or C-x 4 m or M-x mail,C-c becomes a prefix character for mail-related editing commands.C-c C-s is vital; that's how you send the message. C-c C-c sendsand then switches buffers or kills the current window.Use C-h m to get a list of the others.*** Regular expressions.GNU Emacs has regular expression facilities like those of mostUnix editors, but more powerful:**** -- + --+ specifies repetition of the preceding expression 1 or moretimes. It is in other respect like *, which specifies repetition0 or more times.**** -- ? --? is like * but matches at most one repetition of the precedingexpression.**** -- \| --\| specifies an alternative. Two regular expressions A and B with \| inbetween form an expression that matches anything that either A or B willmatch. Thus, "foo\|bar" matches either "foo" or "bar" but no otherstring.\| applies to the larges possible surrounding expressions. Only asurrounding \( ... \) grouping can limit the grouping power of \|.Full backtracking capability exists when multiple \|'s are used.**** -- \( ... \) --\( ... \) are a grouping construct that serves three purposes:1. To enclose a set of \| alternatives for other operations. Thus, "\(foo\|bar\)x" matches either "foox" or "barx".2. To enclose a complicated expression for * to operate on. Thus, "ba\(na\)*" matches "bananana", etc., with any number of na's (zero or more).3. To mark a matched substring for future reference.Application 3 is not a consequence of the idea of a parentheticalgrouping; it is a separate feature which happens to be assigned as asecond meaning to the same \( ... \) construct because there is noconflict in practice between the two meanings. Here is an explanationof this feature. -- \digit --After the end of a \( ... \) construct, the matcher remembers thebeginning and end of the text matched by that construct. Then, later onin the regular expression, you can use \ followed by a digit to mean,``match the same text matched this time by the \( ... \) construct.''The first nine \( ... \) constructs that appear in a regular expressionare assigned numbers 1 through 9 in order of their beginnings. \1through \9 can be used to refer to the text matched by the corresponding\( ... \) construct.For example, "\(.*\)\1" matches any string that is composed of twoidentical halves. The "\(.*\)" matches the first half, which can beanything, but the \1 that follows must match the same exact text.**** -- \` --Matches the empty string, but only if it is at the beginning of the buffer.**** -- \' --Matches the empty string, but only if it is at the end of the buffer.**** -- \b --Matches the empty string, but only if it is at the beginning or end ofa word. Thus, "\bfoo\b" matches any occurrence of "foo" as a separate word."\bball\(s\|\)\b" matches "ball" or "balls" as a separate word.**** -- \B --Matches the empty string, provided it is NOT at the beginning or end ofa word.**** -- \< --Matches the empty string, provided it is at the beginning of a word.**** -- \> --Matches the empty string, provided it is at the end of a word.**** -- \w --Matches any word-constituent character. The editor syntax table determineswhich characters these are.**** -- \W --Matches any character that is not a word-constituent.**** -- \s<code> --Matches any character whose syntax is <code>. <code> is a letter thatrepresents a syntax code: thus, "w" for word constituent, "-" forwhitespace, "(" for open-parenthesis, etc. Thus, "\s(" matches anycharacter with open-parenthesis syntax.**** -- \S<code> --Matches any character whose syntax is not <code>.* How is this Emacs different from Gosling Emacs?** Advantages of Gosling Emacs:1. The program itself is much smaller.GNU Emacs uses about 250k more pure storage.As a result, Gosling Emacs can run on machinesthat cannot run GNU Emacs. There is not much differencein the amount of impure storage in the two programs.2. In some versions there is support for other forks toestablish communications channels to Emacs (using sockets?).3. There is a direct interface to dbm (data bases).** Advantages of GNU Emacs:*** True Lisp, not Mocklisp.GNU Emacs's extension language has real symbols, listsand vectors. Many extensions are much simpler, and somebecome possible that were nearly impossible in Gosling Emacs.Many primitives can have cleaner interfaces, and some featuresneed not be put in as special primitives because you can dothem easily yourself.*** But Mocklisp still works.An automatic conversion package plus a run-time libraryallows you to convert a Mocklisp library into a Lisp library.*** Commands are better crafted.For example, nearly every editing function for which anumeric argument would make sense as a repeat count doesaccept a repeat count, and does handle a negative argumentin the way you would expect.*** The manual is clearer.Everyone tells me it is a very good manual.*** Better on-line documentation.Both functions and variables have documentation strings thatdescribe exactly how to use them.*** C mode is smart.It really knows how to indent each line correctly,for most popular indentation styles. (Some variablescontrol which style is used; popular named styles are also supported.)*** Compatible with PDP-10 Emacs, Multics Emacs and Zmacs.The commands in GNU Emacs are nearly the same as in theoriginal Emacs and the other Emacses which imitated it.(A few have been changed to fit the Unix environment better.)*** Support for Gosling's Emacs commands.M-x set-gosmacs-bindings rebinds many editing commands forcompatibility with Gosling's Emacs.M-x set-gnu-bindings reverses the change.*** Side-by-side windows.You can split a GNU Emacs window either horizontally orvertically.*** Redisplay is faster.GNU Emacs sends about the same stuff to the terminal thatGosling's does, but GNU Emacs uses much less CPU time todecide what to do.*** Entirely termcap-driven.GNU Emacs has nearly no special code for any terminal type. Variousnew termcap strings make it possible to handle all terminals nearly asfast as they could be handled by special-case code.*** Display-hiding features.For example, Outline Mode makes it possible for you to editan outline, making entire sub-branches of the outline visibleor invisible when you wish.*** You can interrupt with Control-G.Even a looping Lisp program can be stopped this way.And even a loop in C code does not stop you from killingEmacs and getting back to your shell.*** Per-buffer Undo.You can undo the last several changes, in each bufferindependently.*** The editor code itself is clean.Many people have remarked on how much they enjoy readingthe code for GNU Emacs.One other note: The program etc/cvtmail that comes with GNU Emacs canbe used to convert a mail directory for Gosling Emacs's Rmail into aUnix mail file that you could read into GNU Emacs's Rmail.* How is this Emacs different from CCA Emacs?** GNU Emacs Lisp vs CCA Elisp.GNU Emacs Lisp does not have a distinction between Lisp functionsand Emacs functions, or between Lisp variables and Emacs variables.The Lisp and the editor are integrated. A Lisp function definedwith defun is callable as an editor command if you put aninteractive calling spec in it; for example, (defun forward-character (n) (interactive "p") (goto-char (+ (point) n)))defines a function of one argument that moves point forward bya specified number of characters. Programs could call this function,as in (forward-character 6), or it could be assigned to a key,in which case the "p" says to pass the prefix numeric arg asthe function's argument. As a result of this feature, you oftenneed not have two different functions, one to be called by programsand another to read arguments from the user conveniently; the samefunction can do both.CCA Elisp tries to be a subset of Common Lisp and tries tohave as many Common Lisp functions as possible (though it is stillonly a small fraction of full Common Lisp). GNU Emacs Lispis somewhat similar to Common Lisp just because of my Maclispand Lisp Machine background, but it has several distinct incompatibilitiesin both syntax and semantics. Also, I have not attempted toprovide many Common Lisp functions that you could write in Lisp,or others that provide no new capability in the circumstances.GNU Emacs Lisp does not have packages, readtables, or character objects(it uses integers to represent characters).On the other hand, windows, buffers, relocatable markers and processesare first class objects in GNU Emacs Lisp. You can get information about themand do things to them in a Lispy fashion. Not so in CCA Emacs.In GNU Emacs Lisp, you cannot open a file and read or write charactersor Lisp objects from it. This feature is painful to support, andis not fundamentally necessary in an Emacs, because instead youcan read the file into a buffer, read or write characters orLisp objects in the buffer, and then write the buffer into the file.On the other hand, GNU Emacs Lisp does allow you to rename, delete, addnames to, and copy files; also to find out whether a file is adirectory, whether it is a symbolic link and to what name, whetheryou can read it or write it, find out its directory component,expand a relative pathname, find completions of a file name, etc.,which you cannot do in CCA Elisp.GNU Emacs Lisp uses dynamic scope exclusively. This enables you tobind variables which affect the execution of the editor, such asindent-tabs-mode.GNU Emacs Lisp code is normally compiled into byte code. Most of thestandard editing commands are written in Lisp, and many aredumped, pure, in the Emacs that users normally run.GNU Emacs allows you to interrupt a runaway Lisp program withControl-g.** GNU Emacs Editing AdvantagesGNU Emacs is faster for many things, especially insertion of textand file I/O.GNU Emacs allows you to undo more than just the last commandwith the undo command (C-x u, or C-_). You can undo quite a ways back.Undo information is separate for each buffer; changes in one bufferdo not affect your ability to undo in another buffer.GNU Emacs commands that want to display some output do so by puttingit in a buffer and displaying that buffer in a window. Thistechnique comes from Gosling Emacs. It has both advantages anddisadvantages when compared with the technique, copied by CCA Emacsfrom my original Emacs which inherited it from TECO, of having "typeout" which appears on top of the text in the current window butdisappears automatically at the next input character.GNU Emacs does not use the concept of "subsystems". Instead, it useshighly specialized major modes. For example, dired in GNU Emacs hasthe same commands as dired does in other versions of Emacs, give ortake a few, but it is a major mode, not a subsystem. The advantageof this is that you do not have to "exit" from dired and lose thestate of dired in order to edit files again. You can simply switchto another buffer, and switch back to the dired buffer later. Youcan also have several dired buffers, looking at different directories.It is still possible to write a subsystem--your own command loop--in GNU Emacs, but it is not recommended, since writing a major modefor a special buffer is better.Recursive edits are also rarely used, for the same reason: it is betterto make a new buffer and put it in a special major mode. Sendingmail is done this way.GNU Emacs expects everyone to use find-file (C-x C-f) for readingin files; its C-x C-v command kills the current buffer and then findsthe specified file.As a result, users do not need to think about the complexitiesof subsystems, recursive edits, and various ways to read in filesor what to do if a buffer contains changes to some other file.GNU Emacs uses its own format of tag table, made by the "etags"program. This format makes finding a tag much faster.Dissociated Press is supported.** GNU Emacs Editing Disadvantages.GNU Emacs does not display the location of the mark.GNU Emacs does not have a concept of numbers of buffers,or a permanent ordering of buffers, or searching through multiplebuffers. The tags-search command provides a way to searchthrough several buffers automatically.GNU Emacs does not provide commands to visit files withoutsetting the buffer's default directory. Users can write suchcommands in Lisp by copying the code of the standard filevisiting commands and modifying them.GNU Emacs does not support "plus options" in the commandarguments or in buffer-selection commands, except for line numbers.GNU Emacs does not support encryption. Down with security!GNU Emacs does not support replaying keystroke files,and does not normally write keystroke files.** Neutral DifferencesGNU Emacs uses TAB, not ESC, to complete file names, buffer names,command names, etc.GNU Emacs uses LFD to terminate searches, instead ofthe C-d uses by CCA Emacs. (Actually, this character is controlledby a parameter in GNU Emacs.) C-M-s in GNU Emacs is an interactiveregular expression search, but you can get to a noninteractiveone by typing ESC right after the C-M-s.In GNU Emacs, C-x s asks, for each modified file buffer, whetherto save it.GNU Emacs indicates line continuation with "\" and linetruncation (at either margin) with "$".The command to resume a tags-search or tags-query-replace inGNU Emacs is Meta-Comma.