From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Tips for quick jumping back and forth Date: Wed, 11 Jul 2012 22:40:11 +0800 Message-ID: <87pq822wgt.fsf@ericabrahamsen.net> References: <4FFD814E.8020702@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342017665 31464 80.91.229.3 (11 Jul 2012 14:41:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2012 14:41:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 16:41:03 2012 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Soy65-00038L-EW for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2012 16:40:57 +0200 Original-Received: from localhost ([::1]:49656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soy64-0000gE-Hh for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2012 10:40:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soy5n-0000Zo-1L for help-gnu-emacs@gnu.org; Wed, 11 Jul 2012 10:40:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Soy5g-0001aH-La for help-gnu-emacs@gnu.org; Wed, 11 Jul 2012 10:40:38 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soy5g-0001Yd-FA for help-gnu-emacs@gnu.org; Wed, 11 Jul 2012 10:40:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Soy5a-0002Ij-KZ for help-gnu-emacs@gnu.org; Wed, 11 Jul 2012 16:40:26 +0200 Original-Received: from 50-56-99-223.static.cloud-ips.com ([50.56.99.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jul 2012 16:40:26 +0200 Original-Received: from eric by 50-56-99-223.static.cloud-ips.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jul 2012 16:40:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 50-56-99-223.static.cloud-ips.com X-Pgp-Key: http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0xC98BAE7B99D0D373 X-Pgp-Fingerprint: 8E19 28A9 2B51 0C67 565D DB34 C98B AE7B 99D0 D373 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:n5jVu4o2YE5REjpbg1g7kIopth8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85798 Archived-At: On Wed, Jul 11 2012, Dmitry Gutov wrote: > Philipp Haselwarter writes: >> It'd be neat if there were different ways to navigate through the ring; >> when I discovered Toby Cubitt's excellent undo-tree-mode it somewhat >> revolutionized my editing habits. I imagine that having a tree-like >> representation of the marks that allows to easily navigate back and >> forth would be very pleasant. > > Not sure about sideways navigation, but at least going back and forward > between marks would be an improvement. > > The distinction between local and global mark rings also, I think, > complicates things. Since this thread seems determined to live forever, here are two useful functions I copied from the interwebs somewhere: --8<---------------cut here---------------start------------->8--- (defun jump-to-mark () "Jumps to the local mark, respecting the `mark-ring' order. This is the same as using \\[set-mark-command] with the prefix argument." (interactive) (set-mark-command 1)) (global-set-key (kbd "M-`") 'jump-to-mark) (defun push-mark-no-activate () "Pushes `point' to `mark-ring' and does not activate the region Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled" (interactive) (push-mark (point) t nil) (message "Pushed mark to ring")) (global-set-key (kbd "C-`") 'push-mark-no-activate) --8<---------------cut here---------------end--------------->8--- I use "C-x C-SPC" for cycling through the global mark, and "M-`" for cycling the local one. E -- GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-07-08 on pellet