I am running GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.3) and xhtml was working fine until I compiled it via the menu nXhtml -> nXhtml Help and Setup -> Byte Compile nXhtml. Now when opening .php files I am getting error "`c-lang-defconst'- must be used in a file".
My .emacs uses:
(load "~/.site-lisp/nxhtml/autostart.el")
The issue seems to be a problem with php-mode.el described here: http://stackoverflow.com/questions/898063/making-php-mode-compatible-with-emacs-23
Here is the complete backtrace:
Debugger entered--Lisp error: (error "`c-lang-defconst'- must be used in a file")
signal(error ("`c-lang-defconst' must be used in a file"))
error("`c-lang-defconst' must be used in a file")
c-define-lang-constant(c-mode-menu ((t cons ["Comment Out Region" comment-region ...] (cons ["Uncomment Region" ... ...] ...))))
require(cc-langs)
byte-code("ÀÁ!ÀÂ!ÀÃ!ÀÄ!ÀÅ!ÀÆ!ÀÇ!ÈÉÊËÌÍÎÏ&" [require add-log speedbar font-lock cc-mode cc-langs custom etags custom-declare-group php nil "Major mode `php-mode' for editing PHP code." :prefix "php-" :group languages] 8)
php-mode()
mumamo-fetch-major-mode-setup(php-mode nil nil nil nil)
mumamo-get-major-mode-setup(php-mode)
mumamo-end-in-code(6 485 php-mode)
mumamo-find-next-chunk-values(#<overlay from 1 to 1 in index.php> nil nil nil)
mumamo-find-chunks-1(1 "mumamo-turn-on-actions")
mumamo-find-chunks(1 "mumamo-turn-on-actions")
mumamo-turn-on-actions(fundamental-mode)
nxhtml-mumamo-mode()
set-auto-mode-0(nxhtml-mumamo-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer index.php> "~/work/grokcode/redesign2010/wordpress/wp-content/themes/twentyten/index.php" nil nil "~/work/grokcode/redesign2010/wordpress/wp-content/themes/twentyten/index.php" (2237325 2053))
find-file-noselect("/home/smudge/work/grokcode/redesign2010/wordpress/wp-content/themes/twentyten/index.php" nil nil nil)
find-file("/home/smudge/work/grokcode/redesign2010/wordpress/wp-content/themes/twentyten/index.php")
command-line-1(("index.php"))
command-line()
normal-top-level()
Thanks jess,
I have mailed the Emacs c mode maintainer and asked for some advice for how to fix this.