2013-04-09 16 views
1

我嘗試G642.44各級pylint的和PEP8到我emacs24.2,通過一些代碼,就像在我的(require 'python-pep8)(require 'python-pylint) .emacs.But我得到了錯誤,如下圖所示: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 

這似乎是定義編譯模式沒有定義。任何想法?

+0

有大量的pylint/pep8 lisp文件在四周浮動。與pylint(並在梅爾帕可用)來的那個沒有這個問題。寫這篇文章的人也寫了一個pep8幫手,它的工作原理也一樣(https://gist.github.com/ieure/302847)。 – jpkotta 2013-04-09 15:13:22

+0

@jpkotta主要幫手在第一條評論中有相同的投訴。 – Dmitry 2013-04-09 16:25:22

+0

糟糕。我想我在我的版本中解決了這個問題並忘記了。在pylint中的那個是可以的。主旨不是。 – jpkotta 2013-04-15 22:23:17

回答

3

貌似python-pep8.el缺少

(require 'compile) 

在頂部。

+0

謝謝@Dmitry。有用!!但我仍然不知道爲什麼命令很重要。可能我需要找到一些有關emacs lisp的知識來了解更多〜無論如何,感謝您的大力幫助! – zhkzyth 2013-04-10 03:20:53

+0

什麼順序?在這種情況下,其原理與大多數其他語言相同:要使用某些包的功能,您需要導入它。 – Dmitry 2013-04-10 03:29:06

0

我有同樣的問題,在我的情況PEP8在的.emacs

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

註釋掉當我刪除註釋出了問題已得到修復,似乎pylint的需要PEP8。

(require 'python-pep8) 
(require 'python-pylint) 
相關問題