# setting up the Macaulay2 emacs interface

If you are a newcomer to emacs, you should spend a few minutes going through the emacs tutorial. Start up emacs with the command emacs and then start up the emacs tutorial with the keystrokes C-h t. (The notation C-h indicates that you should type Control-H, by holding down the control key, and pressing H.) The emacs tutorial will introduce you to the basic keystrokes useful with emacs. After running through that you will want to examine the online emacs manual that can be read with info mode; you may enter or re-enter that mode with the keystrokes C-h i.

The Macaulay2 emacs interface consists of several files in the directory share/emacs/site-lisp/Macaulay2/ in the Macaulay2 distribution tree. If you're lucky, then your system administrator has installed Macaulay2 so that directory ends up in the same place where emacs looks for its files, as listed by the emacs variable loadpath. If not, then in order for emacs to be able to find these files, place the following lines in the .emacs file in your home directory, creating the file if necessary. Alternatively, and much simpler, run M2, and let the setupEmacs function do it for you.

    ;; .emacs file in your home directory
(global-set-key [ f12 ] 'M2)