Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persp-delete-frame alters windows of other frames when killing frame with dedicated window #195

Open
Sorixelle opened this issue Jan 27, 2023 · 1 comment
Labels

Comments

@Sorixelle
Copy link

When closing a frame that only contains one dedicated window, messages similar to the following get logged in *Messages*:

Error during redisplay: (run-hook-with-args persp-delete-frame #<dead frame testing 0x8d099f8>) signaled (error "Lisp nesting exceeds ‘max-lisp-eval-depth’")
Error during redisplay: (run-hook-with-args persp-delete-frame #<dead frame testing 0x8d099f8>) signaled (error "#<window 467> is not a live window") [225 times]

This also seems to coincide with either a window getting removed from another frame, or the window being changed to some other buffer if it's the only window on the frame.

I've been able to reproduce this in Emacs 28.2. I first noticed it in an EXWM environment (since EXWM creates a new frame with a dedicated window for "floating" X windows), but I've been able to reproduce it in a regular Emacs environment as well.

Steps to reproduce:

  1. Open a new frame (C-x 5 2)
  2. Open a new buffer in that frame's window (C-x b <some buffer name>)
  3. Set the window in that frame to be dedicated M-: (set-window-dedicated-p (selected-window) t)
  4. Delete the frame (C-x 5 0)
  5. Note the changes in other open frames, and the errors logged in *Messages*.

Suspected cause
The infinite loop appears to be as follows:

  1. persp-delete-frame -> persp-kill
  2. persp-kill -> persp-remove-buffer
  3. persp-remove-buffer -> kill-buffer if the buffer doesn't exist in other perspectives
  4. kill-buffer -> replace-buffer-in-windows
  5. replace-buffer-in-windows -> delete-frame since the window is dedicated, and the only window in the frame
  6. delete-frame runs delete-frame-functions, which contains persp-delete-frame
@gcv
Copy link
Collaborator

gcv commented Feb 2, 2023

Thank you for the detailed bug report. I'm swamped right now, but will try to find time to take a look in the next couple of weeks.

@gcv gcv added the bug label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants