Skip to content

Instantly share code, notes, and snippets.

@slinkp
Created July 29, 2013 17:36
Show Gist options
  • Save slinkp/6106047 to your computer and use it in GitHub Desktop.
Save slinkp/6106047 to your computer and use it in GitHub Desktop.
.emacs config snippet for wiring up pep8 and pyflakes to flymake, via an external script.
(when (load "flymake" t)
;; For Python, I use pyflakes combined with pep8 via a little script
;; that mashes them up. Might want to try flake8 (see pypi) ... it
;; adds a complexity checker.
(defun flymake-pyflakespep8-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 "pyflakespep8.py" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakespep8-init))
(add-hook 'find-file-hook 'flymake-find-file-hook)
;; This is an add-on I keep in my ~/.emacs.d/ directory which
;; ... "makes flymake error messages appear in the minibuffer
;; when point is on a line containing a flymake error. This
;; saves having to mouse over the error, which is a keyboard
;; user's annoyance". See http://www.emacswiki.org/emacs/flymake-cursor.el
(load-library "flymake-cursor")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment