From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neal Becker Newsgroups: gmane.emacs.help Subject: Re: Perfect python environment Date: Fri, 11 Sep 2009 19:23:51 -0400 Message-ID: References: <1252438710.3454.0.camel@coepsfest> <87eiqgbrgd.fsf@tux.homenetwork> <87eiqdfbfh.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1252711493 29642 80.91.229.12 (11 Sep 2009 23:24:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2009 23:24:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 12 01:24:46 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmFTx-0007Yo-P7 for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Sep 2009 01:24:46 +0200 Original-Received: from localhost ([127.0.0.1]:54182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmFTx-0001Zi-1Q for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Sep 2009 19:24:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmFTa-0001ZP-Qe for help-gnu-emacs@gnu.org; Fri, 11 Sep 2009 19:24:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmFTW-0001S0-2E for help-gnu-emacs@gnu.org; Fri, 11 Sep 2009 19:24:22 -0400 Original-Received: from [199.232.76.173] (port=42462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmFTV-0001Rx-SA for help-gnu-emacs@gnu.org; Fri, 11 Sep 2009 19:24:17 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:41579) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MmFTV-0003dF-8K for help-gnu-emacs@gnu.org; Fri, 11 Sep 2009 19:24:17 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MmFTT-0007RR-AP for help-gnu-emacs@gnu.org; Sat, 12 Sep 2009 01:24:15 +0200 Original-Received: from static-71-168-41-211.hag.east.verizon.net ([71.168.41.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Sep 2009 01:24:15 +0200 Original-Received: from ndbecker2 by static-71-168-41-211.hag.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Sep 2009 01:24:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Followup-To: gmane.emacs.help Original-Lines: 81 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: static-71-168-41-211.hag.east.verizon.net User-Agent: KNode/4.3.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68059 Archived-At: Thierry Volpiatto wrote: > Neal Becker writes: > >> 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-") >> 'anything-ipython-complete))) >> (add-hook 'ipython-shell-hook #'(lambda () >> (define-key py-mode-map (kbd "C-") >> 'anything-ipython-complete))) >> (require 'anything-show-completion) > > It seem your configuration of anything-ipython is wrong, be sure to read > carefully the instructions in anything-ipython.el. > I can't reproduce your error. > Here is my config: > > ,----[ Config thierry anything-ipython ] > | (require 'anything-ipython) > | (add-hook 'python-mode-hook #'(lambda () > | (define-key py-mode-map (kbd "M-") > | 'anything-ipython-complete))) > | (add-hook 'ipython-mode-hook #'(lambda () > | (define-key py-mode-map (kbd > | "M-") > | 'anything-ipython-complete))) > | > | (add-hook 'ipython-shell-hook #'(lambda () > | (define-key py-mode-map (kbd > | "M-") > | 'anything-ipython-complete))) > | (when (require 'anything-show-completion nil t) > | (use-anything-show-completion 'anything-ipython-complete > | '(length initial-pattern))) > | (define-key py-mode-map (kbd "C-c M") > | 'anything-ipython-import-modules-from-buffer) > `---- > > To have completion in python buffer (i.e in your python file, not the > shell) you have to start first the ipython interpreter, and then load > all the modules you have in your python file. > Load modules one by one in ipython interpreter or use from your file > C-c M (see above). > Be sure also to setup python-mode (PYTHON-MODE, not the bad one that > come with emacs) correctly. > Let me know if you have more problems. > It seems if I don't use C-c M then I get the traceback I showed. Also if there are no completions I get that assertion (Assertion failed: header- pos). For example: ----- import os os.fcn ----- Try to complete os.fcn gives that assertion. python-mode.el is 5.1.0. emacs is 23.1.1.