hvesalai/scala-mode2 — pull request #42 by http-418 (2012-12-08 21:27:08+00:00)
Title: Consider bash preambles a comment

Heikki, I discovered that scala-mode2 doesn't handle bash preambles on scala scripts very gracefully. To use the example from [scala-lang.org](http://www.scala-lang.org/node/166):

```scala
#!/bin/sh
exec scala "$0" "$@"
!#
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world! " + args.toList)
}
}
HelloWorld.main(args)
```

Arbitrary bash code goes between the #! and !# marks. This allows scala scripts to be run directly on the command line with environment variables set correctly.

It was a two line change to the syntax table to make scala-mode2 consider bash blocks to be a comment. I am not much of an elisp guy, so I hope the syntax table was the right way to do this.