[Openmcl-devel] Installation of ILisp

Gary Byers gb at clozure.com
Sun Nov 24 18:39:58 PST 2002

On Sun, 24 Nov 2002, Olivier Drolet wrote:

> Thanks to all who responded to my plea for help in my quest to get
> ILisp and OpenMCL working together on Mac OS X 10.2.2. My sorry state,
> however, continues. Now that I've configured the appropriate files (or
> so I think), and done 'make', how do I get the thing to run? (I.e.,
> ILisp. I seem to have no problem running OpenMCL in a shell.)
> The ILisp INSTALLATION file suggests:
> "To activate ILISP you should add appropriate Emacs Lisp forms to your
> `.emacs' or to the system-wide `default.el' file, depending on who will
> be
> using ILISP.  These forms take care of starting it whenever you access a
> Lisp file or run an inferior Lisp process.  You can copy relevant
> portions
> of the sample file `ilisp.emacs', which also shows how to customize some
> ILISP features."
> Not quite sure if I missed something here. Where are `.emacs' and
> `default.el'? Must they be created? I thought modifying `ilisp.emacs'
> was sufficient.

GNU Emacs uses a file called .emacs (in your home directory) as a
per-user init file: it (ordinarily) loads this file every time it
starts up, allowing you to customize the way that Emacs behaves for
you somewhat without having to change Emacs itself. (If there were
multiple users on your computer, each user could have a .emacs file
in their home directory that allowed them to customize Emacs according
to their own preferences.)

The notation "~/FILE" means "the file named FILE in the current user's
home directory", so we might say that GNU Emacs loads ~/.emacs whenever
it starts up, in much the same way that OpenMCL loads "home:openmcl-init"
whenever it starts up.  (In both cases, the program will silently
ignore missing files, and in both cases there's a command-line option
to suppress this behavior.)

XEmacs used to use ~/.emacs; people who used both Emacs variants found
that this became confusing (different customization options were unique
to each variant.)  XEmacs may have briefly used a file called ~/.xemacs;
it now uses files called "~/.xemacs/init.el" and "~/.xemacs/custom.el"
as per-user initialization and customization files, to keep this separate
from the initialization/customization mechanism that GNU Emacs uses.

So, the "ilisp.emacs" file distributed with ILISP is intended to show
how a GNU Emacs user could customize ~/.emacs (or how an XEmacs user
could customize ~/.xemacs/custom.el) so that ILISP is loaded and able
to run one or more lisp dialects.  The "ilisp.emacs" file presents
lots of customizable options; you might eventually want to add some
or all of these, but you can ignore most of them for the time being.

I'll assume for the sake of argument that you're using GNU Emacs
(and therefore need to add a few ELisp forms to ~/.emacs, creating
this file if it doesn't exist.)

The bare minimum you need to do is to tell Emacs where to find
ILISP's .el and .elc files and to tell it what to do when you
invoke the "openmcl" command (via M-X openmcl).

To accomplish the first, we push a directory or two onto Emacs's
"load-path" variable.  I keep local Emacs extensions in a directory
called "~/emacs/" and keep ILISP in "~/emacs/ilisp", so my ~/.emacs
file says:

(setq load-path (cons (expand-file-name "~/emacs/") load-path))
(setq load-path (cons (expand-file-name "~/emacs/ilisp/") load-path))

So after executing these forms, Emacs' load-path variable will have
the value ("/Users/gb/emacs/ilisp/" "/Users/gb/emacs/" . <original-value>),
where the original value is a long list of other directories.  Emacs's
LOAD and REQUIRE functions will search through this list of directories
in order until they find a matching file.

The other thing that we need to do is to define "openmcl" as an
interactive command that'll load ILISP and then call the elisp function

(autoload 'openmcl  "ilisp" "Inferior OpenMCL" t)

So, after editing your ~/.emacs file to add a directory or two to Emacs'
load-path and adding the "autoload" definition above, you should be
able to start a new Emacs (so that the ~/.emacs file will be loaded) and

M-X openmcl

and see an OpenMCL running inside an Emacs buffer a few seconds later.

There are two (primary) things that can go wrong here:

1) Emacs can't find the ilisp files.  Ensure that the directory containing
   the ILISP distribution is on Emacs' load-path.

2) Emacs can't find the openmcl shell script.  There are two (primary)
   reasons for this:

   a) the shell script isn't installed on a directory that's on your
      PATH.  Since you say that you can run OpenMCL in the shell, that's
      probably not an issue.

   b) Some GUI versions of Emacs for MacOSX don't pick up your PATH
      (and other environment variables) when launched from the Finder;
      Emacs uses the value of the PATH environment variable to set up
      its own "exec-path" variable.

I keep the openmcl shell script in /usr/local/bin, and find it necessary
to say:

(setq exec-path (cons "/usr/local/bin" exec-path))

in order to use the MacOSX GUI versions of Emacs with ILISP.  (Sadly,
that doesn't seem to fix mouse-event handling in scrollbars in that
Emacs under 10.2.2.)

> Any suggestions?
> [Usual warnings apply here: I'm a complete neophyte. My apologies]

Even though it may seem like little of the information's relevant, you
can learn a lot about Emacs via its builtin help and tutorials.  Try
typing C-h, then i, then "h" to get a feel for how Emacs' "info" system
works, then use "C-h i" to browse the online documentation.

Nothing there will directly answer questions about how to set up ILISP,
but as you learn more about how Emacs works terse explanations may start
to make more sense to you.

> Olivier Drolet
> trimtab at mac.com
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel

Openmcl-devel mailing list
Openmcl-devel at clozure.com

More information about the Openmcl-devel mailing list