diff options
| author | Nathaniel Nicandro <dzop@users.noreply.github.com> | 2018-06-13 13:51:37 -0500 |
|---|---|---|
| committer | Natalie Weizenbaum <nweiz@google.com> | 2018-06-13 11:51:37 -0700 |
| commit | e0dbdcf1c53bd1308385d5fefc5ed8ebeee05099 (patch) | |
| tree | ea2b3f9a38242ef3381a2c6903a31c0ac4e9242c /perspective.el | |
| parent | 064bb3895fe7457af839bb1c4e68dca8bcf91f2a (diff) | |
When removing a buffer, bury it in all windows displaying it (#70)
Diffstat (limited to 'perspective.el')
| -rw-r--r-- | perspective.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perspective.el b/perspective.el index 62a8437..01555f1 100644 --- a/perspective.el +++ b/perspective.el @@ -591,9 +591,10 @@ See also `persp-switch' and `persp-add-buffer'." ((not (persp-buffer-in-other-p buffer)) (kill-buffer buffer)) ;; Make the buffer go away if we can see it. - ;; TODO: Is it possible to tell if it's visible at all, - ;; rather than just the current buffer? - ((eq buffer (current-buffer)) (bury-buffer)) + ((get-buffer-window buffer) + (while (get-buffer-window buffer) + (with-selected-window (get-buffer-window buffer) + (bury-buffer)))) (t (bury-buffer buffer))) (setf (persp-buffers (persp-curr)) (remq buffer (persp-buffers (persp-curr))))) |
