<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: Getting Started with Emacs}
\vspace{0.1in}
\labdate{Spring 2020}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.OSXEmacs}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{Getting Started with Emacs}
%====================================================================

If you are using your own Linux machine, or your own Mac in 2.680,
chances are you already are familiar with Emacs or a suitably
equivalent text editor. This page is written with the new Mac user in
mind who has never used Emacs. It may be useful for others as well.

%---------------------------------------------------------------------
\subsection*{The pre-installed emacs}

Most likely your machine already has a version of emacs installed,
with the full path name of \var{/usr/bin/emacs}. Verify this:

\vspace{0.15in}
\begin{consoleverb}
 $ which emacs
 /usr/bin/emacs
\end{consoleverb}
\vspace{0.15in}

\noindent
If this is not the case, install it. On the Mac:

\vspace{0.15in}
\begin{consoleverb}
 $ sudo port install emacs
\end{consoleverb}
\vspace{0.15in}

\noindent
In Linux:

\vspace{0.15in}
\begin{consoleverb}
 $ sudo apt-get install emacs
\end{consoleverb}
\vspace{0.15in}

%---------------------------------------------------------------------
\subsection*{The absolute minimal emacs}

There are many things you can do in emacs. Here we describe how to (1)
open a file, (2) save a few changes, and (3) quit. This at least
allows us to do a few things in emacs before learning further.  

\begin{packed_enumerate}
\item Open a file in emacs:

\vspace{0.15in}
\begin{consoleverb}
 $ /usr/bin/emacs testfile
\end{consoleverb}
\vspace{0.15in}

We use the full emacs pathname in the off chance that \var{/usr/bin/}
may not be in your shell path. You can try it without the
\var{/usr/bin/}. You should be able to just type text, and use the
arrow keys, backspace, delete etc., to just compose a sample for
yourself.

\item Save a file in emacs: To save a file, type the following two
  commands: \var{Ctrl-x}, then \var{Ctrl-s}. You should see a line at
  the very bottom of your emacs window like:

  \vspace{0.15in}
  \var{Wrote /Users/myname/testfile}

\vspace{0.15in}
If not, type \var{Ctrl-g} in the emacs window (a useful way of
resetting any weird state you may have gotten yourself into), and try
the save again.


\item Quitting emacs: To quit emacs, type the following two commands:
  \var{Ctrl-x}, then \var{Ctrl-c}.
\end{packed_enumerate}


%------------------------------------------------------------------
\subsection*{Getting a more graphical Emacs}

The emacs in \var{/usr/bin/emacs} is fine for editing a text file right in
the Terminal window, but normally you will want to edit files in a
more graphical version of Emacs.  We recommend also installing the
emacs found at: \urlx{www.emacsformacosx.com}. After installation you will
need to add the following to your shell path:

\vspace{0.1in}

\var{/Applications/Emacs.app/Contents/MacOS}


%------------------------------------------------------------------
\subsection*{Resources for Learning Emacs}

\begin{packed_itemize}[3]

\item Learning GNU Emacs, Debra Cameron, James Elliot, Marc Loy, Eric
  Raymond, and Bill Rosenblatt, 3rd Edition, 2005.

\item MIT E Library

\item Emacs Cheat Sheet (Bob Rogers), here.

\item Emacs Cheat Sheet (Hains/Princeton) here.

\item "Emacs vs. vi", Editor War
\end{packed_itemize}

\end{document}

</pre></body></html>