Emacs 更改文件扩展名 - 模式关联 [英] Emacs change file extension - mode association
本文介绍了Emacs 更改文件扩展名 - 模式关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 Emacs 以 ObjC 模式打开 .m 文件.但是我想以八度模式打开它们.我已经添加到 .emacs
文件中:
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-mode "octave-mod" nil t)
(setq auto-mode-alist (cons '("\.m$" . octave-mode) auto-mode-alist))
我还应该做什么?我确实安装了八度模式.
What else should I do? I do have Octave mode installed.
推荐答案
幸运的是现在一切正常,不幸的是我不记得我是如何修复它的 :) 也许我的 .emacs
早些时候.这是更正确的代码:
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))
在最近的版本中不需要自动加载;如果确实需要启用它,请注意 "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)
这篇关于Emacs 更改文件扩展名 - 模式关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文