1

I am learning Emacs by doing built-in tutorial (C-h t). However, when I decide to take a break and exit the editor (C-x C-c) and then later rerun the tutorial the position when I finished before is not saved. The tutorial starts over from the beginning. Is there a way to save this position so that I do not have to remember where I finished? (Well, maybe the tutorial covers the problem in some place, but I have not yet got to it).

lukeg
  • 111
  • 1
  • 1
    https://stackoverflow.com/q/41710995/1030675 – choroba Apr 06 '19 at 10:06
  • Use C-x k to kill the tutorial buffer when you're done, and it will offer to save your position. (Evidentially this doesn't happen if you exit Emacs entirely with C-x C-c.) – phils Apr 07 '19 at 09:14

1 Answers1

0

The way you do this by default is to use C-x k to kill the buffer, and then you will be given the option to save your position.

If you want emacs to do the same check when you use C-x C-c then add the following to your .emacs file.

https://pastebin.com/YWvJWVnk

By using:

(advice-add 'help-with-tutorial :override
(defun help-with-tutorial-deals-with-c-x-c-c (...)

it adds the line:

(add-hook 'kill-emacs-query-functions 'tutorial--save-tutorial nil t)

to the function help-with-tutorial, which is now called help-with-tutorial-deals-with-x-s-x-c

harlandski
  • 101
  • 3