Habibullah’s posterous

« Back to blog
September 25, 2008

Interact with Common Lisp from within Emacs

To start Allegro Common Lisp from within Emacs in Windows:

1) Generate mlisp.exe as explained in a previous blog post.

2) Copy paste the following code into your .emacs file:

(defvar *eli-directory*)                                                                                                                      
(setq *eli-directory* (expand-file-name "C:/Program Files/acl81-express/eli/"))

(when (and (not (string-match "xemacs" emacs-version))
           (= emacs-major-version 20)
           (<= emacs-minor-version 2))
   (setq load-path (cons *eli-directory* load-path)))

(load (format "%sfi-site-init.el" *eli-directory*))

(setq fi:common-lisp-image-name "C:/Program Files/acl81-express/mlisp.exe")

(setq fi:common-lisp-host "localhost")
(setq fi:common-lisp-directory "~/.")

;; This function starts up lisp with your defaults.
(defun run-common-lisp ()
  (interactive)
  (fi:common-lisp fi:common-lisp-buffer-name
                  fi:common-lisp-directory
                  fi:common-lisp-image-name
                  fi:common-lisp-image-arguments
                  fi:common-lisp-host
                  fi:common-lisp-image-file))

;; Set up a keybinding for `run-common-lisp':
(progn
  (setq ctlx-3-map (make-keymap))
  (define-key ctl-x-map "3" ctlx-3-map)
  (define-key ctlx-3-map "l" 'run-common-lisp))

3) Change *eli-directory* to where you have installed Allegro Common Lisp trial. I have installed it at the given location. You'll find mlisp.exe one folder above that.

4) Save the .emacs file and restart Emacs.

5) To start Allegro CL, press C - x - 3 - l

(That's lower case l at the end)

6) You'll find a new buffer *common-lisp* where you can interact with mlisp.exe from within Emacs. 



Comments (1)
Oct 15, 2008

This post explains using Emacs and ACL via ELI. There is a IMHO better way, that uses Slime instead of ELI. I'll blog about that later.

Leave a comment...
 
To leave a comment on this posterous, please login.
Click here to login or sign up