;;;; Run ABCL under Emacs on cygwin ;;; Copyright (C) by 2012 Mark Evenson ;;; ;;; ;;; ;;; We assume that SLIME has been installed in c:/work/slime/, and ;;; that a copy of ABCL has been compiled from source under ;;; c:/work/abcl/. Adjust the paths in the following two s-expr if ;;; that is not the case. (add-to-list 'load-path "/cygdrive/c/work/slime") (require 'slime) (setq slime-lisp-implementations '((abcl ("/cygdrive/c/work/abcl/abcl.bat") :init slime-init-command-cygwin) (abcl.noinit ("/cygdrive/c/work/abcl/abcl.bat" "--noinit") :init slime-init-command-cygwin))) (slime-setup '(slime-repl slime-asdf slime-fancy slime-banner)) (defun slime-to-lisp-translation (filename) (replace-regexp-in-string "\n" "" (shell-command-to-string (format "cygpath.exe --windows %s" filename)))) (defun lisp-to-slime-translation (filename) (replace-regexp-in-string "\n" "" (shell-command-to-string (format "cygpath.exe --unix %s" filename)))) (setq slime-to-lisp-filename-function #'slime-to-lisp-translation) (setq slime-from-lisp-filename-function #'lisp-to-slime-translation) (require 'cl) (defun slime-init-command-cygwin (port-filename coding-system) (labels ((walk (form) (cond ((null form) nil) ((atom form) (if (filename-p form) (slime-to-lisp-translation form) form)) ((consp form) (cons (walk (car form)) (walk (cdr form)))))) (filename-p (s) (and (stringp s) (string-match "^/.+" s)))) (let ((command (slime-init-command port-filename coding-system))) (with-output-to-string (pp (walk (first (read-from-string (slime-init-command port-filename coding-system)))))))))