Fix #3070: project scratch buffers not persistent

This commit is contained in:
Henrik Lissner 2020-05-08 14:49:14 -04:00
parent cb8b66dd36
commit 4f27d8e774
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -23,14 +23,15 @@ the first, fresh scratch buffer you create. This accepts:
(defvar doom-scratch-current-project nil
"The name of the project associated with the current scratch buffer.")
(put 'doom-scratch-current-project 'permanent-local t)
(defvar doom-scratch-buffer-hook ()
"The hooks to run after a scratch buffer is created.")
(defun doom--load-persistent-scratch-buffer (name)
(defun doom--load-persistent-scratch-buffer (project-name)
(setq-local doom-scratch-current-project
(or name
(or project-name
doom-scratch-default-file))
(let ((smart-scratch-file
(expand-file-name (concat doom-scratch-current-project ".el")