I would like the ability to go back and forth through a series of stored recent cursor positions, say up to 100 of them. Specifically, a position should be recorded when I click somewhere, or when I do a find operation that causes me to jump to a different location in the file. Ideally, I would be able to go back to the previous stored position, then back forward again through the list of positions, if I choose to do so.
Is there some preexisting way to do this? Alternatively, is there a relatively easy way to design a function to do this? Say, to set hooks for a cursor position change, then update some global array when such a hook is activated?
I don't care whether positions are stored per-buffer or per-window or per-frame (although per-buffer would probably be better).
exchange-point-and-mark sort of does this (after a find operation; doesn't pay attention to mouse click position), on a much smaller scale.