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))
|
||||
(let ((smart-scratch-file
|
||||
(expand-file-name (concat doom-scratch-current-project ".el")
|
||||
doom-scratch-dir))
|
||||
(scratch-file
|
||||
(expand-file-name doom-scratch-current-project
|
||||
doom-scratch-dir)))
|
||||
(make-directory doom-scratch-dir t)
|
||||
(cond ((file-readable-p smart-scratch-file)
|
||||
(message "Reading %s" smart-scratch-file)
|
||||
(cl-destructuring-bind (content point mode)
|
||||
(with-temp-buffer
|
||||
(save-excursion (insert-file-contents smart-scratch-file))
|
||||
(read (current-buffer)))
|
||||
(erase-buffer)
|
||||
(funcall mode)
|
||||
(insert content)
|
||||
(goto-char point)
|
||||
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)))))
|
||||
(when (file-readable-p smart-scratch-file)
|
||||
(message "Reading %s" smart-scratch-file)
|
||||
(cl-destructuring-bind (content point mode)
|
||||
(with-temp-buffer
|
||||
(save-excursion (insert-file-contents smart-scratch-file))
|
||||
(read (current-buffer)))
|
||||
(erase-buffer)
|
||||
(funcall mode)
|
||||
(insert content)
|
||||
(goto-char point)
|
||||
t))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue