Updated the code from https://github.com/scala/scala-dist/tree/master/tool-support/src/emacs