Index: doc/theses/andrew_beach_MMath/cfalab.sty
===================================================================
--- doc/theses/andrew_beach_MMath/cfalab.sty	(revision edc6ea2cfa679ce9cb9bc42816103d2f2e03fcd1)
+++ doc/theses/andrew_beach_MMath/cfalab.sty	(revision c1136c56605f040aed4d11ff33e746bc1cefb3fd)
@@ -94,9 +94,39 @@
 \lstset{defaultdialect={[UW]CFA}}
 
-% The cfalab style defines some common settings useful in different languages.
-\lstdefinestyle{cfalab}{%
-    columns=fullflexible,
-    basicstyle=\linespread{0.9}\tt,
-    stringstyle=\tt,
+% Create an internal paragraph indent amount. This is used internally to
+% mimic the standard indent even when it has been overriden in the document.
+\newlength\cfalab@parindent
+\deflength\cfalab@parindent{\parindent}
+
+% The cfacommon style has many useful defaults for CFA and other types of
+% code. Use the listings option "style=cfacommon" to load them.
+\lstdefinestyle{cfacommon}{
+  columns=fullflexible,
+  basicstyle=\linespread{0.9}\sf,
+  stringstyle=\tt,
+  tabsize=5,
+  % Indent code to paragraph indentation.
+  xleftmargin=\cfalab@parindent,
+  % Allow ASCII characters in the range 128-255.
+  extendedchars=true,
+  % This allows you to use "math mode" to insert LaTeX into the code.
+  % Use \( and \) if you need to insert math mode inside that code.
+  escapechar=\$,
+  % Disable LaTeX math escape in CFA code $...$
+  mathescape=false,
+  keepspaces=true,
+  % Do not show spaces with cup.
+  showstringspaces=false,
+  % Show blank lines at end of code.
+  showlines=true,
+  % Spacing above/below code block.
+  aboveskip=4pt,belowskip=0pt,
+  numberstyle=\footnotesize\sf,
+  % Replace/adjust listing characters that look bad in sanserif.
+  literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
+    {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
+    {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
+    {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2
+    {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
 }
 
@@ -104,39 +134,6 @@
 % Below this line is for compatability with the old common.tex file.
 
-\newcommand{\CFAStyle}{%
-  \lstset{
-    columns=fullflexible,
-    % reduce line spacing and use sanserif font
-    basicstyle=\linespread{0.9}\sf,
-    % use typewriter font
-    stringstyle=\tt,
-    tabsize=5,
-    % indent code to paragraph indentation
-    %xleftmargin=\parindentlnth,
-    % Allow ASCII characters in the range 128-255.
-    extendedchars=true,
-    % This allows you to use "math mode" to insert LaTeX into the code.
-    % Use \( and \) if you need to insert math mode inside that code.
-    escapechar=\$,
-    % LaTeX math escape in CFA code $...$
-    mathescape=false,
-    keepspaces=true,
-    % do not show spaces with cup
-    showstringspaces=false,
-    % show blank lines at end of code
-    showlines=true,
-    % spacing above/below code block
-    aboveskip=4pt,
-    belowskip=0pt,
-    % numbering style
-    numberstyle=\footnotesize\sf,
-    % replace/adjust listing characters that look bad in sanserif
-    literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
-      {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
-      {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
-      {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2
-      {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
-  }
-}
+% Backwards compatable way to activate the cfacommon style.
+\newcommand{\CFAStyle}{\lstset{style=cfacommon}}
 
 % A couple of abbreviations are provided. Just ones someone liked.
Index: doc/theses/andrew_beach_MMath/uw-ethesis.tex
===================================================================
--- doc/theses/andrew_beach_MMath/uw-ethesis.tex	(revision edc6ea2cfa679ce9cb9bc42816103d2f2e03fcd1)
+++ doc/theses/andrew_beach_MMath/uw-ethesis.tex	(revision c1136c56605f040aed4d11ff33e746bc1cefb3fd)
@@ -198,11 +198,7 @@
 \makeglossaries
 
-
+% listings package configuation:
 \lstMakeShortInline@
-
-% CFA code-style for all languages
-\CFAStyle
-% CFA default lnaguage
-\lstset{language=CFA,basicstyle=\linespread{0.9}\tt}
+\lstset{language=CFA,style=cfacommon,basicstyle=\linespread{0.9}\tt}
 \lstset{moredelim=**[is][\protect\color{red}]{@}{@}}
 % Annotations from Peter:
