Created
October 14, 2009 09:53
-
-
Save gregnewman/209934 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; Syntax Check using flymake and PyFlakes EMACS 23.x | |
| ;;; GUI Emacs 23.x on Mac OS X has problems respecting | |
| ;;; system paths so we have to add it manually with setq | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| (setq pyflakes "/usr/local/bin/pyflakes") | |
| (when (load "flymake" 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 pyflakes (list local-file)))) | |
| (add-to-list 'flymake-allowed-file-name-masks | |
| '("\\.py\\'" flymake-pyflakes-init))) | |
| (add-hook 'find-file-hook 'flymake-find-file-hook) | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; Syntax Check using flymake and PyFlakes NON-EMACS 23.x | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| (when (load "flymake" 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 "pyflakes" (list local-file)))) | |
| (add-to-list 'flymake-allowed-file-name-masks | |
| '("\\.py\\'" flymake-pyflakes-init))) | |
| (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