Emacs start with a given mode
Solution 1:
Use the -eval
option to run whatever commands you want.
For example, this opens emacs in the terminal, opens a new named buffer, and switches to ruby-mode:
emacs -nw -eval '(progn (switch-to-buffer "new_script") (ruby-mode))"