sabof / project-explorer

A project explorer sidebar
266 stars 17 forks source link

Window management problems #21

Closed expez closed 10 years ago

expez commented 10 years ago

I've been trying out project-explorer and have run into two issues lately, that I think are related.

  1. I will get two pe buffers next to one another
  2. delete-other-windows fails
Debugger entered--Lisp error: (error "Specified root is not an ancestor of specified window")
  delete-other-windows-internal(#<window 62 on *Backtrace*> #<window 22 on  *project-explorer*>)

Here popwin is trying to delete other windows after describe-key

When I try to clean up the extra PE buffer I get:

Debugger entered--Lisp error: (error "Attempt to delete last non-side window")

after pe/quit calls delete-window

Have you seen anything like this before?

sabof commented 10 years ago

What did you do to get 2 PE windows? Are both errors related to popwin? Could you also provide full stack traces?

expez commented 10 years ago

if I have pe open and popwin creates another window (say from describe-key), then I will get two pe buffers. When I try to quit the extra pe buffer:

Debugger entered--Lisp error: (error "Attempt to delete last non-side window")
  signal(error ("Attempt to delete last non-side window"))
  error("Attempt to delete last non-side window")
  delete-window()
  pe/quit()
  call-interactively(pe/quit nil nil)

pe does disappear, even though I get an error, but there's still a window in its place showing another buffer. When I try to close this window:

Debugger entered--Lisp error: (error "Attempt to delete last non-side window")
  signal(error ("Attempt to delete last non-side window"))
  error("Attempt to delete last non-side window")
  delete-window()
  call-interactively(delete-window nil nil)
sabof commented 10 years ago

I've added a commit on devel branch that prevents the first error. The second error is to be expected. You must always have a non-side window. That's how side windows are implemented in Emacs.

expez commented 10 years ago

Perhaps I was a bit unclear, I had three windows when I encountered the errors above: two pe windows and one main window. Then I tried to get rid of the extra pe window.

I suppose fixing the second error is pointless if we're prevented from getting into that state at all after the latest commit.

Thanks for fixing this so quickyl!

sabof commented 10 years ago

There should be no change in the end result, just no error message.

Then perhaps what you considered your "main window" was a side window? You can find out by typing M-: (window-parameter nil 'window-side). If that is the case, it's likely to be a popwin bug.

sabof commented 10 years ago

Could be a manifestation of https://github.com/m2ym/popwin-el/issues/9

expez commented 10 years ago

I wasn't using ECB. The windows that were active at the time was showing a regular source code buffer, a cider-repl and pe.

When using C-h k popwin would create another pe window, next to the existing one. After trying q to quit this window it would show a regular buffer (more source code) instead of a pe view, but I would be unable to close that window with C-x 0 or C-x 1. These attempts resulted in a "Attempt to delete last non-side window" error.