From marc.massar at gmail.com Thu Apr 1 18:38:00 2010 From: marc.massar at gmail.com (Marc Massar) Date: Thu, 1 Apr 2010 12:38:00 -0400 Subject: [Python-mode] problem with Python <==> emacs communication (On solaris, both emacs & xemacs) Message-ID: Hi, I have some problems using py-shell or running python in a shell in emacs (under solaris). I wonder if someone would have an idea of what is happening. Some things work, some don't. I'll try to give as many details as I can. The problem: The issue is that py-shell does not return doing some command. E.g. I will get: Python 2.6 (r26:66714, Dec 23 2009, 15:54:18) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print 'asdf' and the point will stay at the line below the >>>. If I C-c C-c, I get >>> print 'asdf' C-c C-c KeyboardInterrupt >>> and I can try again. Typing quit() does not do anything, but sending an EOF (C-c C-d) kills the python process. I get the same behavior when running python from the command line from a shell within emacs (M-x shell). Using python -i, or python -u does n to help. But my setup is not completely bad, many things work: - Out of emacs, python works fine. - Inside a M-x shell: python -c "print 'asd' " works. - If I do not have a py-shell, then py-execute-buffer and py-execute-region work. If I have a py-shell open, then in the shell I get >>> ## working on region in file /tmp/python-26710Kvg.py... and no output. - py-execute-string does not seem to work: no matter what string I give it (even junk), I don't get any output; inthe minibuffer I get a message: (Shell command succeeded with no output) - run-python (the python shell from python.el) works fine. All these these have been done with emacs 23.1.1 and xemacs 21.4, both run with -q, and loading python-mode.el manually (to be sure that it is not my .emacs settup the is messing things up). Any help in solving this issue would be appreciated. Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.roehler at online.de Sat Apr 3 11:28:55 2010 From: andreas.roehler at online.de (Andreas Roehler) Date: Sat, 03 Apr 2010 11:28:55 +0200 Subject: [Python-mode] problem with Python <==> emacs communication (On solaris, both emacs & xemacs) In-Reply-To: References: Message-ID: <4BB70A57.7040302@online.de> Marc Massar wrote: > Hi, > > I have some problems using py-shell or running python in a shell in > emacs (under solaris). I wonder if someone would have an idea of what is > happening. Some things work, some don't. I'll try to give as many > details as I can. > > The problem: > > The issue is that py-shell does not return doing some command. E.g. I > will get: > Python 2.6 (r26:66714, Dec 23 2009, 15:54:18) > [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> print 'asdf' > > > and the point will stay at the line below the >>>. If I C-c C-c, I get >>>> print 'asdf' > C-c C-c > KeyboardInterrupt >>>> > > and I can try again. Typing quit() does not do anything, but sending an > EOF (C-c C-d) kills the python process. > > I get the same behavior when running python from the command line from a > shell within emacs (M-x shell). Using python -i, or python -u does n to > help. > > > But my setup is not completely bad, many things work: > - Out of emacs, python works fine. > - Inside a M-x shell: python -c "print 'asd' " works. > - If I do not have a py-shell, then py-execute-buffer and > py-execute-region work. If I have a py-shell open, then in the shell I get >>>> ## working on region in file /tmp/python-26710Kvg.py... > and no output. > - py-execute-string does not seem to work: no matter what string I give > it (even junk), I don't get any output; inthe minibuffer I get a > message: (Shell command succeeded with no output) > - run-python (the python shell from python.el) works fine. > Hi, would assume something coming across between python.el and python-mode.el Make sure, python-mode.el is loaded. > All these these have been done with emacs 23.1.1 and xemacs 21.4, both > run with -q, and loading python-mode.el manually (to be sure that it is > not my .emacs settup the is messing things up). > > Any help in solving this issue would be appreciated. > > Marc > M-x py-shell here calls IPython ... -- An enhanced Interactive Python. which is a great tool IMHO but needs being installed. Maybe installing it delivers a work-around for your problem too? https://launchpad.net/ipython Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/ From andreas.roehler at easy-emacs.de Wed Apr 14 08:02:29 2010 From: andreas.roehler at easy-emacs.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Wed, 14 Apr 2010 08:02:29 +0200 Subject: [Python-mode] [Fwd: Python auto-completion without pymacs] Message-ID: <4BC55A75.1030702@easy-emacs.de> An embedded message was scrubbed... From: Andrea Crotti Subject: Python auto-completion without pymacs Date: Tue, 13 Apr 2010 13:45:08 +0200 Size: 4078 URL: From andreas.roehler at online.de Fri Apr 16 11:27:42 2010 From: andreas.roehler at online.de (Andreas Roehler) Date: Fri, 16 Apr 2010 11:27:42 +0200 Subject: [Python-mode] py-goto-block-up Message-ID: <4BC82D8E.3050207@online.de> Hi Barry, trying to keep some experimental implementations synced semantically, I'm stumbling about the following: py-goto-block-up (&optional nomark) "Move up to start of current block. Go to the statement that starts the smallest enclosing block; roughly speaking, this will be the closest preceding statement that ends with a colon and is indented less than the statement you started on.... " IMHO it should rather be named into something like `py-goto-beginning-of-block' while `py-goto-block-up' indicates a higher level. (?) Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/ From esj at harvee.org Fri Apr 16 16:03:17 2010 From: esj at harvee.org (Eric S. Johansson) Date: Fri, 16 Apr 2010 10:03:17 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <4BC82D8E.3050207@online.de> References: <4BC82D8E.3050207@online.de> Message-ID: <4BC86E25.7050701@harvee.org> On 4/16/2010 5:27 AM, Andreas Roehler wrote: > > Hi Barry, > > trying to keep some experimental implementations synced > semantically, I'm stumbling about the following: > > py-goto-block-up (&optional nomark) > "Move up to start of current block. > Go to the statement that starts the smallest enclosing block; roughly > speaking, this will be the closest preceding statement that ends with a > colon and is indented less than the statement you started on.... > " > > IMHO it should rather be named into something like > `py-goto-beginning-of-block' > > while `py-goto-block-up' indicates a higher level. excellent. do need to work on the naming a bit. As this is two dimensional navigation. Previous and next four blocks earlier and later the file and in versus out for nesting depth. block-out block-in block-previous block-next block-previous-out block-previous-in block-next-out block-next-in the first two (block-in/out) would navigate strictly on indentation. the second two, navigate strictly on blocks independent of indentation. For example, if you have three blocks at the same level, it will go to the previous block and not the fourth block which is outdented. The third pair previous-out/in navigates to the previous block that is either outdented or indented respectively. The third pair next out/in navigates to the next block that is either outdented or indented respectively. one additional level of usefulness would be to not just do a go to but also do a push to so you can return to where you had left off. Personally, I moving the mouse or pen to point to the right word, expression or whatever and say something like " [count] " Might be a bit rough to deal with if you are not talking to your computer (even if you are saying *%*^%^$%) but it's a good starting point for navigational functionality for programming. From marc.massar at gmail.com Fri Apr 16 19:04:24 2010 From: marc.massar at gmail.com (Marc Massar) Date: Fri, 16 Apr 2010 13:04:24 -0400 Subject: [Python-mode] problem with Python <==> emacs communication (On solaris, both emacs & xemacs) In-Reply-To: <4BB70A57.7040302@online.de> References: <4BB70A57.7040302@online.de> Message-ID: Hi, After passing some time comparing how python-mode.el and python.el create the Python interpreter, I figured out that if I (setq process-connection-type nil) in python-mode-hook, then everything work fine. Marc On Sat, Apr 3, 2010 at 5:28 AM, Andreas Roehler wrote: > Marc Massar wrote: > > Hi, > > > > I have some problems using py-shell or running python in a shell in > > emacs (under solaris). I wonder if someone would have an idea of what is > > happening. Some things work, some don't. I'll try to give as many > > details as I can. > > > > The problem: > > > > The issue is that py-shell does not return doing some command. E.g. I > > will get: > > Python 2.6 (r26:66714, Dec 23 2009, 15:54:18) > > [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> print 'asdf' > > > > > > and the point will stay at the line below the >>>. If I C-c C-c, I get > >>>> print 'asdf' > > C-c C-c > > KeyboardInterrupt > >>>> > > > > and I can try again. Typing quit() does not do anything, but sending an > > EOF (C-c C-d) kills the python process. > > > > I get the same behavior when running python from the command line from a > > shell within emacs (M-x shell). Using python -i, or python -u does n to > > help. > > > > > > But my setup is not completely bad, many things work: > > - Out of emacs, python works fine. > > - Inside a M-x shell: python -c "print 'asd' " works. > > - If I do not have a py-shell, then py-execute-buffer and > > py-execute-region work. If I have a py-shell open, then in the shell I > get > >>>> ## working on region in file /tmp/python-26710Kvg.py... > > and no output. > > - py-execute-string does not seem to work: no matter what string I give > > it (even junk), I don't get any output; inthe minibuffer I get a > > message: (Shell command succeeded with no output) > > - run-python (the python shell from python.el) works fine. > > > > > Hi, > > would assume something coming across between python.el and python-mode.el > > Make sure, python-mode.el is loaded. > > > > All these these have been done with emacs 23.1.1 and xemacs 21.4, both > > run with -q, and loading python-mode.el manually (to be sure that it is > > not my .emacs settup the is messing things up). > > > > Any help in solving this issue would be appreciated. > > > > Marc > > > > M-x py-shell here calls > > IPython ... -- An enhanced Interactive Python. > > which is a great tool IMHO but needs being installed. > > Maybe installing it delivers a work-around for your problem too? > > https://launchpad.net/ipython > > > Andreas > > -- > https://code.launchpad.net/~a-roehler/python-mode > https://code.launchpad.net/s-x-emacs-werkstatt/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry at python.org Fri Apr 16 20:27:28 2010 From: barry at python.org (Barry Warsaw) Date: Fri, 16 Apr 2010 14:27:28 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <4BC82D8E.3050207@online.de> References: <4BC82D8E.3050207@online.de> Message-ID: <20100416142728.0f25bf6c@heresy> On Apr 16, 2010, at 11:27 AM, Andreas Roehler wrote: >trying to keep some experimental implementations synced >semantically, I'm stumbling about the following: > >py-goto-block-up (&optional nomark) > "Move up to start of current block. >Go to the statement that starts the smallest enclosing block; roughly >speaking, this will be the closest preceding statement that ends with a >colon and is indented less than the statement you started on.... >" > >IMHO it should rather be named into something like >`py-goto-beginning-of-block' > >while `py-goto-block-up' indicates a higher level. Sure, I think this renaming makes sense. FWIW, I rarely use this command. ;) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From esj at harvee.org Sat Apr 17 04:56:32 2010 From: esj at harvee.org (Eric S. Johansson) Date: Fri, 16 Apr 2010 22:56:32 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <20100416142842.532bfd8a@heresy> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> <20100416142842.532bfd8a@heresy> Message-ID: <4BC92360.2060905@harvee.org> On 4/16/2010 2:28 PM, Barry Warsaw wrote: > On Apr 16, 2010, at 10:03 AM, Eric S. Johansson wrote: > I dunno. If it's useful to people sure, but I doubt I'd use them much. > Sometimes it's just quicker to use C-n and C-p y'know? :) well duh, if you have working hands it certainly is easier. like some of my similarly disabled brethren and cistern[sic], I find it far easier to move the mouse into the vicinity and then tell to do what I want to do. For example, go to hear or push to hear is far easier than saying move up three lines and then move lost for words. After series of commands like that, I expect to hear "you sunk my battleship". At the same time, looking at the output of a Python stack trace, saying "go to line three five zero" is far easier than scrolling or paging. User interfaces aren't easy. Especially when people deviate from capabilities and endurance of a 20-year-old. From andreas.roehler at online.de Sat Apr 17 11:38:05 2010 From: andreas.roehler at online.de (Andreas Roehler) Date: Sat, 17 Apr 2010 11:38:05 +0200 Subject: [Python-mode] py-goto-block-up In-Reply-To: <20100416142728.0f25bf6c@heresy> References: <4BC82D8E.3050207@online.de> <20100416142728.0f25bf6c@heresy> Message-ID: <4BC9817D.9040200@online.de> Barry Warsaw wrote: > On Apr 16, 2010, at 11:27 AM, Andreas Roehler wrote: > >> trying to keep some experimental implementations synced >> semantically, I'm stumbling about the following: >> >> py-goto-block-up (&optional nomark) >> "Move up to start of current block. >> Go to the statement that starts the smallest enclosing block; roughly >> speaking, this will be the closest preceding statement that ends with a >> colon and is indented less than the statement you started on.... >> " >> >> IMHO it should rather be named into something like >> `py-goto-beginning-of-block' >> >> while `py-goto-block-up' indicates a higher level. > > Sure, I think this renaming makes sense. OK, thanks. So I'll make a branch. FWIW, I rarely use this command. ;) > > -Barry I'm reflecting a set of commands following example of paredit.el's Depth-Changing Commands etc. http://mumble.net/~campbell/emacs/paredit/paredit.html Things like `paredit-splice-sexp-killing-backward' Just saying "block" where paredit.el says "list". Andreas From barry at python.org Mon Apr 19 22:23:15 2010 From: barry at python.org (Barry Warsaw) Date: Mon, 19 Apr 2010 16:23:15 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <4BC92360.2060905@harvee.org> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> <20100416142842.532bfd8a@heresy> <4BC92360.2060905@harvee.org> Message-ID: <20100419162315.7637ef45@heresy> On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote: >User interfaces aren't easy. Especially when people deviate from capabilities >and endurance of a 20-year-old. Trust me, I am very deviant from the capabilities and endurance of a 20 year old. :) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From esj at harvee.org Mon Apr 19 22:54:36 2010 From: esj at harvee.org (Eric S. Johansson) Date: Mon, 19 Apr 2010 16:54:36 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <20100419162315.7637ef45@heresy> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> <20100416142842.532bfd8a@heresy> <4BC92360.2060905@harvee.org> <20100419162315.7637ef45@heresy> Message-ID: <4BCCC30C.3020708@harvee.org> On 4/19/2010 4:23 PM, Barry Warsaw wrote: > On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote: > >> User interfaces aren't easy. Especially when people deviate from capabilities >> and endurance of a 20-year-old. > > Trust me, I am very deviant from the capabilities and endurance of a 20 year > old. :) > yea well, I'm more of a deviant than you are. Oh wait a minute, did I say that out loud? :-) From barry at python.org Tue Apr 20 00:12:03 2010 From: barry at python.org (Barry Warsaw) Date: Mon, 19 Apr 2010 18:12:03 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <4BCCC30C.3020708@harvee.org> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> <20100416142842.532bfd8a@heresy> <4BC92360.2060905@harvee.org> <20100419162315.7637ef45@heresy> <4BCCC30C.3020708@harvee.org> Message-ID: <20100419181203.2a330a7e@heresy> On Apr 19, 2010, at 04:54 PM, Eric S. Johansson wrote: >On 4/19/2010 4:23 PM, Barry Warsaw wrote: >> On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote: >> >>> User interfaces aren't easy. Especially when people deviate from capabilities >>> and endurance of a 20-year-old. >> >> Trust me, I am very deviant from the capabilities and endurance of a 20 year >> old. :) >> > >yea well, I'm more of a deviant than you are. Oh wait a minute, did I say that >out loud? > >:-) Do you have pictures to prove it? :) -B -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From barry at wooz.org Fri Apr 16 20:28:42 2010 From: barry at wooz.org (Barry Warsaw) Date: Fri, 16 Apr 2010 14:28:42 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <4BC86E25.7050701@harvee.org> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> Message-ID: <20100416142842.532bfd8a@heresy> On Apr 16, 2010, at 10:03 AM, Eric S. Johansson wrote: >excellent. do need to work on the naming a bit. As this is two dimensional >navigation. Previous and next four blocks earlier and later the file and in >versus out for nesting depth. > >block-out >block-in >block-previous >block-next >block-previous-out >block-previous-in >block-next-out >block-next-in I dunno. If it's useful to people sure, but I doubt I'd use them much. Sometimes it's just quicker to use C-n and C-p y'know? :) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From esj at harvee.org Fri Apr 23 07:24:12 2010 From: esj at harvee.org (Eric S. Johansson) Date: Fri, 23 Apr 2010 01:24:12 -0400 Subject: [Python-mode] py-goto-block-up In-Reply-To: <20100419181203.2a330a7e@heresy> References: <4BC82D8E.3050207@online.de> <4BC86E25.7050701@harvee.org> <20100416142842.532bfd8a@heresy> <4BC92360.2060905@harvee.org> <20100419162315.7637ef45@heresy> <4BCCC30C.3020708@harvee.org> <20100419181203.2a330a7e@heresy> Message-ID: <4BD12EFC.6080600@harvee.org> On 4/19/2010 6:12 PM, Barry Warsaw wrote: > > Do you have pictures to prove it? :) (did you really think I could let a comment like that lie unanswered :-) no, but I do have stories which are really not appropriate for the mailing list (definitely nsfw^2). One thin hint I'll give you is a.s.b and the little blue guy a.k.a. fpf. and now back to your regularly scheduled program. any further queries should be direct e-mail.