Emacs: How to use a major mode for non-standard file extension

心已入冬 提交于 2019-11-26 18:35:55

问题


I'd like to use R major mode for another file extension in emacs (for an unsupported language with syntax similar to R).

How do I force emacs to change the major mode for a buffer I'm editing? How do I change my .emacs to permanently associate a major mode with a particular file extension?


回答1:


This should work:

(add-to-list 'auto-mode-alist '("\\.rr" . R-mode))


来源:https://stackoverflow.com/questions/21661413/emacs-how-to-use-a-major-mode-for-non-standard-file-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!