help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

python.el window management


From: Samuel Sinayoko
Subject: python.el window management
Date: Fri, 29 Mar 2024 17:04:06 +0000

Hi all, I

'm running into the following issue with python windows in emacs 29.1 on
OSX. Buffers end up being duplicated in certain conditions. I've started
emacs using "emacs -Q" so this is all using the default settings.

- I like to have my *Python* shell buffer under my python code buffer
(figure 1)
+--------------------------------------------------------------+
|                                                              |
|                                                              |
|              helloworld.py source buffer                     |
|                                                              |
|                                                              |
<--------------------------------------------------------------+
|                                                              |
|                                                              |
|                  *Python* Shell Buffer                       |
|                                                              |
|                                                              |
|                                                              |
+--------------------------------------------------------------+
 Figure 1. Initial setup with Python source code buffer above *Python*
shell buffer.

- When executing the source buffer with C-c C-c the source buffer ends up
being duplicated on the bottom right (see figure 2)
+--------------------------------------------------------------+
|                                                              |
|                                                              |
|              helloworld.py source buffer                     |
|                                                              |
|                                                              |
<-----------------------------+--------------------------------+
|                             |                                |
|                             |                                |
|   *Python* shell buffer     |   helloworld.py source buffer  |
|                             |                                |
|                             |                                |
|                             |                                |
+-----------------------------+--------------------------------+
Figure 2. Code buffer duplicated on bottom right after running C-c C-c

- Also if I then move to the *Python* shell buffer and press <enter>, the
Python shell buffer ends up being duplicated on the top right (see figure 3)
+-----------------------------+--------------------------------+
|                             |                                |
|                             |                                |
| helloworld.py source buffer |     *Python* shell buffer      |
|                             |                                |
|                             |                                |
<-----------------------------+--------------------------------+
|                             |                                |
|                             |                                |
|   *Python* shell buffer     |   helloworld.py source buffer  |
|                             |                                |
|                             |                                |
|                             |                                |
+-----------------------------+--------------------------------+
Figure 3. *Python* shell buffer is duplicated on top right when pressing
<enter> in bottom left window

Obviously this isn't what I'd expect, I'd like to keep the initial layout
(figure 1).

I came across this helpful guide on managing windows
https://www.masteringemacs.org/article/demystifying-emacs-window-manager#templates-examples
and tried customising the display-buffer-alist variable using

(add-to-list 'display-buffer-alist
'((or (derived-mode . python-mode) (derived-mode . inferior-python-mode))
  (display-buffer-reuse-window display-buffer-reuse-mode-window)
  (inhibit-same-window . nil)))

but that's making no difference here, I get the same behaviour as before
(figures 2 and 3).

I've got a couple of questions.

1. Are others able to reproduce this issue?
2. Is there a way to configure display-buffer-alist to avoid seeing my
python source and shell buffers duplicated and get figure 1 instead of 2 or
3?

Grateful for any tips!

Many thanks!

Sam


reply via email to

[Prev in Thread] Current Thread [Next in Thread]