PHP Mode for Emacs

Fic of the day: Wherever You Roam (SG-1, PG, AU), a short sequel to “A White Dove.”

I’ve always wondered why Emacs didn’t highlight my PHP code automagically. Today I was working on a site and decided enough was enough—I would find a way to get pretty PHP.

Fortunately, there’s a website devoted to this very issue: k-fish.de: Emacs & PHP. He said his favorite was the SourceForge PHP mode for Emacs project so I went with that. Here’s the .emacs code to autoload it:

    (autoload 'php-mode "php-mode" "Yay PHP" t)
    (setq auto-mode-alist (cons '(".php$" . php-mode)
       auto-mode-alist))
    (setq auto-mode-alist (cons '(".phps$" . php-mode)
       auto-mode-alist))

Comments are closed.