branch: externals/corfu commit 6f74b675521ca9731eec120da01dd9e6d56af449 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
HACK: Work around suspected Emacs 29 regression Is it possible that frames can have a dead root window?! Unfortunately I don't know how I managed to trigger the situation where (frame-live-p frame) returned t and (window-live-p (frame-root-window frame)) returned nil. --- corfu.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/corfu.el b/corfu.el index 3a7b82c03a..3fcee9c994 100644 --- a/corfu.el +++ b/corfu.el @@ -386,7 +386,11 @@ FRAME is the existing frame." 'resize-mode))) (after-make-frame-functions) (parent (window-frame))) - (unless (and (frame-live-p frame) (eq (frame-parent frame) parent)) + (unless (and (frame-live-p frame) + (eq (frame-parent frame) parent) + ;; XXX HACK: It seems the frame can be alive but have a dead window? + ;; Is this a Emacs 29 regression? + (window-live-p (frame-root-window frame))) (when frame (delete-frame frame)) (setq frame (make-frame `((parent-frame . ,parent)