aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew White <mehw.is.me@inventati.org>2021-06-27 12:43:54 +0000
committerMatthew White <mehw.is.me@inventati.org>2021-10-21 01:27:37 +0200
commitb5202b1a163e931708346ed898012736b9c4e675 (patch)
tree8beb08c3b7d2430a68aa3d12d06ba83b4c9d01e4
parent26e6750533b4247572c9b6f986bcac918e086230 (diff)
persp-other-buffer: use persp-get-scratch-buffer if needed
Call 'persp-get-scratch-buffer', when needed, to get/create a perspective's scratch buffer. The former function is able to properly set a newly created perspective's scratch buffer.
-rw-r--r--CHANGELOG.md1
-rw-r--r--perspective.el4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2e0cd2..cb36d36 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
+- `persp-other-buffer`: call `persp-get-scratch-buffer` to get/create a scratch buffer.
- `persp-new`: call `persp-get-scratch-buffer` to get/create a scratch buffer.
- `persp-switch`: remove duplicated code. It's now possible to call `persp-new` either to get an existing perspective or to create a new one.
- `persp-mode`: add/remove `persp-maybe-kill-buffer` hook.
diff --git a/perspective.el b/perspective.el
index f178edf..0b27c7e 100644
--- a/perspective.el
+++ b/perspective.el
@@ -1396,12 +1396,12 @@ perspective beginning with the given letter."
"A version of `other-buffer' which respects perspectives."
(let ((other (other-buffer buffer visible-ok frame)))
(if (member other (persp-current-buffers))
- other
+ other
;; In cases where `other-buffer' produces a buffer that is not
;; part of the current perspective, select the current
;; perspective's *scratch* buffer, similar to the behaviour of
;; `other-buffer'.
- (get-buffer-create (persp-scratch-buffer)))))
+ (persp-get-scratch-buffer))))
;;; --- perspective-aware buffer switchers