From ba536bb6e354577cd69926865aee0e6f90f7306a Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Tue, 27 Oct 2015 20:24:28 +0800 Subject: [PATCH] Delay closing minibuffer * exwm-workspace.el (exwm-workspace-switch, exwm-workspace--on-focus-in): Delay closing minibuffer until Emacs is idle. This prevent nonlocal exits from interrupting remaining code. --- exwm-workspace.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index 8000b0b..d1fe6cf 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -139,7 +139,8 @@ The optional FORCE option is for internal use only." y (/ h 2))) (set-mouse-pixel-position frame x y))) ;; Close the (possible) active minibuffer - (when (active-minibuffer-window) (abort-recursive-edit)) + (when (active-minibuffer-window) + (run-with-idle-timer 0 nil (lambda () (abort-recursive-edit)))) (setq default-minibuffer-frame frame) ;; Hide windows in other workspaces by preprending a space (unless exwm-workspace-show-all-buffers @@ -168,8 +169,6 @@ The optional FORCE option is for internal use only." (exwm--log "Focus on workspace %s" index) (when (and index (/= index exwm-workspace-current-index)) (exwm--log "Workspace was switched unexpectedly") - ;; Close the (possible) active minibuffer - (when (active-minibuffer-window) (abort-recursive-edit)) (exwm-workspace-switch index))))) ;;;###autoload