Ответ 1
Я столкнулся с той же проблемой при попытке запустить csharp-mode. Я, наконец, нашел решение при перекопании в фактический файл Emacs Lisp для режима csharp:
;; This code doesn't seem to work when you compile it, then
;; load/require in the Emacs file. You will get an error (error
;; "`c-lang-defconst' must be used in a file") which happens because
;; cc-mode doesn't think it is in a buffer while loading directly
;; from the init. However, if you call it based on a file extension,
;; it works properly. Interestingly enough, this doesn't happen if
;; you don't byte-compile cc-mode.
Таким образом, быстрое и грязное исправление для установки вашего .emacs - это автоматическая загрузка на расширение, а не размещение (require 'php-mode)
или (load "php-mode")
там. Без дальнейших церемоний,
(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))
Надеюсь, это поможет! Теперь мне просто нужно заставить работать режим переключения PHP/HTML. Желаю мне удачи.