[英]Emacs23 php-mode problem
在Ubuntu的Emacs23上使用php-mode時,我不斷收到此錯誤和類似錯誤:
Debugger entered--Lisp error: (void-function php-template-if-hook)
php-template-if-hook()
abbrev-insert(if #("if" 0 2 (fontified t face font-lock-keyword-face)) 414 416)
#[(G73404 funs global) "[Byte Code]"
apply(#[(G73404 funs global "[Byte Code]"
(lambda (&rest --cl-rest--) (apply #[... "[Byte Code]"
expand-abbrev()
self-insert-command(1)
c-electric-paren(nil)
call-interactively(c-electric-paren nil nil)
當我鍵入if(
,以及當我鍵入array(
或以array(
結尾的任何內容時出現以下錯誤,例如is_array(
:
Debugger entered--Lisp error: (void-function php-template-if-hook)
php-template-if-hook()
abbrev-insert(if #("if" 0 2 (fontified t face font-lock-keyword-face)) 414 416)
#[(G73404 funs global) "[Byte code]"
apply(#[(G73404 funs global "[Byte Code]"
(lambda (&rest --cl-rest--) (apply #[... "[Byte Code]"
expand-abbrev()
self-insert-command(1)
c-electric-paren(nil)
call-interactively(c-electric-paren nil nil)
即使使用emacs入門套件,也會引發此錯誤。 有人解決過類似的問題嗎?
我使用的php-mode.el來自emacs入門套件 ,該套件捆綁了一個nxhtml版本。 我嘗試使用php-mode-1.5.0仍然沒有成功。 我什至嘗試使用最新版本的nxhtml(2.2),但仍然存在相同的錯誤。 我必須復制並粘貼mewde缺少的所有函數定義,以使其相對合理地工作。 我不得不說,它確實增加了一些價值。 :)
有趣的是,這個問題對我來說似乎只是一個Ubuntu Karmic問題,我在opensuse 11.0和11.1的emacs上使用了相同的東西,而沒有一個問題。
謝謝。
問題是某些東西試圖調用未定義的函數'php-template-if-hook
。
如果您提供了一個指向正在使用的php-mode.el
的鏈接,這將很有用,因為似乎有多個 。
符號'php-template-if-hook
不是sourceforge上php-mode.el
的一部分,因此您使用的是其他版本,或者.emacs中存在其他導致問題的原因。 看起來好像是什么觸發了縮寫插入導致php-template-if-hook
。 注意: 看來堆棧溢出的人正在使用sourceforge的php-mode,所以我建議移至該模式。
谷歌快速搜索找到了php-mode.el
,它將'php-template-if-hook
定義為:
(defun php-template-if ()
"Insert an if statement."
(interactive)
(let ((start (point)))
(insert "if ")
(insert "(") ; +
(when (php-template-field "condition" nil t start (point))
(insert ") {") ; +
(newline-and-indent)
(setq start (point-marker))
(insert "\n}")
(php-indent-line-2)
(goto-char start))))
但是,通過從插管中剪切/粘貼隨機代碼來解決問題並不是一個好的長期解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.