I use Samuel Tonini’s Alchemist (and Elixir mode) to make myself much more productive with Elixir and Emacs. But one thing that I’ve found to be a minor annoyance is that whenever I start up Emacs I have to set the scratch buffer to be in Elixir mode and I then need to change the comment characters.

Thanks to this excellent tip I no longer have to do this. I’ve modified my ~/.emacs to add these lines to the bottom:

(setq initial-major-mode 'elixir-mode) (setq initial-scratch-message "\ # This buffer is for notes you don't want to save, and for Elixir code. # If you want to create a file, visit that file with C-x C-f, # then enter the text in that file's own buffer.")

And when I get a scratch buffer I’m all good to go with Elixir!