One of the problems I've been having is to get PHP-mode to work properly in Emacs 23. Apparently, it used to work properly in previous versions, but then the usual instructions on the net for installing php mode don't work properly.
As per the usual instructions, you should add the following code to the .emacs file in your home directory:
(add-to-list 'load-path "~/path/to/the/el/file/")
But turns out that Emacs 23 doesn't like that anymore and gives you an error:
Warning (initialization): An error occurred while loading `~/rishi/.emacs':
error: `c-lang-defconst' must be used in a file
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
To fix that, you're going to need to follow the instructions on this post.
Which essentially states that instead of putting the (require 'php-mode) line you should put this instead:
(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
Works for me!
Got a question, tip or comment? Send them to firstname.lastname@example.org and we'll try to answer it in a blog post!