aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perspective.el6
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f4ba3c..fa139f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
+- `persp-new`: properly substitute command keys when inserting `initial-scratch-message` into scratch buffers.
- `persp-new`: do not recreate existing perspectives. This prevents from resetting perspectives to a state where in the perspective there's only the scratch buffer.
- `persp-reset-windows`: set `switch-to-buffer-preserve-window-point` to `nil` before calling `delete-window`, that up to Emacs 27.2 updates `window-prev-buffers` of all windows, unless the former is turned off.
- `persp-remove-buffer`: force update the `current-buffer` to the current window's buffer due to `with-selected-window` saving/restoring the `current-buffer` when executing it's BODY. This properly updates the `current-buffer` to what should be the real current buffer when burying the current buffer.
diff --git a/perspective.el b/perspective.el
index bd69343..361f126 100644
--- a/perspective.el
+++ b/perspective.el
@@ -558,8 +558,10 @@ buffer called \"*scratch* (NAME)\"."
(make-persp :name name
(switch-to-buffer (persp-scratch-buffer name))
(funcall initial-major-mode)
- (when initial-scratch-message
- (insert initial-scratch-message))
+ (when (and (zerop (buffer-size))
+ initial-scratch-message)
+ (insert (substitute-command-keys initial-scratch-message))
+ (set-buffer-modified-p nil))
(persp-reset-windows))))
(defun persp-reactivate-buffers (buffers)