X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=python%2Finit_python.el;h=1ba4818261ca72e18e4c63cb89602d38d711722e;hb=9a4a775a68095b49cb14e785a0ccfc6b24849109;hp=86f8d114af1731090b804562b6c626b809723da4;hpb=4ef831f9faaf8ca7ee36ca656c0d511be00ae1bc;p=emacs-init.git diff --git a/python/init_python.el b/python/init_python.el index 86f8d11..1ba4818 100644 --- a/python/init_python.el +++ b/python/init_python.el @@ -4,6 +4,7 @@ ;(require 'python-mode) ;(provide 'python) ;(provide 'python21) +(require 'python) ;; pymacs (autoload 'pymacs-apply "pymacs") @@ -24,6 +25,8 @@ (define-key ropemacs-local-keymap "\M-/" 'hippie-expand) +(global-unset-key "\C-xpn") + (defun write-file-py-cleanup-imports () (save-excursion (condition-case nil @@ -73,6 +76,12 @@ (flymake-goto-next-error) (my-flymake-show-error)) +(defun my-flymake-goto-prev-error () + (interactive) + (my-flymake-check-and-wait) + (flymake-goto-prev-error) + (my-flymake-show-error)) + (defun py-find-file (errormark filename defaultdir) (let ((fullname (expand-file-name filename defaultdir))) (or (and (not (file-exists-p fullname)) @@ -116,6 +125,8 @@ (progn (set (make-local-variable 'py-eshell-last-error) (point)) (set (make-local-variable 'py-eshell-prefix) (or (match-string 1) "")) + (if (string-match "Original $" py-eshell-prefix) + (setq py-eshell-prefix (substring py-eshell-prefix 0 (match-beginning 0)))) (if example (forward-line 2) (while (and (< (forward-line 1) 1) (looking-at (concat py-eshell-prefix " "))))) @@ -206,6 +217,7 @@ (define-key python-mode-map "\C-ci" 'my-pyflymake-add-import-from-error) (define-key python-mode-map "\C-ce" 'my-flymake-show-error) (define-key python-mode-map "\C-cn" 'my-flymake-goto-next-error) + (define-key python-mode-map "\C-cp" 'my-flymake-goto-prev-error) (define-key python-mode-map "\C-cI" 'py-cleanup-imports) ) @@ -291,6 +303,7 @@ (local-file (file-relative-name temp-file (file-name-directory buffer-file-name)))) + (message "flymake init pyflakes %s" local-file) (list "pyflakes" (list local-file)))) (add-to-list 'flymake-allowed-file-name-masks '("\\.py\\'" flymake-pyflakes-init)))