1

By default, my Emacs opens config.php in conf-mode. It looks like conf-mode uses a set of regular expressions to match the filename, but I can't figure out how to make it open in php-mode.

Any idea?

Glorfindel
  • 234
  • 1
  • 5
  • 13
Rangi Lin
  • 987
  • 9
  • 15
  • That's because the entries for `conf-mode` come before the entries for `php-mode` in `auto-mode-alist`. – legoscia Feb 04 '15 at 11:07

1 Answers1

2

You can add an entry specifically for config.php into auto-mode-alist, as follows:

(add-to-list 'auto-mode-alist (cons (rx bos "config.php" eos) 'php-mode))

(Where bos and eos are shortcuts for string-start and string-end, abbreviated from Beginning/End Of String.)

TaylanKammer
  • 626
  • 5
  • 5