32 lines
1.2 KiB
EmacsLisp
32 lines
1.2 KiB
EmacsLisp
|
(setq ropemacs-global-prefix "C-x /") ;; avoid conflict with p4 global prefix
|
||
|
(require 'pymacs (concat user-extensions-directory "pymacs.el"))
|
||
|
(defun setup-ropemacs ()
|
||
|
(pymacs-load "ropemacs" "rope-")
|
||
|
;; Stops from erroring if there's a syntax err
|
||
|
(setq ropemacs-codeassist-maxfixes 3)
|
||
|
;; Configurations
|
||
|
(setq ropemacs-guess-project t)
|
||
|
(setq ropemacs-enable-autoimport t)
|
||
|
(setq ropemacs-autoimport-modules '("os" "shutil" "sys" "logging"))
|
||
|
;; Adding hook to automatically open a rope project if there is one
|
||
|
;; in the current or in the upper level directory
|
||
|
(add-hook 'python-mode-hook
|
||
|
(lambda ()
|
||
|
(cond ((file-exists-p ".ropeproject")
|
||
|
(rope-open-project default-directory))
|
||
|
((file-exists-p "../.ropeproject")
|
||
|
(rope-open-project (concat default-directory "..")))
|
||
|
)))
|
||
|
)
|
||
|
|
||
|
(eval-after-load 'python
|
||
|
'(progn
|
||
|
;; Ropemacs Configuration
|
||
|
(setup-ropemacs)
|
||
|
;; Not on all modes, please
|
||
|
;; Be careful of mumamo, buffer file name nil
|
||
|
(add-hook 'python-mode-hook (lambda () (if (buffer-file-name)
|
||
|
(flymake-mode))))
|
||
|
)
|
||
|
)
|