all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: global-mark-ring behavior
Date: Wed, 20 Feb 2013 11:32:50 +0100	[thread overview]
Message-ID: <87mwuzff71.fsf@gmail.com> (raw)

Hi,
It is convenient to use mark-ring to retrieve different places in a
buffer.
Using the global-mark-ring is a little bit more inconvenient because
once it have recorded a position in a buffer, it doesn't update this
position if user set the mark in another place in this buffer.
Is there a particular reason to not update this new position ?
I would prefer something like this:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/simple.el b/lisp/simple.el
index 138c242..c831a29 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4388,8 +4388,8 @@ In Transient Mark mode, activate mark if optional third arg ACTIVATE non-nil."
   (if (and global-mark-ring
 	   (eq (marker-buffer (car global-mark-ring)) (current-buffer)))
       ;; The last global mark pushed was in this same buffer.
-      ;; Don't push another one.
-      nil
+      ;; Set it to this new position.
+      (setcar global-mark-ring (copy-marker (mark-marker)))
     (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
     (when (> (length global-mark-ring) global-mark-ring-max)
       (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil)
--8<---------------cut here---------------end--------------->8---

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




                 reply	other threads:[~2013-02-20 10:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=87mwuzff71.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.