* global-mark-ring behavior
@ 2013-02-20 10:32 Thierry Volpiatto
0 siblings, 0 replies; only message in thread
From: Thierry Volpiatto @ 2013-02-20 10:32 UTC (permalink / raw
To: emacs-devel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-02-20 10:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20 10:32 global-mark-ring behavior Thierry Volpiatto
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.