Next: , Previous: , Up: REDUCE Integrated Development Environment   [Contents][Index]


2 Installation of REDUCE IDE

I recommend that you use the GNU Emacs package manager to install the latest REDUCE IDE package as described in the installation section of the main REDUCE IDE web page. Alternatively, releases as Emacs package (.tar) files are available from GitHub and via the REDUCE IDE home page. You can download a package file to any convenient directory and run the Emacs command M-x package-install-file on it. For further details, (emacs)Packages. None of the manual installation described below is then required.

The rest of this chapter, and the related section of the chapter on REDUCE Run mode, are for users who want to install and configure REDUCE IDE “by hand”, or who want to understand the installation process.

REDUCE mode is provided by files called reduce-mode.el, reduce-delim.el and reduce-font-lock.el, which are files of Emacs Lisp source code. These files should be byte-compiled, and the compiled (.elc) files installed in a directory from which Emacs loads its Lisp code. If necessary, you can customize your Emacs load-path so that Emacs can find the .elc files; Customization in The Emacs Editor.

Emacs initialization and customization is stored in a file that is normally called .emacs and lives in your home directory. The precise meaning of “home directory” depends on both your operating system and Emacs version; the easiest way to find it in Emacs is to visit the directory ~, or just visit the file ~/.emacs directly. Your .emacs file is updated automatically by the Emacs customization facility and you can also edit it by hand to add other configuration. See Init File in The Emacs Editor.

Before REDUCE mode can be used, the file reduce-mode.elc must be loaded. (It will then normally load reduce-delim.elc and reduce-font-lock.elc automatically.) This is necessary only once per Emacs session. It can be loaded explicitly, most easily by giving the command M-x load-library reduce-mode. However, you will probably want reduce-mode.elc to be loaded automatically the first time you (explicitly or implicitly) turn on REDUCE mode. The way to do this is to put the following statement into your .emacs file:

(autoload 'reduce-mode "reduce-mode"
          "Major mode for REDUCE code editing" t)

This statement is completely innocuous and will have no effect unless you select REDUCE mode. It could therefore quite safely be put in a system-wide configuration file (e.g. default.el or site-start.el). See Init File in The Emacs Editor.

It is also very convenient to have REDUCE mode turned on automatically when editing a REDUCE source code file. This can be done based on the “extension” of the filename. Provided you end all REDUCE source code file names with the standard extension .red, the following statement in your .emacs file will have the desired effect:

(add-to-list 'auto-mode-alist '("\\.red\\'" . reduce-mode))

You can use other extensions as well or instead; if you use a different file naming convention then make the appropriate change(s) to the above statement. Emacs also provides other facilities that can be used for controlling major modes.

Installation of REDUCE Run mode is documented separately; Running REDUCE in a buffer.


Next: General features of REDUCE mode, Previous: Introduction to REDUCE IDE, Up: REDUCE Integrated Development Environment   [Contents][Index]