diff options
author | michelou <michelou@epfl.ch> | 2007-08-16 16:52:49 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-08-16 16:52:49 +0000 |
commit | 300caee15c263c956ebf8f428fc827109ebfc9d8 (patch) | |
tree | 95a43f238e872375bc854bd52a62ffdfa5742a5e | |
parent | cbba5153da6cb1e6ef9f58fb8f1eb7c284841f11 (diff) | |
download | scala-300caee15c263c956ebf8f428fc827109ebfc9d8.tar.gz scala-300caee15c263c956ebf8f428fc827109ebfc9d8.tar.bz2 scala-300caee15c263c956ebf8f428fc827109ebfc9d8.zip |
added test for EMACS environment variable (jline)
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-windows.tmpl | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/InterpreterLoop.scala | 15 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 2233056bb3..69040dc9e8 100644 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -70,4 +70,4 @@ if $cygwin; then BOOT_CLASSPATH=`cygpath --path --$format "$BOOT_CLASSPATH"` fi -${JAVACMD:=java} ${JAVA_OPTS:=@javaflags@} -Xbootclasspath/a:"$BOOT_CLASSPATH" -cp "$EXTENSION_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.classpath="$CLASSPATH" @properties@ @class@ @toolflags@ "$@@" +${JAVACMD:=java} ${JAVA_OPTS:=@javaflags@} -Xbootclasspath/a:"$BOOT_CLASSPATH" -cp "$EXTENSION_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.classpath="$CLASSPATH" -Denv.emacs="$EMACS" @properties@ @class@ @toolflags@ "$@@" diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl index 492614d238..7c16d8d873 100644 --- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl @@ -52,7 +52,7 @@ if "%_BOOT_CLASSPATH%"=="" ( )
)
-set _PROPS=-Dscala.home="%_SCALA_HOME%" -Denv.classpath="%CLASSPATH%" @properties@
+set _PROPS=-Dscala.home="%_SCALA_HOME%" -Denv.classpath="%CLASSPATH%" -Denv.emacs="%EMACS%" @properties@
rem echo %_JAVACMD% -Xbootclasspath/a:"%_BOOT_CLASSPATH%" %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" @class@ @toolflags@ %_ARGS%
%_JAVACMD% -Xbootclasspath/a:"%_BOOT_CLASSPATH%" %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" @class@ @toolflags@ %_ARGS%
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index 67cfbf1dd0..f1a957f6a0 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -194,7 +194,7 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { * (1) whether to keep running, (2) the line to record for replay, * if any. */ def command(line: String): (Boolean, Option[String]) = { - def withFile(command: String)(action: String => Unit): Unit = { + def withFile(command: String)(action: String => Unit) { val spaceIdx = command.indexOf(' ') if (spaceIdx <= 0) { out.println("That command requires a filename to be specified.") @@ -241,8 +241,7 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { * read, go ahead and interpret it. Return the full string * to be recorded for replay, if any. */ - def interpretStartingWith(code: String): Option[String] = - { + def interpretStartingWith(code: String): Option[String] = { interpreter.interpret(code) match { case IR.Success => Some(code) case IR.Error => None @@ -260,23 +259,23 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { } } - - def main(settings: Settings) { this.settings = settings in = in0 match { - case Some(in0) => new SimpleReader(in0, out, true) + case Some(in0) => + new SimpleReader(in0, out, true) case None => - if (settings.Xnojline.value) + val emacsShell = System.getProperty("env.emacs", "") != "" + //println("emacsShell="+emacsShell) //debug + if (settings.Xnojline.value || emacsShell) new SimpleReader() else InteractiveReader.createDefault() } - uglinessxxx = new java.net.URLClassLoader( ClassPath.expandPath(settings.classpath.value). |