From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: global-mark-ring behavior Date: Wed, 20 Feb 2013 11:32:50 +0100 Organization: Emacs Helm Message-ID: <87mwuzff71.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361356425 10381 80.91.229.3 (20 Feb 2013 10:33:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 10:33:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 20 11:34:08 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U8703-0001VV-CU for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 11:34:07 +0100 Original-Received: from localhost ([::1]:43422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86zj-0001nL-72 for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 05:33:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86zE-0000ea-95 for emacs-devel@gnu.org; Wed, 20 Feb 2013 05:33:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U86z3-0006Ht-Iu for emacs-devel@gnu.org; Wed, 20 Feb 2013 05:33:11 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:35480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86z3-0006HD-DK for emacs-devel@gnu.org; Wed, 20 Feb 2013 05:33:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U86zH-00010A-N4 for emacs-devel@gnu.org; Wed, 20 Feb 2013 11:33:19 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Feb 2013 11:33:19 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Feb 2013 11:33:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:B+WA6d7itFM/Bq2vkJ9MOOgek6Q= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157199 Archived-At: 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