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.
To do what you want you need to put the correct regular expression in
auto-mode-alist.The following will do: