octi
octi

Reputation: 1530

How can I force emacs to use the bottom window rather than the bottom one when invoking an ipython compilation in a 3 window setup

So I have my emacs window setup with a 3 frame setup as such :

;  +-----------------------+            
;  |           |           |    
;  |           |           |   
;  +-----------------------+  
;  |                       |  
;  |                       |     
;  +-----------------------+

Two sources are on the top left and right windows while the ipython console is on the bottom window. Whenever I call the ipython evaluate buffer command from the top-left source the console is re-displayed on the right window overwriting my other source and the latter is displayed in the bottom window. In short, the console and top right source effectively exchange windows.

A similar but not exactly question was asked here: How can I get the compilation buffer on the bottom rather than on the right in Emacs 23?

What I want to happen is to preserve the original locations of the items in their respective windows.

I am using python-mode 6.0.10.

Tried (setq split-width-threshold nil) with an undesireable result: The console does stay on the bottom window but the top right window is deleted thus reducing the setup to a simple horizontal split.

The emacs compile and latex-compile seem to avoid this issue so I am guessing it's python-mode issue.

Any ideas?

Upvotes: 2

Views: 504

Answers (1)

gempesaw
gempesaw

Reputation: 329

TIMTOWTDI, but I'd make my own defun with the python compile function in a save-window-excursion and rebind the keybindings to call my version of it. I don't know what the python-mode compile command is, so you'll probably need to replace py-execute-buffer with whatever you want.

(defun keep-my-window-config-compile () 
  (interactive)
  (save-window-excursion (py-execute-buffer)))

(global-set-key (kbd "C-c C-c") 'keep-my-window-config-compile)

http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Configurations.html

Upvotes: 2

Related Questions