Closed Zulu-Inuoe closed 3 years ago
Thanks for fixing this. One of my biggest complaints with purpose.
I see from the tests now that there's errors due to usage of pushnew
and some other things. I'll get to work fixing those.
Sorry about the trouble
I have something similar that's much simpler to deal with this problem.
(defun purpose-quit-restore-window-advice (orig-func &optional window bury-or-kill)
(let* ((window (window-normalize-window window t))
(quit-restore (window-parameter window 'quit-restore)))
(funcall orig-func window bury-or-kill)
(when (and (null quit-restore) (window-parent window))
(ignore-errors (delete-window window)))))
(advice-add 'quit-restore-window :around 'purpose-quit-restore-window-advice)
Works pretty well for the couple of months since I've figured this out. Maybe when the popwin
extension is enabled, we could install this advice to quit-restore-window
, and uninstall when disabling.
Superceded by #177
Fixes #153
This is a bit of a hacky workaround for the behaviour of
quit-window
. When we reuse a popup window to display some other popup buffer, and then we quit from that buffer via(quit-window t)
or the like, we will be back at our previous popup buffer, and have our quit-restore parameter set to nil.Unfortunately then,
quit-window
once more will cause the window to display a random buffer because whenquit-restore
is nil,quit-window
will not actually kill the window because ????