1
votes

I have created my own major mode in emacs for editing certain files. I would like to select this mode from the command line (the mode works fine if I auto-load it from within my Emacs init file (~/.emacs). I have tried the following (see How can I start different mode with Emacs in command line? ) :

emacs -f my-mode file &

but nothing happens. (I have stored my mode file in ~/emacs/my-mode.el.)

(I have also tried emacs -f matlab-mode file just to see if there is something wrong with my particular mode file, but I do not get matlab-mode either)

I am using GNU Emacs 23.3.1 on Ubuntu 12.04.

1
Note that you did run the function you specified; just not in the buffer you wanted to run it in. Check the *scratch* buffer.phils

1 Answers

2
votes

The order of arguments matters. This works for me:

emacs test.org -f c++-mode &