<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
The Emacs \var{moos-mode} was written by MIT student Jacob Gerlach in
2014, in Release 14.7, to provide syntax highlighting in Emacs for
mission (\var{.moos}) files and behavior (\var{.bhv}) files. The aim
is to make simple syntax errors easier to detect, before a mission is
launched. Once a mission is launched there are other provisions for
catching syntax errors, especially in appcast-enabled applications. The
Emacs mode makes this a lot easier, especially for newcomers. The idea
is shown in the figure below. Note how much easier it is, with
highlighting on the right, to detect the syntax error in the first
line of the \app{pNodeReporter} configuration.


\vspace{0.1in}
\begin{figure}[ht]
  \centering 
  \includegraphics[width=0.9\linewidth]{figs_appx/moos-mode.png}
  \caption{{\bf The MOOS Emacs Mode}: One the left is a sample mission
    file without syntax highlighting. On the right, highlighting is enabled.
    Note the syntax error in the first line of \app{pNodeReporter} is more
    apparent.}
\label{fig_emacs_mode}
\end{figure}



%=====================================================================
\subsection{Using the Emacs MOOS Mode}

The Emacs MOOS mode is implemented in three files distributed with MOOS-IvP
source code:


\vspace{0.1in}
\begin{consoleverb}
 $ cd moos-ivp/editor-modes
 $ ls
   moos-apps.el  moos-bhvs.el  moos-mode.el
\end{consoleverb}
\vspace{0.1in}


\noindent
To use the mode in your Emacs session, just add a couple lines in your 
\var{.emacs} file like this:

\vspace{0.1in}
\begin{fileverb}
 (add-to-list 'load-path "~/moos-ivp/editor-modes/")
 (require 'moos-mode)
\end{fileverb}
\vspace{0.1in}

\noindent
The exact path on the first line above may depend on where you have moos-ivp
checked out on your system.

%=====================================================================
\subsection{Adding Your Own Apps and Behaviors to the Modes}

At some point you may want to add your own MOOS applications to this
mode. This can be done by adding further lines to your \var{.emacs}
file, below the two lines mentioned above. For example, if you have a
\app{pFooBar} app that has two parameters \pvar{time} and \pvar{date},
the following in your \var{~/.emacs} file should do the trick:

\vspace{0.1in}
\begin{fileverb}
 (add-to-list 'load-path "~/moos-ivp/editor-modes/")
 (require 'moos-mode)
 ...
 (moos-add-user-app '("pFooBar" "time" "date"))                &lt;&lt;-- Add this line
\end{fileverb}
\vspace{0.1in}

\noindent
The operation is similar for IvP behaviors. If you have a behavior
\var{BHV\_Smarty} with parameters \bvar{insight} and \bvar{intuition},
the following in your \var{~/.emacs} file should do the trick:

\vspace{0.1in}
\begin{fileverb}
 (add-to-list 'load-path "~/moos-ivp/editor-modes/")
 (require 'moos-mode)
 ...
 (moos-add-user-bhv '("BHV_Smarty" "insight" "intuition"))     &lt;&lt;-- Add this line
\end{fileverb}
\vspace{0.1in}

%=====================================================================
\subsection{Using the Emacs MOOS Mode in Older MOOS-IvP Releases}

If you are working with an older release of MOOS-IvP, using the Emacs MOOS
mode is still possible. Just download the three lisp files separately:

\begin{consoleverb}
svn co https://oceanai.mit.edu/svn/moos-ivp-aro/releases/moos-ivp-14.7/editor-modes
\end{consoleverb}

\noindent
And adjust the line in your \var{.emacs} file accordingly. For the most part, 
the supported MOOS application names and parameters defined in these lisp
files should be applicable with older releases of MOOS-IvP.

%=====================================================================
\subsection{Further Emacs Links}

\begin{packed_itemize}
\item Getting Emacs in Linux:
  \urlx{http://oceanai.mit.edu/ivpman/help/emacs_get_for_gnulinux}

\item Getting Emacs in Mac OS X:
  \urlx{http://oceanai.mit.edu/ivpman/help/emacs_get_for_osx}

\item Getting a more Graphical Emacs for Mac OS X:
  \urlx{http://oceanai.mit.edu/ivpman/help/emacs_graphical}

\item Survival Emacs: 
  \urlx{http://oceanai.mit.edu/ivpman/help/emacs_survival}

\item Configuring Emacs:
  \urlx{http://oceanai.mit.edu/ivpman/help/emacs_config}

\item Why use Emacs: \urlx{http://xkcd.com/378/}

\end{packed_itemize}

%=====================================================================
\subsection{Contact Information}

For bug reports, suggestions or feature requests, email Jake at jacobgerlach@gmail.com.




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