Path: blob/master/elisp/emacs-for-python/flymake/python-flymake.el
990 views
;; Flymake configuration with python1(require 'tramp)23(when (load "flymake-patch" t)4(defun flymake-pyflakes-init ()5;; Pyflakes stuff6; Make sure it's not a remote buffer or flymake would not work7(when (not (subsetp (list (current-buffer)) (tramp-list-remote-buffers)))8(let* ((temp-file (flymake-init-create-temp-buffer-copy9'flymake-create-temp-inplace))10(local-file (file-relative-name11temp-file12(file-name-directory buffer-file-name))))13(list "pyflakes" (list local-file)))))141516(defun flymake-pep8-init ()17;; Pyflakes stuff18; Make sure it's not a remote buffer or flymake would not work19(when (not (subsetp (list (current-buffer)) (tramp-list-remote-buffers)))20(let* ((temp-file (flymake-init-create-temp-buffer-copy21'flymake-create-temp-inplace))22(local-file (file-relative-name23temp-file24(file-name-directory buffer-file-name))))25(list "pep8" (list local-file)))))262728(add-to-list 'flymake-allowed-file-name-masks29'("\\.py\\'" flymake-pyflakes-init)))3031;; Adding to the variable the regexps that matches warning messages32;;(setq flymake-log-level 3)3334(setq flymake-info-line-regex35(append flymake-info-line-regex '("unused$" "^redefinition" "used$")))36373839;; Not on all modes, please40(add-hook 'python-mode-hook 'flymake-find-file-hook)4142(provide 'python-flymake)434445