next up previous contents
Next: Navigating Up: The Basics Previous: Emacs Commands   Contents

Files (Opening, Saving, Printing, etc.)

Remember, a file is what's stored on disk. Once you read it into emacs to begin editing, we refer to it as a buffer, because it's been stored in memory. In general, opening, saving, and printing files is straightforward. A couple of notes: To ``open'' a file and to create a new file are the same thing: emacs will try to find the file you request and if it doesn't exist it will simply create a new, empty file for you. When you ``save as'' by typing C-x C-w, emacs will save the file under a new name and then continue to edit the newly-renamed file. This is what most programs do, but it's worth mentioning because there are some programs that simply save your current work to disk under a new name but continue to edit the original file (called ``save a copy as'').

Inserting a file at the present cursor position is extremely useful. I use it to send templated emails. I start off with a personalized introduction, then insert a file which contains one of several templates, edit as necessary, and send. You'll find other uses for this feature as you go.

The basic commands are shown in Figure 3.

Figure 3: File Commands
\begin{figure}\begin{tabular}{ll} Keystroke & Command/Function  \hline
C-x C-...
... C-x C-v & Replace this buffer with another
file \\
\end{tabular}
\end{figure}

Finally, there are several ways to print, but one of the nicest is M-x ps-print-buffer-with-faces, which will print your text buffer to the printer with fonts, syntax highlighting, and all. It generates very attractive print-outs of your work.


next up previous contents
Next: Navigating Up: The Basics Previous: Emacs Commands   Contents
Randall Wood 2011-03-31