about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-19T06·41+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-19T06·41+0800
commit61274e09537c2d88f12a24b408464af00245bf11 (patch)
tree4e76db41ab97211745a162789cd319fa250af990
parent21351f6be32d6867edbf887cfb12c5c9d73873c6 (diff)
parent93d96757b611cc3d9e990d28e82f349c61dbdaa3 (diff)
Merge branch 'kriyative/bugfix-selecting-deleted-buffer-error' into externals/exwm
-rw-r--r--exwm-manage.el22
1 files changed, 7 insertions, 15 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 36a989665e94..fffc677c7f0e 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -405,21 +405,13 @@ manager is shutting down."
         (xcb:flush exwm--connection))
       (let ((kill-buffer-func
              (lambda (buffer)
-               (with-current-buffer buffer
-                 (let ((kill-buffer-query-functions nil)
-                       (floating exwm--floating-frame))
-                   (kill-buffer)
-                   (when floating
-                     (select-window
-                      (frame-selected-window exwm-workspace--current))))))))
-        (if (not (active-minibuffer-window))
-            ;; Kill the buffer as usual.
-            (funcall kill-buffer-func buffer)
-          ;; This can happen when this buffer was requested to be killed
-          ;; from the minibuffer (e.g. with `ido-kill-buffer-at-head').
-          ;; We have to exit the minibuffer first or there'll be a
-          ;; "selecting deleted buffer" error.
-          (run-with-idle-timer 0 nil kill-buffer-func buffer)
+               (let ((kill-buffer-query-functions nil))
+                 (when exwm--floating-frame
+                   (select-window
+                    (frame-selected-window exwm-workspace--current)))
+                 (kill-buffer buffer)))))
+        (run-with-idle-timer 0 nil kill-buffer-func buffer)
+        (when (active-minibuffer-window)
           (exit-minibuffer))))))
 
 (defun exwm-manage--scan ()