help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Tips for quick jumping back and forth


From: Eric Abrahamsen
Subject: Re: Tips for quick jumping back and forth
Date: Wed, 11 Jul 2012 22:40:11 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux)

On Wed, Jul 11 2012, Dmitry Gutov wrote:

> Philipp Haselwarter <philipp@haselwarter.org> 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




reply via email to

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