aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perspective.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/perspective.el b/perspective.el
index 7e33f03..a0aab7b 100644
--- a/perspective.el
+++ b/perspective.el
@@ -195,10 +195,11 @@ the frame global perspective."
(persp-current-buffers)
(delete-dups
(append (persp-current-buffers)
- (with-perspective persp-frame-global-perspective-name
- (if persp-frame-global-perspective-include-scratch-buffer
- (persp-current-buffers)
- (remove (persp-get-scratch-buffer) (persp-current-buffers))))))))
+ (when (member persp-frame-global-perspective-name (persp-names))
+ (with-perspective persp-frame-global-perspective-name
+ (if persp-frame-global-perspective-include-scratch-buffer
+ (persp-current-buffers)
+ (remove (persp-get-scratch-buffer) (persp-current-buffers)))))))))
(defun persp-current-buffer-names (&optional include-global)
"Return a list of names of all living buffers in the current perspective.