sagemath / sage-shell-mode

Emacs front end for SageMath
GNU General Public License v3.0
102 stars 16 forks source link

Sage-shell:restart-sage messing with the window configuration after running pdb #57

Open ThibautVerron opened 3 years ago

ThibautVerron commented 3 years ago

Hi,

As written in the title, sage-shell:restart-sage is messing up my window configuration. Sometimes it's as simple as bringing up a code buffer, sometimes it completely moves my windows around... In most cases simply calling winner-undo is enough to return to my window configuration, but as the session goes longer the modifications get more complex and even sometimes appear to not be undoable.

I believe that it is linked to the pdb-tracking feature. Namely, it seems that the feature to kill the buffers when exiting pdb does not run when I exit pdb with C-d or with q.

But it's only part of the problem: it may happen that one wants the source code buffers to stay live after exiting the debugger (for instance if they were already live to begin with, which I believe the tracker takes care of), but still that the window configuration does not change when restarting sage.

Steps to reproduce the problem (tested with a vanilla emacs with only sage-shell-mode installed: ./emacs-sandbox.sh -O -i sage-shell-mode (https://github.com/alphapapa/emacs-sandbox.sh))

  1. M-x sage-shell:run-sage
  2. In the buffer, enter:
import pdb
1/0
pdb.pm()
u 3

3. This opens a buffer visiting interactiveshell.py. At that point, inspecting sage-shell-pdb:buffers-to-kill shows that interactiveshell.py is in the list

  1. Exit pdb (either with q or C-d)
  2. The buffer is not killed.
  3. Change the buffer displayed in the window where interactiveshell.py is.
  4. Move the point back to the sage-shell buffer, and M-x sage-shell:restart-sage
  5. The window configuration is changed to display interactiveshell.py again.

Thanks!