From cddb3429d2219ed5e15761e4b7b61be1a14970bd Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Wed, 15 Apr 2020 00:00:00 +0000 Subject: Abort recursive edit before switching workspaces * exwm-workspace.el (exwm-workspace-switch): Abort recursive edit before switching to other workspace. This avoids the usual `set-window-configuration' calls (e.g., by `eval-expression') to switch *us back to the previous workspace. --- exwm-workspace.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'exwm-workspace.el') diff --git a/exwm-workspace.el b/exwm-workspace.el index 4da97d9282a8..1f832a66fd96 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -587,6 +587,16 @@ for internal use only." (when (or force (not (eq frame exwm-workspace--current))) (unless (window-live-p window) (setq window (frame-selected-window frame))) + ;; Close the (possible) active minibuffer. Aborting the recursive edit + ;; level will abort the execution of this very command. Schedule it to + ;; run immediately afterward. This must all be done before the new + ;; workspace is selected in the new workspace, in order to avoid the focus + ;; to go back to the previous frame due to resetting the window + ;; configuration (e.g. `eval-expression'). + (when (active-minibuffer-window) + (exwm--defer 0 (lambda () + (exwm-workspace-switch frame-or-index force))) + (abort-recursive-edit)) ;; Raise this frame. (xcb:+request exwm--connection (make-instance 'xcb:ConfigureWindow @@ -635,12 +645,6 @@ for internal use only." (select-window window) (x-focus-frame (window-frame window)) ;The real input focus. (set-frame-parameter frame 'exwm-selected-window nil) - ;; Close the (possible) active minibuffer - (when (active-minibuffer-window) - (exwm--defer 0 (lambda () - ;; Might be aborted by then. - (when (active-minibuffer-window) - (abort-recursive-edit))))) (if (exwm-workspace--minibuffer-own-frame-p) ;; Resize the minibuffer frame. (exwm-workspace--resize-minibuffer-frame) -- cgit 1.4.1 From 373eda99bd01e5bf53abc46c8a3c096bceeff72c Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Wed, 15 Apr 2020 00:00:00 +0000 Subject: Stop aborting recursive edit upon switching workspaces. * exwm-workspace.el (exwm-workspace-switch): Stop aborting recursive edit upon switching workspaces. Users should handle it just like in regular Emacs (possibly customizing `enable-recursive-minibuffers'). --- exwm-workspace.el | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'exwm-workspace.el') diff --git a/exwm-workspace.el b/exwm-workspace.el index 1f832a66fd96..f63a0a36ebaf 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -587,16 +587,6 @@ for internal use only." (when (or force (not (eq frame exwm-workspace--current))) (unless (window-live-p window) (setq window (frame-selected-window frame))) - ;; Close the (possible) active minibuffer. Aborting the recursive edit - ;; level will abort the execution of this very command. Schedule it to - ;; run immediately afterward. This must all be done before the new - ;; workspace is selected in the new workspace, in order to avoid the focus - ;; to go back to the previous frame due to resetting the window - ;; configuration (e.g. `eval-expression'). - (when (active-minibuffer-window) - (exwm--defer 0 (lambda () - (exwm-workspace-switch frame-or-index force))) - (abort-recursive-edit)) ;; Raise this frame. (xcb:+request exwm--connection (make-instance 'xcb:ConfigureWindow -- cgit 1.4.1