diff options
| author | Mark Stuart <codeasone@gmail.com> | 2018-07-17 22:03:33 +0100 |
|---|---|---|
| committer | Natalie Weizenbaum <nweiz@google.com> | 2018-07-17 14:03:33 -0700 |
| commit | 8e2f122de408d7866136dd861d513a9575cf32e6 (patch) | |
| tree | 1f8288e6261cf35d55ccfdee8e8087015eab4470 | |
| parent | ca2a3b51a8411853b9adef2a9fe38011f84b91d9 (diff) | |
Resolve common-header-mode-line compat. issue (#73)2.2
For details see: https://github.com/Bad-ptr/common-header-mode-line.el/issues/2
| -rw-r--r-- | perspective.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/perspective.el b/perspective.el index 7e54a4c..b5842e3 100644 --- a/perspective.el +++ b/perspective.el @@ -7,7 +7,7 @@ ;; Author: Natalie Weizenbaum <nex342@gmail.com> ;; URL: http://github.com/nex3/perspective-el ;; Package-Requires: ((cl-lib "0.5")) -;; Version: 2.1 +;; Version: 2.2 ;; Created: 2008-03-05 ;; By: Natalie Weizenbaum <nex342@gmail.com> ;; Keywords: workspace, convenience, frames @@ -593,9 +593,13 @@ See also `persp-switch' and `persp-add-buffer'." (kill-buffer buffer)) ;; Make the buffer go away if we can see it. ((get-buffer-window buffer) - (while (get-buffer-window buffer) - (with-selected-window (get-buffer-window buffer) - (bury-buffer)))) + (let ((window (get-buffer-window buffer))) + (while window + (with-selected-window window (bury-buffer)) + (let ((new-window (get-buffer-window buffer))) + ;; If `window' is still selected even after being buried, exit + ;; the loop because otherwise it will go on infinitely. + (setq window (unless (eq window new-window) new-window)))))) (t (bury-buffer buffer))) (setf (persp-buffers (persp-curr)) (remq buffer (persp-buffers (persp-curr))))) |
