The distribution of cocoa-4.5 includes an
emacs/ directory which contains
cocoa.emacs (the settings to be added to your
- a friendly CoCoA menu
- automatic indentation
- coloured syntax (in font-lock-mode - default)
- capitalization of keywords (in abbrev-mode - default)
- automatic loading of
wordlist.txtfor dynamic abbrev expansion (
From the menu you can
- send lines, regions and files to cocoa
- go to the parse error line (if you had a parse error after sending a file)
- start or restart the CoCoAServer
Use TAB for Completion (available soon) will allows to toggle this option. It used to be always off up to cocoa-4.4, and always on in cocoa-4.5.
Some key bindings in cocoa-mode
C-c C-e(like in latex-mode) writes the appropriate "End" (EndIf,...)
C-c C-c(like in c-mode) comment-region
If the following features do not work you should customize the variable
cocoa-executable in cocoa.emacs:
From a buffer in cocoa-mode you can select things and "send" them to a cocoa buffer (called
*cocoa*) to be evaluated:
- execute this line (from any point in the line)
- execute the selected region
- execute all this file (from any point in thefile)
- go to the parse error line (if C-c C-f gave a parse error)
- call the CoCoA manual for this word (from any point in the word)
They will automatically start CoCoA (if it isn't already running in a
- opens a buffer (called
*cocoa*) with a running CoCoA
Installation instructions for experts
Copy the customizations and the settings you like from cocoa-4.5/emacs/cocoa.emacs into your ~/.emacs.
Installation instructions for non-experts
Following these instructions Emacs will recognise files with a CoCoA extension(
.coc, .cocoa, .cpkg): REMEMBER to add one to the name of your files!
If you used Emacs itself to change some settings you should restart Emacs. (of course you can load them without restarting Emacs, but this is the section for non-experts! ;-) )
.emacs file with any editor
(it should be in your home, and it may not exist!):
Add this line at the end of your .emacs:
If you did not install cocoa in
then you need to correct the path in the files:
NB: MacOSX hides all file whose name start with ".", in particular .emacs.
Go to the folder emacs in CoCoA-4.5 and double-click on one of
set-new-emacs-prefscreates a brand new .emacs file (and moves the old one, if you had one, into previous.emacs)
set-add-emacs-prefsadds one line to your current .emacs file (creating it if necessary)
There is a file called "_emacs" in your cocoa-4.5/emacs/ directory which contains all the cocoa-emacs settings.
You need to set your "HOME" variable to the cocoa-4.5/emacs/ directory. (supposing that the average Windows user does not use the variable "HOME" for anything else) That is where Emacs looks for its config file, i.e. _emacs. Your computer evaluates %HOME% when you log in.
To set it right click on "My Computer", click on "properties" and then on the "Advanced" tab. Then click on the button "Environment Variables". Another dialog pops up and you add HOME by pressing on "new" and filling in the appropriate values. The upper "new" sets HOME for all users and requires admin-rights, the lower "new" sets it just for the current user.