From: NeilBrown Date: Fri, 22 Sep 2023 23:52:13 +0000 (+1000) Subject: mode-emacs: handle cx-cc from a popup better X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=f2c1c3ae9cf515a7b6556b8299f7e9bcf9a5edeb;p=edlib.git 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 --- 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