0

Context: This is GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) running on Debian 6.0.7.

When running pdb (M-x pdb), emacs switches which buffer is in which window when I set a breakpoint. I've searched the internet and here, and haven't yet found a way to stop this. Here's the scenario:

I'm using a wide window which is split hoirizontally for side-by-side working. Once I've started pdb (M-x pdb) with my python file, I have one window which has my debug session (indicating gud-pathfile.py). The other window has my pathfile.py source file. Each time I click on a line in the source and then click on the red "set breakpoint" button, the windows swap (if the .py file was in the right window, it's now in the left, etc.).

Thank you for your time and help.

Blessings, Doug

1 Answers1

0

Here's a standard solution. It makes it very easy to restore the previous window configuration.

(winner-mode)
(global-set-key (kbd "<f7>") 'winner-undo)
(global-set-key (kbd "C-<f7>") 'winner-redo)
abo-abo
  • 20,038
  • 3
  • 50
  • 71
  • Dear abo-abo: this is an interesting approach. I had not heard of winner-mode previously. It somewhat helps, though it takes a winner-undo followed by a 'C-x o' to get the window positions restored and my cursor back in the PDB session. So thank you. However, I am still holding out hope for a solution that prevents the swap in the first place (maybe somebody knows why the swap happens at all?). – Doug Meyer Aug 13 '13 at 18:52