Sophie

Sophie

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

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-init.el</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_teaching_spemacs_sphow_spto_spfind_sp__M2.html">next</a> | <a href="_setting_spup_spthe_sp__Macaulay2_spemacs_spinterface.html">previous</a> | <a href="_teaching_spemacs_sphow_spto_spfind_sp__M2.html">forward</a> | <a href="_setting_spup_spthe_sp__Macaulay2_spemacs_spinterface.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-init.el.html" title="">teaching emacs how to find M2-init.el</a></div>
<hr/>
<div><h1>teaching emacs how to find M2-init.el</h1>
<div>Files containing emacs source code have names of the form <tt>*.el</tt>.  Macaulay2 comes with a file called <tt>M2-init.el</tt> that sets up emacs for running M2 conveniently.  It is important that emacs be able to find that file and the three other files that come with it, by searching in the directories listed in the emacs variable <tt>load-path</tt>.<p/>
If you are lucky, then the Macaulay2 directory tree has been installed with the same root as the emacs directory tree.  For example, if emacs and Macaulay2 are both installed in /usr, then <tt>M2-init.el</tt> is located at <tt>/usr/share/emacs/site-lisp/M2-init.el</tt>, and emacs already knows to look in that directory for source files.<p/>
The simplest way to teach emacs how to find <tt>M2-init.el</tt> is to let M2 do it for you.  Run M2, and then, in response to Macaulay2's input prompt, enter <tt>setup()</tt>.  If that works, the next time you start emacs, it should know how to find <tt>M2-init.el</tt> (see <a href="_setup.html" title="">setup</a>).  If that doesn't work, read onward.<p/>
To determine the precise path of the site-lisp directory emacs is looking in, so that you can install Macaulay2 properly, use the emacs describe-variable command, accessible with the key strokes <tt>C-h v</tt>, and ask for the description of the variable <tt>load-path</tt>.<p/>
Let's assume that you have located the Macaulay2 source code, and that <tt>M2-init.el</tt> is located at <tt>/foo/bar/share/emacs/site-lisp/M2-init.el</tt>, and that you want to tell emacs to search that directory, too.  Insert the following command into the file .emacs in your home directory.<pre>    (setq load-path 
          (append
           '( "/foo/bar/share/emacs/site-lisp" )
           load-path))</pre>
The next time you start emacs, emacs will look also in that directory for files, and it should find <tt>M2-init.el</tt>.</div>
</div>
</body>
</html>