unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: tomas@tuxteam.de, gnuist006@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: RE: How to examine the mark ring?
Date: Tue, 21 Apr 2015 06:45:46 -0700 (PDT)	[thread overview]
Message-ID: <b0b42051-f1ec-45e3-bea9-a4791fc7ac60@default> (raw)
In-Reply-To: <20150421101705.GA24384@tuxteam.de>

> > 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.



  reply	other threads:[~2015-04-21 13:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  9:53 How to examine the mark ring? gnuist006
2015-04-21 10:17 ` tomas
2015-04-21 13:45   ` Drew Adams [this message]
2015-04-21 14:10     ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0b42051-f1ec-45e3-bea9-a4791fc7ac60@default \
    --to=drew.adams@oracle.com \
    --cc=gnuist006@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).