1

我尝试将 pylint 和 pep8 集成到我的 emacs24.2 中,通过一些代码,例如(require 'python-pep8)(require 'python-pylint)我的 .emacs 中。但我得到了如下所示的错误:

Debugger entered--Lisp error: (void-function define-compilation-mode)
   (define-compilation-mode python-pep8-mode "PEP8" (setq python-pep8-last-buffer (current-buffer)) (set (make-local-variable (quote compilation-error-regexp-alist)) python-pep8-regexp-alist) (set (make-local-variable (quote compilation-disable-input)) t))
   eval-buffer(#<buffer  *load*<3>> nil "/home/zhkzyth/.emacs.d/non_forked/python-pep8.el" nil t)  ; Reading at buffer position 2399
   load-with-code-conversion("/home/zhkzyth/.emacs.d/non_forked/python-pep8.el" "/home/zhkzyth/.emacs.d/non_forked/python-pep8.el" nil nil)
 load("non_forked/python-pep8")
 eval-buffer(#<buffer  *load*<2>> nil "/home/zhkzyth/.emacs.d/zhkzyth.el" nil t)  ; Reading at buffer position 1353
 load-with-code-conversion("/home/zhkzyth/.emacs.d/zhkzyth.el" "/home/zhkzyth/.emacs.d/zhkzyth.el" nil nil)
 load("zhkzyth")
 eval-buffer(#<buffer  *load*> nil "/home/zhkzyth/.emacs" nil t)  ; Reading at buffer position 56
 load-with-code-conversion("/home/zhkzyth/.emacs" "/home/zhkzyth/.emacs" t t)
 load("~/.emacs" t t)
 #[0 "\205\262

似乎未定义定义编译模式。知道吗?

4

2 回答 2

3

好像python-pep8.el少了一个

(require 'compile)

在顶部。

于 2013-04-09T12:02:49.503 回答
0

我有同样的问题,在我的情况下 pep8 在 .emacs 中被注释掉了

;;(require 'python-pep8)
(require 'python-pylint)

当我删除注释时,问题已得到解决,似乎 pylint 需要 pep8。

(require 'python-pep8)
(require 'python-pylint)
于 2013-11-01T10:15:46.307 回答