(require 'cl) (setq mswindows-p (string-match "windows" (symbol-name system-type))) (setq cygwin-p (and mswindows-p (equal (subseq (getenv "HOME") 0 1) "/"))) (if (and mswindows-p (not cygwin-p)) (progn (defvar lsw-dir (let ((this-dir (file-name-directory load-file-name))) (subseq this-dir 0 (- (length this-dir) 6)) ; "emacs" )) (defvar slime-dir (concat (file-name-directory load-file-name) "slime/")) (add-to-list 'load-path slime-dir) (require 'slime) (slime-setup) (setenv "ABCL_WD" (substitute ?\\ ?/ lsw-dir)) (message "HEY!") (message (getenv "ABCL_WD")) (add-hook 'lisp-mode-hook (lambda () (slime-mode t) (setq lisp-indent-function 'common-lisp-indent-function))) (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t))) (setq slime-lisp-implementations `((abcl (,(concat lsw-dir "abcl.bat")) :init slime-init-command)))) (error "Assuming that you are running on windows but not under cygwin!") ) (defun slime-init-command (port-filename coding-system) "Return a string to initialize Lisp." (let ((loader (if (file-name-absolute-p slime-backend) slime-backend (concat slime-path slime-backend))) (encoding (slime-coding-system-cl-name coding-system))) ;; Return a single form to avoid problems with buffered input. (format "%S\n\n" `(progn (load ,loader :verbose t) (set (intern "*USE-DEDICATED-OUTPUT-STREAM*" 'swank) t) (funcall (read-from-string "swank:start-server") ,port-filename :external-format ,encoding)))))