% -----------------------------------------------------------------------------
%              Reference Sheet for Emacs 19 @ Oberlin CS (1996)
%  (derived from Kennis Koldewyn's <kkoldewyn@kpmg.com> Unix/Emacs reference)
% -----------------------------------------------------------------------------
% Karl Fogel, <kfogel@cs.oberlin.edu> <kfogel@red-bean.com>


\documentstyle[11pt]{article}
%\pagestyle{empty}

\oddsidemargin=-0.25in
\evensidemargin=-0.25in
\topmargin=-1in
\textheight=9.5in
\textwidth=7.5in

% Get our teletype font:
\font\eighttt=cmtt8
\font\tentt=cmtt10
%\def\tt{\eighttt}
\def\tt{\tentt}


% Use \tt for keys
\def\key{\tt}

% See above new def of \key
% \newcommand{\key}[1]{\tt#1}

\newcommand{\z}[1]{{\em #1\/}}
\newcommand{\s}[1]{\verb!/!}
\newcommand{\sect}[1]{{\Large\bf #1} \par \vspace{4pt}}
\newenvironment{tabled}
  {\begin{tabular}{@{}p{1.1in}p{3.6in}@{}}}
  {\end{tabular}}

\begin{document}

\begin{center}
\huge{\bf Emacs Reference (Oberlin Computer Science)}
\end{center}

\vspace{12pt}

\parindent=0in

\parindent=4.6742in
\begin{tabular}{@{}p{0.75in}cp{0.75in}@{}}
  & \Large\bf Notes & \\ \hline
\end{tabular}

\parindent=0in

\sect{Notation Conventions for this Reference}

\begin{tabled}
  {\key C-}    & Hold down the {\tt Control} key \\
  {\key M-}    & Hold down the {\tt Meta} key \\
               & (If no {\tt Meta} key, try {\tt Alt} or {\tt
                 Compose~Character}; \\
               & Else tap and release {\tt ESC}.)
\end{tabled}

\vspace{12pt}

\sect{Moving Around}
\begin{tabled}
  {\key C-b}/{\key C-f}       & Move back/forward one character \\
  {\key M-b}/{\key M-f}       & Move back/forward one word \\
  {\key C-a}/{\key C-e}       & Move to the beginning/end of the line \\
  {\key C-p}/{\key C-n}       & Move up/down to the previous/next line \\
  {\key C-v}/{\key M-v}       & Move down/up a screen \\
  {\key M-<}/{\key M->}       & Move to the beginning/end of the buffer \\
  {\key C-s}/{\key C-r}       & ``Incremental'' search forward/backward \\
                              & ({\key RET} ends search where you are,
                                {\key C-g} aborts and returns to
                                original position)\\
\end{tabled}

\vspace{12pt}

\sect{Cut and Paste}
\begin{tabled}
  {\key C-d}/{\key DEL}          & Delete next/previous chacter \\
  {\key M-d}/{\key M-DEL}        & Delete next/previous word \\
  {\key C-k}                     & Cut (``kill'') to the end of the line \\
  {\key C-SPC {\rm or} C-@}      & Set the mark \\
  {\key C-w}                     & Cut from cursor to mark (stands for
                                  ``wipe'') \\ 
  {\key M-w}                     & Copy from cursor to mark \\
  {\key C-y}                     & Paste the last text cut or copied
                                   (stands for ``yank'') \\
\end{tabled}

\vspace{12pt}

\sect{Files and Buffers}
\begin{tabled}
  {\key C-x C-f}           & ``Find'' a file (creates new buffer
                           containing the file) \\
                           & (This is how you bring a file into Emacs.) \\
  {\key C-x i}             & Insert a file into current buffer \\
  {\key C-x C-s}           & Save current buffer \\
  {\key C-x C-w}           & Write current buffer to a new file \\
  {\key C-x b}             & Switch to another buffer \\
  {\key C-x C-b}           & Display a list of all buffers \\
  {\key C-x k}             & Kill current buffer \\
\end{tabled}

\vspace{12pt}

\sect{Windows}
\begin{tabled}
  {\key C-x 0}                   & Delete this window \\
  {\key C-x 1}                   & Display only one window \\
  {\key C-x 2}                   & Split window in two \\
  {\key C-x o}                   & Switch to ``other'' window \\
\end{tabled}

\clearpage

\parindent=4.6742in
\begin{tabular}{@{}p{0.75in}cp{0.75in}@{}}
  & \Large\bf Notes & \\ \hline
\end{tabular}

\parindent=0in

\sect{Email}
\begin{tabled}
  {\key C-x m}            & Start a new mail message \\
  {\key C-c C-c}          & Send the mail message \\
                          & \\
  {\key M-x vm}           & Start the mail viewer (stands for ``view mail'') \\
                          & (The rest of the commands in this section
                             are valid only within {\tt VM}.) \\
  {\key SPC}              & Display next message, or next screen of current
                            message \\
  {\key n}/{\key p}       & Go to next/previous message (skips deleted ones) \\
  {\key N}/{\key P}       & Go to next/previous message (doesn't skip) \\
  {\key d}/{\key u}       & Mark/unmark message for deletion \\
  {\key \#}               & Expunge messages marked for deletion \\
  {\key r/R}              & Reply / Reply quoting original\\
  {\key f/F}              & Follow up (includes all recipients) /
                            Follow up quoting \\
  {\key q}                & Quit {\tt VM}, saving changes \\
  {\key x}                & Exit {\tt VM} without saving changes \\
\end{tabled}

\vspace{12pt}

\sect{Scheme Programming}
\begin{tabled}
  {\key M-x run-scheme}          & Start a Scheme process in a buffer \\
                                 & \\
                                 & When you find a file ending in {\tt
                                   .ss} or {\tt .scm}, Emacs
                                   automagically puts the buffer into
                                   ``{\tt scheme-mode}''.  The
                                   following commands are available in
                                   {\tt scheme-mode}: \\
                                 & \\
  {\key C-c b}                   & Send buffer contents to scheme
                                   process buffer \\
  {\key C-c C-e}                 & Send current definition to process
                                   buffer \\
  {\key C-c M-e}                 & Send definition and go to process
                                   buffer \\
  {\key C-c C-z}                 & Switch to process buffer \\
  {\key C-x C-e}                 & Send s-expression to process buffer \\
  {\key TAB}                     & Indent current line \\
\end{tabled}

\vspace{12pt}

\sect{Miscellaneous Editing}
\begin{tabled}
  {\key (some char)}         & Inserts the letter or symbol typed \\
  {\key C-x u}               & Undo last change \\
  {\key C-q}                 & Quote next key (this is how you
                             insert {\tt Control} characters and
                             other unusual beasts) \\
\end{tabled}

\vspace{12pt}

\sect{Getting Help}
\begin{tabled}
  {\key C-h t}                   & Run the emacs tutorial \\
  {\key C-h m}                   & Describe current mode \\
  {\key C-h k}                   & Describe key / key-sequence \\
  {\key C-h f}                   & Describe function \\
  {\key C-h w}                   & Where is function?  (which key) \\
  {\key C-h C-h}                 & Help on help \\
\end{tabled}

\end{document}
