aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine Vetoshev <gepardcv@gmail.com>2021-07-06 06:05:59 -0700
committerConstantine Vetoshev <gepardcv@gmail.com>2021-07-06 06:05:59 -0700
commit2ff458a4f4bd4496a45f7946dd0c445616d3fb5e (patch)
tree83bd461f703260208e09f2c210098eb1f9629ee8
parent68b13cef8435cae581850415cdda17e245dd0eae (diff)
Add persp-kill-others.
-rw-r--r--perspective.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/perspective.el b/perspective.el
index c811a84..9827f93 100644
--- a/perspective.el
+++ b/perspective.el
@@ -877,6 +877,15 @@ perspective and no others are killed."
(persp-let-frame-parameters ((persp--last (persp-last)))
(persp-switch (persp-find-some)))))
+(defun persp-kill-others ()
+ "Kill all perspectives except the current one."
+ (interactive)
+ (let ((self (persp-current-name)))
+ (when (yes-or-no-p (concat "Really kill all perspectives other than `" self "'? "))
+ (cl-loop for p in (persp-names)
+ when (not (string-equal p self)) do
+ (persp-kill p)))))
+
(defun persp-rename (name)
"Rename the current perspective to NAME."
(interactive "sNew name: ")