如何告诉 emacs 在 C++ 模式下打开 .h 文件? [英] How to tell emacs to open .h file in C++ mode?
本文介绍了如何告诉 emacs 在 C++ 模式下打开 .h 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该向我的 _emacs(在 Windows 上)文件中添加哪些行以使其在 C++ 模式下打开 .h 文件?默认为C模式.
What lines should I add to my _emacs (on Windows) file to have it open .h files in C++ mode? The default is C mode.
推荐答案
试试这个:
(add-to-list 'auto-mode-alist '("\.h\'" . c++-mode))
无论何时打开 .h 文件,都会使用 C++ 模式.
Whenever you open .h files, C++-mode will be used.
这篇关于如何告诉 emacs 在 C++ 模式下打开 .h 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文