From: Chris Hanson Date: Sat, 26 Jun 2010 08:50:16 +0000 (-0700) Subject: Add suggested elisp code for using this. X-Git-Tag: 20100708-Gtk~13 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=29c7d8189c3391f58f9d63269b2f26967a14e529;p=mit-scheme.git Add suggested elisp code for using this. --- diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index f35ab46fa..789ddf3b6 100644 --- a/src/runtime/swank.scm +++ b/src/runtime/swank.scm @@ -31,6 +31,34 @@ USA. ;;;; SWANK module for MIT/GNU Scheme ;;; package: (runtime swank) +;;; Suggested for .emacs: +#| + (defun mit-scheme-init (file encoding) + (format "%S\n\n" `(start-swank ,file))) + + (defun mit-scheme-find-buffer-package () + (save-excursion + (let ((case-fold-search t)) + (beginning-of-buffer) + (and (re-search-forward "^;+ package: \\((.+)\\).*$" nil t) + (match-string-no-properties 1))))) + + (defun mit-scheme-slime-mode-init () + (slime-mode t) + (make-local-variable 'slime-find-buffer-package-function) + (setq slime-find-buffer-package-function 'mit-scheme-find-buffer-package)) + + (when (require 'slime nil t) + (slime-setup) + (if (not (memq 'mit-scheme slime-lisp-implementations)) + (setq slime-lisp-implementations + (cons '(mit-scheme ("mit-scheme") :init mit-scheme-init) + slime-lisp-implementations))) + (setq slime-default-lisp 'mit-scheme) + (add-hook 'scheme-mode-hook 'mit-scheme-slime-mode-init) + (setq inferior-lisp-program "mit-scheme")) +|# + (declare (usual-integrations)) (define (start-swank #!optional port-file)