Open CL files in SLIME from the ACL IDE
Tuesday, July 20, 2004
In the past, I've shown how you can setup SLIME for a number of different CL implementations under MS Windows. However, some people have expressed an interest in using SLIME/Emacs as the default editor from the ACL IDE under MS Windows in a manner similar to how ELI can be configured as the default editor. I've worked out a (somewhat kludgey) way to do this. Here's how:
- In the ACL IDE, select the Tools/Options menu item. Click on the "Editor" tab and tick the "Open files in GNU Emacs" option. Save the options and exit the ACL IDE.
- Enter the statements at the end of this posting into your .emacs (Note: they are standalone and will serve as a minimal .emacs) file, adjusting directory locations as necessary.
- That's it!
;; Set the ELI & SLIME directories as appropriate (setq load-path (append (list "c:/usr/home/site/slime" "c:/bin/acl-7.0/eli") load-path))
;; Setup ELI for ACL (setq fi:common-lisp-image-name "c:/bin/acl-7.0/allegro-ansi.exe") (setq fi:common-lisp-directory "c:/bin/acl-7.0/") (setq fi:common-lisp-image-arguments '("-L" "c:/usr/home/.slime.lisp")) (load "fi-site-init") (defun fi::initialize-menu-bar-map ()) ; don't display the ELI menus (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)
;; Re-load lisp-mode so that ELI's common-lisp-mode doesn't replace lisp-mode ;; This also gets rid of ELI's keybindings (load "lisp-mode")
;; Specify mode for Lisp file extensions (setq auto-mode-alist (append '(("\.lisp$" . lisp-mode) ("\.lsp$" . lisp-mode) ("\.cl$" . lisp-mode) ("\.asd$" . lisp-mode) ("\.system$" . lisp-mode) )auto-mode-alist))
;; Now configure SLIME as the default mode for CL (require 'slime) (add-hook 'lisp-mode-hook (lambda () (slime-mode t) (define-key lisp-mode-map [(control j)] 'newline) (define-key lisp-mode-map [(control m)] 'newline-and-indent) (set (make-local-variable lisp-indent-function) 'common-lisp-indent-function))) (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t))) (slime-autodoc-mode)
;; Start up SLIME and get rid of the ELI listener buffer (slime-connect "localhost" 4005) (sleep-for .1) (kill-buffer "*common-lisp*")

