我试图将"Makefile.OSX“这样的文件名与makefile-mode联系起来。
我尝试过各种组合,例如:
(add-to-list 'auto-mode-alist '("\\^Makefile" . makefile-mode))
(add-to-list 'auto-mode-alist '("\\`Makefile" . makefile-mode))我该怎么做?
发布于 2017-10-20 06:27:57
作为auto-mode-alist的一部分指定的正则表达式与完整的路径名匹配,因此您的两个正则表达式都不会与任何内容匹配。
你可能想用这样的方法
(add-to-list 'auto-mode-alist '("Makefile.*\\'" . makefile-mode))或
(add-to-list 'auto-mode-alist '("/Makefile.*\\'" . makefile-mode))https://stackoverflow.com/questions/46840118
复制相似问题