Question

i try to intergrate pylint and pep8 into my emacs24.2, via some code like (require 'python-pep8) and (require 'python-pylint) in my .emacs.But i got the error as shown below:

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

It seems like the define-compilation-mode is not defined.Any idea ?

Was it helpful?

Solution

Looks like python-pep8.el is missing a

(require 'compile)

at the top.

OTHER TIPS

I had the same problem, in my case pep8 was commented out in .emacs

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

When I remove the comment out the problem has been fixed, seems pylint requires pep8.

(require 'python-pep8)
(require 'python-pylint)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top