A marker maintains a position in the buffer, which stays valid across arbitary editing operations. A marker's position can be get and set using pos
.
marker
inherits (standard-object)
pos
with-marker
((marker marker-or-pos &optional (advance-p t)) &body body)
When an insertion happens at a marker, the marker may get pushed after the inserted contents (it advances), or stay before the inserted contents (it does not advance). This property can be queried and set using:
advance-p
(marker)
Neomacs has a global marker ring. Various commands which move between buffer (e.g. goto-definition
) save current focused positions onto the global marker ring before moving, so that you can revisit them later.
push-global-marker
(&optional (marker (copy-marker (focus))))
*marker-ring-index*
is not 0 when this function is called, that
many markers are deleted from the top of the marker ring (i.e. if
there were pop-global-marker
invocations, the popped markers are
truly lost).M-,
): pop-global-marker
()
C-M-,
): unpop-global-marker
()
pop-global-mark
.*marker-ring*
*marker-ring-index*
pop-global-marker
.