aboutsummaryrefslogtreecommitdiff
path: root/perspective.el
diff options
context:
space:
mode:
authorNathan Weizenbaum <nex342@gmail.com>2010-10-05 12:42:33 -0700
committerNathan Weizenbaum <nex342@gmail.com>2010-10-05 12:42:33 -0700
commit34d9c83591124c3ac3c6214f86569128f870c19f (patch)
tree4ccf8044a73ef77781c87aa7d0511c5e8c2c736d /perspective.el
parent97ff96e9eb03e7dc02331aff620beec0769b9abb (diff)
Fix a few error-prone references to persp-curr.
Diffstat (limited to 'perspective.el')
-rw-r--r--perspective.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/perspective.el b/perspective.el
index 7e792f0..aaf4fbe 100644
--- a/perspective.el
+++ b/perspective.el
@@ -262,12 +262,12 @@ REQUIRE-MATCH can take the same values as in `completing-read'."
(declare (indent 1))
(let ((old (gensym)))
`(progn
- (let ((,old (persp-name persp-curr)))
+ (let ((,old (when persp-curr (persp-name persp-curr))))
(unwind-protect
(progn
(persp-switch ,name)
,@body)
- (persp-switch ,old))))))
+ (when ,old (persp-switch ,old)))))))
(defun persp-new (name)
"Return a new perspective with name NAME.
@@ -364,7 +364,7 @@ the perspective's window configuration is restored, and the
perspective's local variables are set."
(interactive "i")
(if (null name) (setq name (persp-prompt (and persp-last (persp-name persp-last)))))
- (if (equal name (persp-name persp-curr)) name
+ (if (and persp-curr (equal name (persp-name persp-curr))) name
(let ((persp (gethash name perspectives-hash)))
(setq persp-last persp-curr)
(when (null persp)