Remove old persisted scratch buffer file
This was for backward compatibility with the old format. Removing this now after two months being deprecated.
This commit is contained in:
parent
fa0d882497
commit
cb8b66dd36
1 changed files with 11 additions and 22 deletions
|
@ -34,30 +34,19 @@ the first, fresh scratch buffer you create. This accepts:
|
||||||
doom-scratch-default-file))
|
doom-scratch-default-file))
|
||||||
(let ((smart-scratch-file
|
(let ((smart-scratch-file
|
||||||
(expand-file-name (concat doom-scratch-current-project ".el")
|
(expand-file-name (concat doom-scratch-current-project ".el")
|
||||||
doom-scratch-dir))
|
|
||||||
(scratch-file
|
|
||||||
(expand-file-name doom-scratch-current-project
|
|
||||||
doom-scratch-dir)))
|
doom-scratch-dir)))
|
||||||
(make-directory doom-scratch-dir t)
|
(make-directory doom-scratch-dir t)
|
||||||
(cond ((file-readable-p smart-scratch-file)
|
(when (file-readable-p smart-scratch-file)
|
||||||
(message "Reading %s" smart-scratch-file)
|
(message "Reading %s" smart-scratch-file)
|
||||||
(cl-destructuring-bind (content point mode)
|
(cl-destructuring-bind (content point mode)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(save-excursion (insert-file-contents smart-scratch-file))
|
(save-excursion (insert-file-contents smart-scratch-file))
|
||||||
(read (current-buffer)))
|
(read (current-buffer)))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(funcall mode)
|
(funcall mode)
|
||||||
(insert content)
|
(insert content)
|
||||||
(goto-char point)
|
(goto-char point)
|
||||||
t))
|
t))))
|
||||||
((file-readable-p scratch-file) ; DEPRECATED
|
|
||||||
(when (file-readable-p scratch-file)
|
|
||||||
(let ((pt (point)))
|
|
||||||
(erase-buffer)
|
|
||||||
(insert-file-contents scratch-file)
|
|
||||||
(set-auto-mode)
|
|
||||||
(goto-char pt))
|
|
||||||
t)))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name)
|
(defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue