Next: , Previous: , Up: The Mark and the Region   [Contents][Index]

13.5 The Global Mark Ring

In addition to the ordinary mark ring that belongs to each buffer, Emacs has a single global mark ring. Each time you set a mark, this is recorded in the global mark ring in addition to the current buffer’s own mark ring, if you have switched buffers since the previous mark setting. Hence, the global mark ring records a sequence of buffers that you have been in, and, for each buffer, a place where you set the mark. The length of the global mark ring is controlled by global-mark-ring-max, and is 16 by default.

Note that a mark is recorded in the global mark ring only when some command sets the mark. If an existing mark is merely activated, as is the case when you use C-SPC where a mark is already set (see Setting the Mark), that doesn’t push the mark onto the global ring.

The command C-x C-SPC (pop-global-mark) jumps to the buffer and position of the latest entry in the global ring. It also rotates the ring, so that successive uses of C-x C-SPC take you to earlier buffers and mark positions.