tags:

views:

520

answers:

4

In python-mode (for emacs), hitting Control-C\Control-C will execute the current buffer. However, when execution is finished, the output buffer springs up and splits my editing window in half. This is a complete pain, especially given that there's generally no output in the buffer anyway!

Is there a way to stop the buffer from appearing? Also, how can I send painful electric shocks to the programmer who thought unexpectedly interrupting my train of thought with an empty buffer was a good idea?

Edit: Apparently, there are uses for this behavior, most notably in seeing the output of a program. That's fine, but if there's no output (as in the program with which I'm tinkering), it is really dumb to cut my buffer in half with a blank window.

+1  A: 

Sorry that I can't help you with emacs, but as for your second question, a modified aluminum keyboard from Apple may be a solution:

http://www.apple.com/keyboard/

jcoon
+1  A: 

You might want to customize the pop-up-windows variable; that controls the splitting functionality.

jrockway
A: 

Don't know how to stop it from popping up, but C-x, 1 will close the window.

Mark Roddy
And all the other windows you have open.
jrockway
+2  A: 

What python-mode are you using? Unfortunately, there are several.

Type C-h k and then C-c C-c .. what does it say in the modeline? Does it say "py-execute-buffer" or does it say "python-send-buffer", the first kind indicates you're using Tim Peters' python-mode, while the second indicates you're using Dave Love's python-mode.

I myself prefer Dave Love's python mode, and it's the version that ships with Emacs 23 (and maybe earlier too?). Dave Love's does not pop up the buffer when you run C-c C-c, you have to explicitly switch to the *Python* buffer if you want to see it.

If you're really intent on sticking with Tim Peters' version, you could always put something like the following in your .emacs and you'll never see the output buffer again unless explicitly moved to.

(defadvice py-execute-buffer (after advice-delete-output-window activate)                                      
  (delete-windows-on "*Python Output*"))
EnigmaCurry
Okay, apparently I'm using the version that uses "py-execute-buffer", which is the version I downloaded from the python-mode page. Where can I find the other version?
Lee Crabtree
I just found his version, and so far, I definitely prefer it. My only gripe now (and it was present in the other version) is that imports aren't being...well, imported. It looks like Emacs is shooting the buffer into a temp file, when there's already a file it could use. Grrrrr.
Lee Crabtree
Apparently, if the directory from which Python is started is world-writable, imports are turned off, or something. I don't understand it, but commenting that out of python.el seemed to work. What a freaking pain.
Lee Crabtree