 ;  ("\C-c\C-z" 'slime-nop)
 )
 
+;;; Based on slime-init-command -- Allow for pre-loaded swank
+(defun slime-cond-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)))
+    (format "%S\n%S\n\n"
+            `(unless (and (find-package "SWANK") (fboundp (intern "START-SERVER" "SWANK")))
+	       (load ,loader :verbose t))
+            `(swank:start-server ,port-filename :external-format ,encoding))))
+
 ;;; based on slime-repl-return
 (defun sw-return (&optional end-of-input)
   "Evaluate the current input string, or insert a newline.  

      s)))

(defun specware-listener-mode-init ()
  (when specware-use-x-symbol
    (x-symbol-mode))
  (setq slime-words-of-encouragement
	'("Welcome to Specware!"))

;;; Redefining slime functions and variables
(defun* slime-start (&key (program inferior-lisp-program) program-args 
                          (coding-system slime-net-coding-system)
                          (init 'slime-cond-init-command)
                          name
                          (buffer "*inferior-lisp*"))
  (if (and (eq *specware-lisp* 'allegro) *windows-system-p*)
