[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Perfect python environment
From: |
Neal Becker |
Subject: |
Re: Perfect python environment |
Date: |
Fri, 11 Sep 2009 07:50:54 -0400 |
User-agent: |
KNode/4.3.1 |
Thierry Volpiatto wrote:
> Hi, i never been able to install rope correctly also.
> even when installed, i found severe bugs that crash emacs (don't
> remember what it was).
>
> If you just want completion in python, consider using ipython as
> python-shell in emacs and use anything-python for completion.
> See:
>
> http://ipython.scipy.org/
> http://www.emacswiki.org/cgi-bin/emacs/PythonMode
> http://www.emacswiki.org/cgi-bin/emacs/anything-ipython.el
>
Thanks! I installed anything-ipython, and now in ipython shell, I have
completions.
I also added:
(add-hook 'python-mode-hook #'(lambda ()
(define-key py-mode-map (kbd "C-<tab>")
'anything-ipython-complete)))
(add-hook 'ipython-shell-hook #'(lambda ()
(define-key py-mode-map (kbd "C-<tab>")
'anything-ipython-complete)))
(require 'anything-show-completion)
But completions don't work in python buffer. Hitting C-<tab>, I am prompted
with "pattern:", then I get:
Debugger entered--Lisp error: (cl-assertion-failed header-pos)
signal(cl-assertion-failed (header-pos))
(or header-pos (signal (quote cl-assertion-failed) (list ...)))
(progn (or header-pos (signal ... ...)) nil)
(assert header-pos)
(save-excursion (assert header-pos) (goto-char header-pos) (buffer-
substring-no-properties (line-beginning-position) (line-end-position)))
(let* ((header-pos ...) (source-name ...)) (some (lambda ... ...)
(anything-get-sources)))
(save-current-buffer (set-buffer (anything-buffer-get)) (goto-char
(overlay-start anything-selection-overlay)) (let* (... ...) (some ... ...)))
(with-current-buffer (anything-buffer-get) (goto-char (overlay-start
anything-selection-overlay)) (let* (... ...) (some ... ...)))
(if (and (boundp ...) (stringp anything-source-name)) source (with-
current-buffer (anything-buffer-get) (goto-char ...) (let* ... ...)))
anything-get-current-source()
(or anything-saved-current-source (anything-get-current-source))
(let ((source ...)) (if (and ... ...) (setq selection "")) (setq display-
to-real (or display-to-real ... ...)) (if (and ... ...) (setq action ...))
(unless clear-saved-action (setq anything-saved-action nil)) (if (and
selection action) (anything-funcall-with-source source action ...)))
anything-execute-selection-action()
(unwind-protect (anything-execute-selection-action) (anything-aif (get-
buffer anything-action-buffer) (kill-buffer it)) (run-hooks (quote anything-
after-action-hook)))
(if anything-quit nil (unwind-protect (anything-execute-selection-action)
(anything-aif ... ...) (run-hooks ...)))
(unless anything-quit (unwind-protect (anything-execute-selection-action)
(anything-aif ... ...) (run-hooks ...)))
(let ((frameconfig ...) anything-source-name anything-in-persistent-action
anything-quit anything-follow-mode (case-fold-search t) (anything-buffer
...) (anything-sources ...)) (add-hook (quote post-command-hook) (quote
anything-check-minibuffer-input)) (add-hook (quote minibuffer-setup-hook)
(quote anything-print-error-messages)) (setq anything-current-position (cons
... ...)) (if any-resume (anything-initialize-overlays ...) (anything-
initialize)) (setq anything-last-buffer anything-buffer) (when any-input
(setq anything-input any-input anything-pattern any-input)) (anything-
display-buffer anything-buffer) (unwind-protect (progn ... ... ... ...)
(anything-cleanup) (remove-hook ... ...) (remove-hook ... ...) (anything-
set-frame/window-configuration frameconfig)) (unless anything-quit (unwind-
protect ... ... ...)))
(progn (let (... anything-source-name anything-in-persistent-action
anything-quit anything-follow-mode ... ... ...) (add-hook ... ...) (add-hook
... ...) (setq anything-current-position ...) (if any-resume ... ...) (setq
anything-last-buffer anything-buffer) (when any-input ...) (anything-
display-buffer anything-buffer) (unwind-protect ... ... ... ... ...) (unless
anything-quit ...)))
(unwind-protect (progn (let ... ... ... ... ... ... ... ... ... ...))
(loop for (var . value) in --orig-vars do (set var value)))
(let ((--orig-vars ...)) (unwind-protect (progn ...) (loop for ... in --
orig-vars do ...)))
(with-anything-restore-variables (let (... anything-source-name anything-
in-persistent-action anything-quit anything-follow-mode ... ... ...) (add-
hook ... ...) (add-hook ... ...) (setq anything-current-position ...) (if
any-resume ... ...) (setq anything-last-buffer anything-buffer) (when any-
input ...) (anything-display-buffer anything-buffer) (unwind-protect ... ...
... ... ...) (unless anything-quit ...)))
(condition-case v (with-anything-restore-variables (let ... ... ... ...
... ... ... ... ... ...)) (quit (setq minibuffer-history ...) (goto-char
...) (set-window-start ... ...) nil))
anything(anything-source-ipython "os.f")
(let ((initial-pattern ...)) (anything (quote anything-source-ipython)
initial-pattern))
anything-ipython-complete()
call-interactively(anything-ipython-complete nil nil)