[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How to examine the mark ring?
From: |
Drew Adams |
Subject: |
RE: How to examine the mark ring? |
Date: |
Tue, 21 Apr 2015 06:45:46 -0700 (PDT) |
> > What I need is a method to examine the mark ring for which I could
> > not locate a command. C-@ is used to push the point or posn into the
> > mark ring stack or LIFO.
> >
> > I tried with apropos to find a suitable command or variable but as a
> > newbie, I could not find one.
>
> There is a variable "mark-ring", so I'd try "C-h v RET mark-ring RET".
> This'll show its current (buffer-local) value.
There are two rings of markers: `global-mark-ring' and `mark-ring'.
The latter is buffer-local: all markers (except the current mark) in
a given buffer. The former is global: (at most) one marker per buffer.
`mark-ring' does not include the current mark - that is the value
of `(mark-marker)'. So if you want all markers in the current buffer
then use something like this:
(if (and (mark-marker) (marker-buffer (mark-marker)))
(cons (mark-marker) (copy-sequence mark-ring))
(copy-sequence mark-ring))
(The reason you might want to use `copy-sequence' is in case
you want to do something to/with the list of markers, and you
don't want to modify the original list.