Suppose I store the current mark into a variable using
(mark-marker). Then I move point elsewhere and insert some text. Which function should I use to jump to the saved mark?
Save the mark as a marker:
(setq my-var (mark-marker))
This works regardless of the buffer where you set the variable to the marker:
(let ((buf (marker-buffer foo))) (switch-to-buffer buf)(goto-char foo))
Or if you want to go to that place temporarily, in Lisp code (i.e., without switching to that buffer):
(with-current-buffer (marker-buffer foo) (goto-char foo))
goto-char function works. It will teleport you to the mark in the same buffer.