Reputation: 2030
Basically, I've been trying nXhtml mode, and it's terribly slow and buggy in Emacs 24.
I'm working with PHP files. I'd like to load most files with *.php
as php-mode
, but if a file I'm visiting is in a '/templates'
or '/views'
folder, load the file in html-mode
.
Renaming the files or changing the project structure are not options. I am using 24.1.1. I'm sure this is possible, so a decent pseudo-code solution that points in the right direction will be accepted.
Upvotes: 1
Views: 152
Reputation: 9262
To do what you want you need to put the correct regular expression in auto-mode-alist
.
The following will do:
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode))
(add-to-list 'auto-mode-alist '("/\\(templates\\|views\\)/.*\\.php\\'" . html-mode))
Upvotes: 6