Commits

Anonymous committed 9539919

Fixing loading project.

Comments (0)

Files changed (1)

src/org/lispdev/swank/SwankInterface.java

 package org.lispdev.swank;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Hashtable;
 
 import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.lispdev.log.Trace;
 import org.lispdev.swank.debug.LispDebugTarget;
 import org.lispdev.swank.debug.LispVariable;
       IRunnableDriver r)
   {
     Assert.isNotNull(implem);
-    this.extDir = extDir;
+    Assert.isNotNull(extDir);
+    this.extDir = (extDir.replace('\\', '/') + '/').replace("//", "/");
     swank = new SwankInterfaceCore(r, implem, implem.getPort());
     implementation = implem;
   }
   {
     if( swank.isConnected() )
     {
+      String startupCode = "(load \"" + extDir
+        + "lisp-extensions/asdf-extensions.lisp" + "\")";
+
+      sendEvalAndGrab(startupCode, 1000);
       LispNode info =
           swank.sendEvalAndGrabRaw("(swank:connection-info)", "nil", 1000);
       LispNode impl = info.getf(":lisp-implementation");
   public synchronized void sendLoadASDF(String asdfile,
       SwankCompilationRunnable callback)
   {
-    asdfile = asdfile.replace("\\", "/");
-    asdfile = swank.translateLocalFilePath(asdfile);
-    String msg = "(swank:operate-on-system-for-emacs \"" + asdfile +
-      "\" \"LOAD-OP\")";
+    IPath path = new Path(asdfile);
+    File file = path.toFile();
+    Assert.isNotNull(file);
+    Assert.isLegal(path.toFile().exists());
+    IPath dir = path.removeLastSegments(1);
+    registerLibPath(swank.translateLocalFilePath(dir.toString()));
+    String msg = "(swank:operate-on-system-for-emacs \""
+      + path.removeFileExtension().lastSegment() + "\" \"LOAD-OP\")";
     swank.sendEvalRaw(msg, callback);
   }