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?

1
  • That's because the entries for conf-mode come before the entries for php-mode in auto-mode-alist. Commented Feb 4, 2015 at 11:07

1 Answer 1

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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.