From f2c1c3ae9cf515a7b6556b8299f7e9bcf9a5edeb Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 23 Sep 2023 09:52:13 +1000 Subject: [PATCH] mode-emacs: handle cx-cc from a popup better cx-cc will try to create a popup for selecting docs to save. This fails when a popup is active. Instead of silently failing, abort the popup so the user can try again. Signed-off-by: NeilBrown --- mode-emacs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mode-emacs.c b/mode-emacs.c index 0cc1bf33..07e2647b 100644 --- a/mode-emacs.c +++ b/mode-emacs.c @@ -637,9 +637,13 @@ DEF_CMD(emacs_exit) } p = call_ret(pane, "PopupTile", ci->focus, 0, NULL, "DM"); - // FIXME if called from a popup, this fails. - if (!p) + if (!p) { + /* Probably called from a pop-up. Abort the popup + * and let the user try again. + */ + call("Abort", ci->focus); return Efail; + } attr_set_str(&p->attrs, "done-key", "emacs:deactivate"); return call("docs:show-modified", p); } else -- 2.39.5