              t)))))
 
 ;;;###autoload
-(defun doom-scratch-buffer (&optional mode directory project-name)
+(defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name)
   "Return a scratchpad buffer in major MODE."
   (let* ((buffer-name (if project-name
                           (format "*doom:scratch (%s)*" project-name)


(defvar projectile-enable-caching)
;;;###autoload
(defun doom/open-scratch-buffer (&optional arg project-p)
  "Pop up a persistent scratch buffer.

If passed the prefix ARG, switch to it in the current window.
If PROJECT-P is non-nil, open a persistent scratch buffer associated with the
  current project."
  (interactive "P")
  (let (projectile-enable-caching)
    (funcall
     (if arg
         #'switch-to-buffer
       #'pop-to-buffer)
     (doom-scratch-buffer
      (cond ((eq doom-scratch-initial-major-mode t)
             (unless (or buffer-read-only
                         (derived-mode-p 'special-mode)

        (doom-project-name))))))

;;;###autoload
(defun doom/switch-to-scratch-buffer (&optional arg project-p)
  "Like `doom/open-scratch-buffer', but switches to it in the current window.

If passed the prefix ARG, do not restore the last scratch buffer."
  (interactive "P")
  (doom/open-scratch-buffer arg project-p 'same-window))

;;;###autoload
(defun doom/open-project-scratch-buffer (&optional arg same-window-p)
  "Opens the (persistent) project scratch buffer in a popup.

If passed the prefix ARG, do not restore the last scratch buffer."
  (interactive "P")
  (doom/open-scratch-buffer arg 'project same-window-p))

;;;###autoload
(defun doom/switch-to-project-scratch-buffer (&optional arg)
  "Like `doom/open-project-scratch-buffer', but switches to it in the current
window.

If passed the prefix ARG, do not restore the last scratch buffer."
  (interactive "P")
  (doom/open-project-scratch-buffer arg 'same-window))

;;;###autoload
(defun doom/revert-scratch-buffer ()
