From matt at overlook.homelinux.net Mon Jun 5 15:30:52 2006 From: matt at overlook.homelinux.net (Matthew Wilson) Date: Mon, 5 Jun 2006 09:30:52 -0400 Subject: [Python-mode] tab-completion in ipython requires CR after TAB. Message-ID: <20060605133052.GA20197@mwilson.umlcoop.net> After learning the bare bones of emacs years ago, then switching to vim, I'm getting back into emacs because I hope that python-mode will better integrate the python interpreter and the editor. Anyhow, I got ipython running as my interpreter when I hit C-c !, and I switch buffers with C-x o. I really like how ipython does tab-completion, and shows all the member attributes of an object. However, when I try this in an ipython session inside emacs, I have to hit TAB followed by a carriage return. The TAB actually prints to the screen. Does anyone know how to prevent the tab from printing, and, how to not require hitting enter? TIA Matt -- Algorithms wiki: http://en.wikibooks.org/wiki/ComputerScience:Algorithms From edloper at gradient.cis.upenn.edu Wed Jun 7 03:56:12 2006 From: edloper at gradient.cis.upenn.edu (Edward Loper) Date: Tue, 06 Jun 2006 21:56:12 -0400 Subject: [Python-mode] tab-completion in ipython requires CR after TAB. In-Reply-To: References: Message-ID: <4486323C.2020903@gradient.cis.upenn.edu> > However, when I try this in an ipython session inside emacs, I have to > hit TAB followed by a carriage return. The TAB actually prints to the > screen. > > Does anyone know how to prevent the tab from printing, and, how to not > require hitting enter? A quick and dirty way might be to define something like: (defun py-electric-tab () (interactive) (comint-send-string "*Python*" "\t")) And then bind that to some key (e.g., alt-tab). If you wanted to bind it to tab itself (i.e., without a modifier like alt), then you'd need some magic to distinguish the use of tab to do indentation (in which case it should insert a tab in the buffer) from tab to do autocompletion. For a more principled way, perhaps look at the comint-dynamic-complete function, defined in comint.el [1]? -Edward [1] http://www.cs.indiana.edu/pub/scheme-repository/utl/comint.el From noreply at sourceforge.net Wed Jun 7 20:17:20 2006 From: noreply at sourceforge.net (SourceForge.net) Date: Wed, 07 Jun 2006 11:17:20 -0700 Subject: [Python-mode] [ python-mode-Bugs-1215039 ] eat 100% CPU when "Force full reparse" Message-ID: Bugs item #1215039, was opened at 2005-06-04 23:16 Message generated for change (Comment added) made by todddeluca You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1215039&group_id=86916 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Shixin Zeng (pupilzeng) Assigned to: Skip Montanaro (montanaro) Summary: eat 100% CPU when "Force full reparse" Initial Comment: it seems to come into a infinite loop, and I can't do anything but Ctrl+C to end emacs and all my datas were lost. It ocurred every time I type M-/ for code completion. my emacs is 23.0.0.1, checkout from the branch unicode-2 on April, 2, 2005 ---------------------------------------------------------------------- Comment By: Todd DeLuca (todddeluca) Date: 2006-06-07 14:17 Message: Logged In: YES user_id=1321242 Based on the previous comment by thimo, I investigated the "semantic" issue a little further. On my system the "semantic" stuff comes from the CEDET (http://cedet.sourceforge.net/ and http://cedet.sourceforge.net/semantic.shtml) site-lisp packages being loaded. One way to avoid loading these tools is to run emacs with the --no-site-file option. This fixes the freezing that was occurring in the code example I provided below. These site packages are common to all users, so I can not simply remove them from the system. If anyone has a more fine-grained way to do this, one that does not remove all site-lisp packages, feel free to share. Cheers, Todd DeLuca ---------------------------------------------------------------------- Comment By: Thimo Neubauer (thimo) Date: 2005-12-15 04:56 Message: Logged In: YES user_id=19572 As this bug bit me many times in the last days I've checked with a friend if he experiences the same: in his emacs (also Debian stable) there are no freezes. As he has no "semantic" installed but I do I'd guess that it is the culprit. BTW: the fixes in the patch mentioned on http://www.emacswiki.org/cgi-bin/wiki/PythonMode did not cure this bug. For reference: I'm using Emacs 21.4.1, python-mode 4.75, semantic 1.0beta3b ---------------------------------------------------------------------- Comment By: Mike (stormcoder) Date: 2005-12-07 12:39 Message: Logged In: YES user_id=446468 This occurs for me when there is a block (function, for, if, etc) that doesn't have a blank new line after it. As soon as the file is loaded, the CPU pegs and emacs freezes. ---------------------------------------------------------------------- Comment By: Todd DeLuca (todddeluca) Date: 2005-07-30 13:03 Message: Logged In: YES user_id=1321242 Ok, I've created a simple reproducible example. The following code consistently freezes if the last character in the file is '1'. If there is a newline following the '1', then everything is fine. if 1 < 2: # die here x = 1 It also freezes under the same condition if you replace the if statement with a for i in range(10): loop. The following file does NOT freeze even if the '1' is the last character in the file: x = 1 So perhaps it has something to do with the indentation. Everything seems to hinge on there being no characters following the last line of code. I tried putting spaces on the end of the 'x = 1' line and it still froze with a 'Force full reparse' message. Sometimes the 'Force full reparse' message is not displayed when it freezes, but I think that detail is insignificant. I hope these code snippets are helpful in debugging the problem. Thank y'all for producing and maintaining python-mode. Its coloring and indenting features have been very helpful to me, and I get the feeling I'm just scratching the surface. Cheers, Todd ---------------------------------------------------------------------- Comment By: Todd DeLuca (todddeluca) Date: 2005-07-30 12:29 Message: Logged In: YES user_id=1321242 I am having the same problem. It started happening around the time my box was upgraded to the new Debian stable release, Sarge. I am using version 4.75 of python-mode. The problem manifests seemingly randomly for me. It seems to happen more with short python files. I can not think of a long or old (pre-upgrade to sarge) python file where I've had this problem. I am not using M-/ (code completion). The problem may manifest when I hit return to go to a new line or when I hit backspace to unindent out of a block that I've just ended. I am using gnu emacs version 21.4.1 I am forced to kill from a different terminal to close my emacs, since I run it in the foreground of a terminal. Any suggestions for how to fix this problem would be greatly appreciated. It makes it nearly impossible to use python-mode when at any time emacs can freeze and loose all of my work (since my last save.) I'm sorry I have not been able to reproduce the problem consistently yet. If that is helpful I will attempt to do so. Best regards, Todd DeLuca P.S. some diagnostic info (a repeat of what was mentioned above): $ emacs --version GNU Emacs 21.4.1 from top command: 3440 td23 14 0 19336 18m 2900 R 99.9 0.5 16:05.32 emacs python-mode version (from C-c C-v): version $Revision: 4.75 $ ---------------------------------------------------------------------- Comment By: Shixin Zeng (pupilzeng) Date: 2005-06-09 07:39 Message: Logged In: YES user_id=1143754 M-: py-version RET "$Revision 4.63 $" I downloaded it from http://sourceforge.net/projects/python-mode, whose version was tagged as 1.0alpha Where can I get the version 4.75? I've tried write codes as you said: a.foo = 12 a. M-/ repeatly First: "py" Seconed: Force full parse and the problem occurred. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2005-06-09 07:04 Message: Logged In: YES user_id=44345 Hmmm... It's been years and years since Python-mode 1.0alpha was released, so I suspect you're looking in the wrong place for the version. We are currently at 4.75. You can get the current python-mode version by typing M-: py-version RET When I hit M-/ at the place you indicated, it completes with "c12". I have no idea why it chooses that completion, but it doesn't hang. It's not obvious to me what it should expand in this context. Did you have something in mind? If I change the code to ... a = A('abc') a.foo = 12 a. when I hit M-/ it properly expands to "a.foo" for me. Please try upgrading your python-mode. ---------------------------------------------------------------------- Comment By: Shixin Zeng (pupilzeng) Date: 2005-06-09 06:33 Message: Logged In: YES user_id=1143754 When I'm editing C source files in cc-mode, the problem doesn't occur ---------------------------------------------------------------------- Comment By: Shixin Zeng (pupilzeng) Date: 2005-06-09 05:44 Message: Logged In: YES user_id=1143754 OK, here's an example: #!/usr/bin/python class A: def __init__(self, name): self.name = name if __name__ == '__main__': a = A('abc') a.<------------- M-/ here, the bug can be reproduced the python-mode is 1.0alpha ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2005-06-06 23:19 Message: Logged In: YES user_id=44345 Can you provide an example Python file where this happens? Given that M-/ runs dabbrev-expand, I'm skeptical this has anything to do with python-mode. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2005-06-05 07:10 Message: Logged In: YES user_id=44345 What version of python-mode.el are you using? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1215039&group_id=86916 From kk103 at alpha.sesnet.soton.ac.uk Tue Jun 20 12:31:57 2006 From: kk103 at alpha.sesnet.soton.ac.uk (kk103 at alpha.sesnet.soton.ac.uk) Date: Tue, 20 Jun 2006 11:31:57 +0100 (BST) Subject: [Python-mode] python-mode $Revision: 4.70 $; Message-ID: <20060620103157.D4BF9FE9D@alphabeta.sesnet.soton.ac.uk> Dear Barry, Emacs : XEmacs 21.4 (patch 17) "Jumbo Shrimp" [Lucid] (i386-debian-linux, Mule) of Tue Feb 8 2005 on penell Package: python-mode $Revision: 4.70 $