aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-05-20 03:59:03 +0200
committerLars Ingebrigtsen2022-05-20 03:59:39 +0200
commit7e32904998db6bcaff78c9329efa1fcbc26cbd70 (patch)
tree0994105947345e702a34b2aed6a1750bfdd52423
parentd2865bfa2ca933b712b34507fe294dbcc047cdf0 (diff)
downloademacs-7e32904998db6bcaff78c9329efa1fcbc26cbd70.tar.gz
emacs-7e32904998db6bcaff78c9329efa1fcbc26cbd70.zip
Don't have the tutorial ask to save if we haven't moved
* lisp/tutorial.el (tutorial--save-on-kill): Don't ask if the user hasn't moved point (bug#37326). (help-with-tutorial): Set the start point.
-rw-r--r--lisp/tutorial.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 0f3a1506d6b..2c787ae5595 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -649,13 +649,15 @@ with some explanatory links."
649 (unless (eq prop-val 'key-sequence) 649 (unless (eq prop-val 'key-sequence)
650 (delete-region prop-start prop-end)))))) 650 (delete-region prop-start prop-end))))))
651 651
652(defvar tutorial--starting-point)
652(defun tutorial--save-on-kill () 653(defun tutorial--save-on-kill ()
653 "Query the user about saving the tutorial when killing Emacs." 654 "Query the user about saving the tutorial when killing Emacs."
654 (when (buffer-live-p tutorial--buffer) 655 (when (buffer-live-p tutorial--buffer)
655 (with-current-buffer tutorial--buffer 656 (with-current-buffer tutorial--buffer
656 (if (y-or-n-p "Save your position in the tutorial? ") 657 (unless (= (point) tutorial--starting-point)
657 (tutorial--save-tutorial-to (tutorial--saved-file)) 658 (if (y-or-n-p "Save your position in the tutorial? ")
658 (message "Tutorial position not saved")))) 659 (tutorial--save-tutorial-to (tutorial--saved-file))
660 (message "Tutorial position not saved")))))
659 t) 661 t)
660 662
661(defun tutorial--save-tutorial () 663(defun tutorial--save-tutorial ()
@@ -734,7 +736,6 @@ See `tutorial--save-tutorial' for more information."
734 (message "Can't save tutorial: %s is not a directory" 736 (message "Can't save tutorial: %s is not a directory"
735 tutorial-dir))))) 737 tutorial-dir)))))
736 738
737
738;;;###autoload 739;;;###autoload
739(defun help-with-tutorial (&optional arg dont-ask-for-revert) 740(defun help-with-tutorial (&optional arg dont-ask-for-revert)
740 "Select the Emacs learn-by-doing tutorial. 741 "Select the Emacs learn-by-doing tutorial.
@@ -914,6 +915,7 @@ Run the Viper tutorial? "))
914 (forward-line 1) 915 (forward-line 1)
915 (newline (- n (/ n 2))))) 916 (newline (- n (/ n 2)))))
916 (goto-char (point-min))) 917 (goto-char (point-min)))
918 (setq-local tutorial--starting-point (point))
917 (setq buffer-undo-list nil) 919 (setq buffer-undo-list nil)
918 (set-buffer-modified-p nil))))) 920 (set-buffer-modified-p nil)))))
919 921