Editing Text with Emacs

Emacs is the Unix text editor of choice because it has extensions to handle programming and text editing. Start emacs from an xterm window by typing:
 emacs filename &
Control keys are not essential in Emacs since all this can be done from the menus, but if you log in remotely and run regular emacs, you will need these handy control keys. M-x means push the Meta key once, then the x key. Meta is the diamond on the workstations, hold it down while pressing other keys.


To download a windows version, click here, the Gnu Emacs site, and choose the highest numbered version.

To run stat packages from within emacs, see ESS: Emacs Speaks Statistics

Commands

For more help with Emacs, use the help button in the top right corner, run the demo or look at www pages on the Xemacs homepage.

Modes

Emacs tries to figure out what kind of file you are editing and tries to choose a mode which will make editing fit the file. Modes we use a lot are HTML, TeX (or LateX) and [for running R or Splus] ESS = Emacs Speaks Statistics, see ESS description.

Data Entry

This page started as an intro to several stat packages. To run the demos on those packages, you will need to type the following data into a file and store it as 'tires.data'. (You may be able to copy it from this window using the mouse, thus avoiding all typing.)

45   162   372  |  83    161    97   |   55    233    206  |   88    119    64 
61   232   175  |  59    161    249  |   66    231    154  |   71    151    219
71   231   136  |  80    165    186  |   71    237    112  |   82    151    155
81   224    55  |  89    128    114  |   86    219     45  |   51    161    341
53   203   221  |  59    146    340  |   60    189    166  |   65    148    283
64   210   164  |  74    144    267  |   68    210    113  |   81    134    215
79   196    82  |  86    127    148  |   81    180     32  |   56    200    228
68   173   196  |  75    188    128  | 
Hold down the left mouse button and drag across the text, then move to your emacs window, click middle mouse button, and it should pop into the emacs window. To use the data, you need to make it into 3 columns, removing the vertical separators. Good practice for the keystrokes listed above. Go to the right of the 372 in line 1, use C-k to kill to end of line, press return, then C-y for yank. Just leave the separators for now, move over 3 columns and repeat until line 1 becomes:
45   162   372  
|  83    161    97   
|  55    233    206  
|  88    119    64 
Do the same for the other lines, then go back to the top of the file and use M-% to replace all | characters with nothing, or space. Save with C-x C-w (give it a name) or C-x C-s if it's already named, and you are done.
Information about Unix.
More info about emacs.
Stat package demos:

Author: Jim Robison-Cox
Last Updated: Wednesday, 09-Jan-2008 14:40:36 MST