(unless (eq prop-val 'key-sequence)
(delete-region prop-start prop-end))))))
+(defvar tutorial--starting-point)
(defun tutorial--save-on-kill ()
"Query the user about saving the tutorial when killing Emacs."
(when (buffer-live-p tutorial--buffer)
(with-current-buffer tutorial--buffer
- (if (y-or-n-p "Save your position in the tutorial? ")
- (tutorial--save-tutorial-to (tutorial--saved-file))
- (message "Tutorial position not saved"))))
+ (unless (= (point) tutorial--starting-point)
+ (if (y-or-n-p "Save your position in the tutorial? ")
+ (tutorial--save-tutorial-to (tutorial--saved-file))
+ (message "Tutorial position not saved")))))
t)
(defun tutorial--save-tutorial ()
(message "Can't save tutorial: %s is not a directory"
tutorial-dir)))))
-
;;;###autoload
(defun help-with-tutorial (&optional arg dont-ask-for-revert)
"Select the Emacs learn-by-doing tutorial.
(forward-line 1)
(newline (- n (/ n 2)))))
(goto-char (point-min)))
+ (setq-local tutorial--starting-point (point))
(setq buffer-undo-list nil)
(set-buffer-modified-p nil)))))