Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 5223

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>teaching emacs how to find M2</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_running_sp__Macaulay2_spin_spemacs.html">next</a> | <a href="_teaching_spemacs_sphow_spto_spfind_sp__M2-init.el.html">previous</a> | <a href="_running_sp__Macaulay2_spin_spemacs.html">forward</a> | <a href="_teaching_spemacs_sphow_spto_spfind_sp__M2-init.el.html">backward</a> | <a href="_using_sp__Macaulay2_spwith_spemacs.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_getting_spstarted.html" title="">getting started</a> > <a href="_using_sp__Macaulay2_spwith_spemacs.html" title="">using Macaulay2 with emacs</a> > <a href="_teaching_spemacs_sphow_spto_spfind_sp__M2.html" title="">teaching emacs how to find M2</a></div>
<hr/>
<div><h1>teaching emacs how to find M2</h1>
<div>If you teach your shell how to find M2, then you do not have to teach emacs how to find M2.  See <a href="_teaching_spyour_spshell_sphow_spto_spfind_sp__M2.html" title="">teaching your shell how to find M2</a>, and come back to this section only if you fail with that.  Let's assume that you have found M2 (the program), and that is located in the directory <tt>/foo/bar/bin</tt>, say.<p/>
Let's assume you have already set up the function key f12 to call M2.  That is done with the following command in the .emacs file.<pre>     (global-set-key [ f12 ] 'M2)</pre>
Then when you press f12, M2 should start running.<p/>
Here is what you will see on your screen in the minibuffer at the bottom of the screen when you press f12 if emacs doesn't know how to find the file <tt>M2-init.el</tt>.<pre>     Symbol's function definition is void: M2</pre>
If you see that, you are not ready for this section: see <a href="_teaching_spemacs_sphow_spto_spfind_sp__M2-init.el.html" title="">teaching emacs how to find M2-init.el</a>.<p/>
Here is what you will see on your screen in a buffer named <tt>*M2*</tt> if emacs knows how to find the file <tt>M2-init.el</tt> but not how to find the program <tt>M2</tt>.<p/>
<pre>    + M2 --no-readline --print-width 189
    /bin/sh: M2: command not found

    Process M2 exited abnormally with code 127</pre>
<h2>teaching emacs temporarily</h2>
To teach emacs temporarily where to find M2, press<pre>     C-u f12</pre>
(Recall that in emacs' notation for key-presses, C-u means to press u while holding down the control key.)  You will get the M2 command line in the minibuffer at the bottom of the screen, and you can edit it.  It will initially look something like this:<pre>     M2 --no-readline --print-width 189 </pre>
You can change it to the right thing:<pre>     /foo/bar/bin/M2 --no-readline --print-width 189 </pre>
Then press <tt>enter</tt> and M2 should start running.  That will stick for the rest of your emacs session.  Later, to return to the <tt>*M2*</tt> window from another, or to start up M2 again, just press f12.<h2>teaching emacs permanently</h2>
Every time emacs starts up it reads commands from the file .emacs in your home directory.  Put the following command in your .emacs file.<pre>(setq M2-exe "/foo/bar/bin/M2")</pre>
The next time you start emacs it wil know how to find M2.</div>
</div>
</body>
</html>