Emacs change file extension - mode association

后端 未结 3 1471
难免孤独
难免孤独 2020-12-16 18:32

My Emacs opens .m files in ObjC mode. However I want to open them in Octave mode. I have already added to the .emacs file:

(autoload \'octave-mo         


        
3条回答
  •  温柔的废话
    2020-12-16 19:06

    Just ran into this exact problem. Your statement is correct, but your .emacs file probably isn't loading up correctly. Emacs searches the "HOME" variable to load up preferences, lisp code etc.

    To see what your HOME variable is:

    Open scratch buffer (this is a "play place" to try things out):

    C-x C-b *scratch* 
    

    Evaluate this expression by typing it, then putting the cursor to the right, then hitting C-x C-e

    insert (getenv "HOME")
    

    Emacs will display your home path at the bottom (mine defaulted to ...Documents and Settings\UserName) I haven't worked out a good way to change it, but you're supposed to be able to simply add HOME as an environment variable (that didn't work for me).

    It's also talked about a bit more over here: http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html

    Also remember that the file has to be ".emacs" and not myConfig.emacs or something of the like. Use bash command ren to rename the file (windows explorer won't let you have nameless files)

提交回复
热议问题