]> git.neil.brown.name Git - edlib.git/commitdiff
mode-emacs: handle cx-cc from a popup better
authorNeilBrown <neil@brown.name>
Fri, 22 Sep 2023 23:52:13 +0000 (09:52 +1000)
committerNeilBrown <neil@brown.name>
Fri, 22 Sep 2023 23:52:13 +0000 (09:52 +1000)
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 <neil@brown.name>
mode-emacs.c

index 0cc1bf33edd8d29683c8a836ccf25ae917a67ac0..07e2647b728daf8caad2961e67615128409190b4 100644 (file)
@@ -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