For version 0.7.0.
To top.

Editing Shapes files

This page gives a brief overview of the available tools that support the editing of Shapes files. At the moment, there is only one such tool, read on!
Sections:    The shapes-mode for Emacs

The shapes-mode for Emacs

With Emacs running the minor mode shapes-mode, you get both excellent support for editing your files (including nifty syntax highlighting), and a very convenient way of previewing your result. The mode also has some support for running the Shapes compiler interactively, but this is not described here.
Screenshot of Emacs with shapes-mode. The upper buffer shows the source with syntax highlighting, while the lower buffer shows a preview of the resulting graphics.


Here is a brief overview of the features provided by shapes-mode. Readers are referred to the on-line help in Emacs for additional information, as the information on this page is kept to a minimum for ease of maintenance.

Obtain and install shapes-mode

Installation instructions can be found in the file shapes-mode.el itself, but in case you don't like to read Emacs lisp files, instructions are given here as well.
Basic install
Current versions of Shapes come with shapes-mode.el, but one still has to inform Emacs where to find the file, and then activate it. You need to add the two lines of code that do this to your .emacs.el (or equivalent file). (If you do not know what or where the file .emacs.el is, you need to learn some Emacs basics before returning to these instructions.) The two lines of code are availble in a separate file, which can be located using the Shapes compiler in the following way (using cat to show the contents of the file):
cat `shapes --which-share`/edit/emacs/50shapes-mode.el
Just copy and paste, and the basic install is complete!
Note that although the filename 50shapes-mode.el reminds of automatic install of Emacs packages under Debian (by means of placing the file in the appropriate site-start.d directory), there is currently no Shapes package for Debian.
Optional components
Some features of shapes-mode require additional things to be installed:
Upgrading shapes-mode
Follow these instructions if you want to upgrade your shapes-mode without upgrading your entire Shapes installation. Since shapes-mode consists of a single file, we find it more convenient to refer users to the Git repository than to keep adding new versions to the SourceForge downloads all the time.
Begin by downloading shapes-mode.el. This is most recent version of shapes-mode in the master branch of Shapes.
If you are upgrading from the basic install of shapes-mode, remove the line in your .emacs.el that adds to load-path the directory where the shapes-mode.el bundled with Shapes is located.
Put the new shapes-mode.el in a directory on your Emacs load path. If you don't know what this means, create a new directory (say, emacs-addons) somewhere (say, ~/Library), add the line
(setq load-path (cons "~/Library/emacs-addons" load-path))
near the top of your .emacs.el (or equivalent file), and place shapes-mode.el in your newly created directory.
Make sure that your .emacs.el contains the line
(require 'shapes-mode)
and the upgrade is complete.

On-line help in Emacs

The main source of information about shapes-mode is the on-line help that the mode provides inside Emacs. Type C-h m to display the online help.
Screenshot of the Emacs on-line help for shapes-mode.


When shapes-mode is loaded, it runs the hook 'shapes-mode-hook.
Turn skeleton pairs on and off using M-x set-variable <enter> skeleton-pair <enter>, followed by either t to turn on or nil to turn off. To automatically turn on skeleton pairs for buffers running shapes-mode, you can use the hook;
(add-hook 'shapes-mode-hook
          (lambda ()
            (make-local-variable 'skeleton-pair)
            (setq skeleton-pair t)))
Get Shapes at Fast, secure and Free Open Source software downloads