Emacs 如何在打开.h文件时自动进入C++模式?

Emacs 如何在打开.h文件时自动进入C++模式?,emacs,Emacs,如何在打开.h文件时自动进入C++模式 我在2月6日使用了emacs23.2 我打开.cpp文件时使用C-x C-f xxx.h。这在美学上可能会更好 (setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist)) (add-to-list 'auto-mode-alist (cons "\\.h\\'" 'c++-mode)) 也许这在美学上会更好 (add-to-list 'auto-mode-alist (cons

如何在打开.h文件时自动进入C++模式

我在2月6日使用了emacs23.2


我打开.cpp文件时使用C-x C-f xxx.h。

这在美学上可能会更好

(setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))
(add-to-list 'auto-mode-alist (cons "\\.h\\'" 'c++-mode))

也许这在美学上会更好

(add-to-list 'auto-mode-alist (cons "\\.h\\'" 'c++-mode))