;;; config/tutorial/autoload/tutorial.el -*- lexical-binding: t; -*- (defvar doom-tutorial-hist-file (expand-file-name "tutorial-progress.el" doom-cache-dir) "Directory where tutorial progress information is saved.") (defvar doom-tutorial--progress (when (file-exists-p doom-tutorial-hist-file) (with-temp-buffer (insert-file-contents doom-tutorial-hist-file) (read (current-buffer)))) "An alist of tutorials and progress information.") (defun doom-tutorial--save-progress () "Write `doom-tutorial--progress' to `doom-tutorial-hist-file'." (with-temp-buffer (insert ";; -*- mode: emacs-lisp -*-\n" ";; Tutorial progress file, automatically generated by `doom-tutorial--save-progress'.\n" "\n") (let ((print-length nil) (print-level nil) (print-quoted t)) (prin1 doom-tutorial--progress (current-buffer))) (insert ?\n) (condition-case err (write-region (point-min) (point-max) doom-tutorial-hist-file nil (unless (called-interactively-p 'interactive) 'quiet)) (file-error (lwarn '(doom-tutorial-hist-file) :warning "Error writing `%s': %s" doom-tutorial-hist-file (caddr err))))))