emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

global-mark-ring behavior


From: Thierry Volpiatto
Subject: global-mark-ring behavior
Date: Wed, 20 Feb 2013 11:32:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]