pylint和pep8不能与emacs24.2一起使用?

pylint和pep8不能与emacs24.2一起使用?,emacs,pylint,pep8,Emacs,Pylint,Pep8,我试图通过.emacs中的(require'python-pep8)和(require'python-pylint)等代码将pylint和pep8集成到emacs24.2中,但我得到了如下错误: Debugger entered--Lisp error: (void-function define-compilation-mode) (define-compilation-mode python-pep8-mode "PEP8" (setq python-pep8-last-buffer

我试图通过.emacs中的
(require'python-pep8)
(require'python-pylint)
等代码将pylint和pep8集成到emacs24.2中,但我得到了如下错误:

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
调试器已输入--Lisp错误:(void函数定义编译模式)
(定义编译模式python-pep8-mode“pep8”(setq python-pep8-last-buffer(当前缓冲区))(set(生成局部变量(引用编译错误regexp-alist))python-pep8-regexp-alist)(set(生成局部变量(引用编译禁用输入))t))
eval缓冲区(#nil)/home/zhkzyth/.emacs.d/non#u forked/python-pep8.el“nil t);缓冲器位置2399处的读数
使用代码转换加载(“/home/zhkzyth/.emacs.d/non_-forked/python-pep8.el”“/home/zhkzyth/.emacs.d/non_-forked/python-pep8.el”nil-nil)
加载(“非分叉/python-pep8”)
评估缓冲区(#nil)/home/zhkzyth/.emacs.d/zhkzyth.el“nil t);缓冲器位置1353处的读数
通过代码转换加载(“/home/zhkzyth/.emacs.d/zhkzyth.el”“/home/zhkzyth/.emacs.d/zhkzyth.el”无-无)
荷载(“zhkzyth”)
评估缓冲区(#nil)/home/zhkzyth/.emacs“nil t);缓冲器位置56处的读数
使用代码转换加载(“/home/zhkzyth/.emacs”“/home/zhkzyth/.emacs”t)
荷载(“~/.emacs”t)
#[0 "\205\262

似乎没有定义定义编译模式。有什么想法吗?

看起来像是
python-pep8.el
缺少一个

(require 'compile)

在顶部。

我也有同样的问题,在我的例子中,pep8在.emacs中被注释掉了

;;(require 'python-pep8)
(require 'python-pylint)
当我删除注释时,问题已经解决,似乎pylint需要pep8

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

有许多pylint/pep8 lisp文件在浮动。pylint附带的一个文件(在melpa中提供)没有这个问题。编写它的人还编写了一个pep8帮助程序,它也可以正常工作()“@jpkotta,gist中的助手在第一条评论中也有同样的抱怨。哎呀。我想我在我的版本中解决了这个问题,但忘了。pylint中的那个还可以。gist没有。谢谢@Dmitry。它很有效!!但我仍然不知道为什么这个顺序很重要。我需要找一些关于emacs lisp的tut来了解更多信息吗~无论如何,谢谢你的大力帮助!什么顺序?在这种情况下,原理与大多数其他语言相同:要使用某些包的函数,需要导入它。