Open rieje opened 6 years ago
When a perspective is restored, the point (cursor) position is saved--is this true?
Yes, this is true. It's saved/restored by emacs' window-state-get/put functions.
However you can try to reset positions after they were restored:
(defun persp-reset-buffer-positions-after-init (file phash &rest _args)
(when (and (eq phash *persp-hash*)
(string= file (concat (or (file-name-directory fname)
(expand-file-name persp-save-dir))
(file-name-nondirectory fname))))
(unless save-place-mode
(dolist (b (buffer-list))
(with-current-buffer b (beginning-of-buffer))))
(remove-hook 'persp-after-load-state-functions
#'persp-reset-buffer-positions-after-init)))
(add-hook 'persp-after-load-state-functions
#'persp-reset-buffer-positions-after-init)
Doesn't seem to work--does it work for you? I removed save-place and the saved perspectives files and it still restores the cursor to what it was previously instead of resetting it.
When a perspective is restored, the point (cursor) position is saved--is this true? I don't want it to be saved and let
save-place
handle that instead. I disabledsave-place
and removed its history file and found that with persp-mode enabled, the cursor position is saved. With it commented out, the cursor position is not.How can I disable cursor position being saved?
Much appreciated.