comparison src/Intro.v @ 397:d62ed7381a0b

Instructions on directory-local Coq parameter specification, thanks to a tip from Thomas Braibant
author Adam Chlipala <adam@chlipala.net>
date Sun, 06 May 2012 17:15:15 -0400
parents d40b05266306
children 05efde66559d
comparison
equal deleted inserted replaced
396:def1a6b35ccd 397:d62ed7381a0b
198 198
199 %\item %#<li>#Unpack the tarball to some directory %\texttt{%#<tt>#DIR#</tt>#%}%.#</li># 199 %\item %#<li>#Unpack the tarball to some directory %\texttt{%#<tt>#DIR#</tt>#%}%.#</li>#
200 200
201 %\item %#<li>#Run %\texttt{%#<tt>#make#</tt>#%}% in %\texttt{%#<tt>#DIR#</tt>#%}%.#</li># 201 %\item %#<li>#Run %\texttt{%#<tt>#make#</tt>#%}% in %\texttt{%#<tt>#DIR#</tt>#%}%.#</li>#
202 202
203 %\item %#<li>#There are some minor headaches associated with getting Proof General to pass the proper command line arguments to the %\texttt{%#<tt>#coqtop#</tt>#%}% program, which provides the interactive Coq toplevel. The best way to add settings that will be shared by many source files is to add a custom variable setting to your %\index{.emacs file@\texttt{.emacs} file}\texttt{%#<tt>#.emacs#</tt>#%}% file, like this: 203 %\item %#<li>#There are some minor headaches associated with getting Proof General to pass the proper command line arguments to the %\texttt{%#<tt>#coqtop#</tt>#%}% program, which provides the interactive Coq toplevel. One way to add settings that will be shared by many source files is to add a custom variable setting to your %\index{.emacs file@\texttt{.emacs} file}\texttt{%#<tt>#.emacs#</tt>#%}% file, like this:
204 %\begin{verbatim}%#<pre>#(custom-set-variables 204 %\begin{verbatim}%#<pre>#(custom-set-variables
205 ... 205 ...
206 '(coq-prog-args '("-I" "DIR/src")) 206 '(coq-prog-args '("-I" "DIR/src"))
207 ... 207 ...
208 )#</pre>#%\end{verbatim}% 208 )#</pre>#%\end{verbatim}%
209 The extra arguments demonstrated here are the proper choices for working with the code for this book. The ellipses stand for other Emacs customization settings you may already have. It can be helpful to save several alternate sets of flags in your %\texttt{%#<tt>#.emacs#</tt>#%}% file, with all but one commented out within the %\texttt{%#<tt>#custom-set-variables#</tt>#%}% block at any given time.#</li># 209 The extra arguments demonstrated here are the proper choices for working with the code for this book. The ellipses stand for other Emacs customization settings you may already have. It can be helpful to save several alternate sets of flags in your %\texttt{%#<tt>#.emacs#</tt>#%}% file, with all but one commented out within the %\texttt{%#<tt>#custom-set-variables#</tt>#%}% block at any given time.
210
211 Alternatively, Proof General configuration can be set on a per-directory basis, using a %\index{.dir-locals.el file@\texttt{.dir-locals.el} file}\texttt{%#<i>#.dir-locals.el#</i>#%}% file in the directory of the source files for which you want the settings to apply. Here is an example that could be written in such a file to enable use of the book source. Note the need to include an argument that starts Coq in Emacs support mode.
212 %\begin{verbatim}%#<pre>#((coq-mode . ((coq-prog-args . ("-emacs-U" "-I" "DIR/src")))))#</pre>#%\end{verbatim}%
213 #</li>#
210 214
211 #</ol>#%\end{enumerate}% 215 #</ol>#%\end{enumerate}%
212 216
213 Every chapter of this book is generated from a commented Coq source file. You can load these files and run through them step-by-step in Proof General. Be sure to run the Coq binary %\texttt{%#<tt>#coqtop#</tt>#%}% with the command-line argument %\texttt{%#<tt>#-I DIR/src#</tt>#%}%. If you have installed Proof General properly, the Coq mode should start automatically when you visit a %\texttt{%#<tt>#.v#</tt>#%}% buffer in Emacs, and the above advice on %\texttt{%#<tt>#.emacs#</tt>#%}% settings should ensure that the proper arguments are passed to %\texttt{%#<tt>#coqtop#</tt>#%}% by Emacs. 217 Every chapter of this book is generated from a commented Coq source file. You can load these files and run through them step-by-step in Proof General. Be sure to run the Coq binary %\texttt{%#<tt>#coqtop#</tt>#%}% with the command-line argument %\texttt{%#<tt>#-I DIR/src#</tt>#%}%. If you have installed Proof General properly, the Coq mode should start automatically when you visit a %\texttt{%#<tt>#.v#</tt>#%}% buffer in Emacs, and the above advice on %\texttt{%#<tt>#.emacs#</tt>#%}% settings should ensure that the proper arguments are passed to %\texttt{%#<tt>#coqtop#</tt>#%}% by Emacs.
214 218