rendered paste body;; enable eldoc (intellisensish help)
(add-hook 'python-mode-hook
'(lambda () (eldoc-mode 1)) t)
;; enabled automatic pylinting
(add-hook 'python-mode-hook
'(lambda () (flymake-mode 1)) t)
;; enabled spell checking of python comments and strings
(add-hook 'python-mode-hook
'(lambda () (flyspell-prog-mode)) t)
;; enter -> newline and indent
(add-hook 'python-mode-hook
'(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))
;; don't indent using tabs
(add-hook 'python-mode-hook
'(lambda ()
"Turn off Indent Tabs mode."
(set (make-local-variable 'indent-tabs-mode) nil)))
;; from http://www.emacswiki.org/cgi-bin/wiki/PythonMode
(when (load "flymake" t)
(defun flymake-pylint-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 "epylint" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))