Emacs change file extension - mode association

后端 未结 3 1484
难免孤独
难免孤独 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:15

    Fortunately everything is working now and unfortunately I don't remember how I fixed it :) Maybe there was an error in my .emacs earlier. This is the more correct code:

    (add-to-list 'auto-mode-alist '("\\.m$" . octave-mode))
    

    Autoloading is unneeded in recent versions; if you do need to enable it, note that "octave-mode" is not a typo.

    (autoload 'octave-mode "octave-mod" nil t)
    

提交回复
热议问题