17 lines
691 B
EmacsLisp
17 lines
691 B
EmacsLisp
|
;; 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)
|
||
|
|
||
|
;; Bind RET to py-newline-and-indent
|
||
|
(add-hook 'python-mode-hook '(lambda ()
|
||
|
(define-key python-mode-map "\C-m" 'newline-and-indent)))
|