Skip to content

Instantly share code, notes, and snippets.

@ericflo
Created July 10, 2009 20:39
Show Gist options
  • Save ericflo/144798 to your computer and use it in GitHub Desktop.
Save ericflo/144798 to your computer and use it in GitHub Desktop.
(when (load "flymake" t)
(load "flymake-cursor" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/PATH/TO/YOUR/pyflakes" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakes-init))
(add-hook 'python-mode-hook 'flymake-mode)
(mapc (lambda (x)
(when (equal (car x) "\\.html?\\'")
(delete x flymake-allowed-file-name-masks)))
flymake-allowed-file-name-masks))
(add-hook 'find-file-hook 'flymake-find-file-hook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment