Today’s tip is one I learned from Magnar. A lot of Emacsers don’t know this, but
most commands that move point large distances (like isearch or
end-of-buffer) push the old position to the mark-ring. The advantage is that
you can easily jump back through this history of positions by hitting C-u
C-SPC.
This is a hugely convenient take-me-back-to-that-last-place command. The only
problem is that sometimes the ring gets filled with repeated entries, so you
find yourself hitting C-u C-SPC 2 to 4 times in the same place. Of course,
this is Emacs, so all it takes to solve our problem is one simple advice.
Finally, a simple setq ensures we can quickly pop the mark several times by
typing C-u C-SPC C-SPC, instead of having to type C-u C-SPC C-u C-SPC.
Update 20 Jan 2016
Kaushal Modi provides us with how this advice would look using the new
advice-add interface.
Faster pop-to-mark command
21 Dec 2015, by Artur Malabarba.Today’s tip is one I learned from Magnar. A lot of Emacsers don’t know this, but most commands that move point large distances (like
isearch
orend-of-buffer
) push the old position to themark-ring
. The advantage is that you can easily jump back through this history of positions by hitting C-u C-SPC.This is a hugely convenient take-me-back-to-that-last-place command. The only problem is that sometimes the ring gets filled with repeated entries, so you find yourself hitting C-u C-SPC 2 to 4 times in the same place. Of course, this is Emacs, so all it takes to solve our problem is one simple advice.
Finally, a simple
setq
ensures we can quickly pop the mark several times by typing C-u C-SPC C-SPC, instead of having to type C-u C-SPC C-u C-SPC.Update 20 Jan 2016
Kaushal Modi provides us with how this advice would look using the new
advice-add
interface.Tags: navigation, convenience, init.el, emacs,
New in Emacs 25.1: Have prettify-symbols-mode reveal the symbol at point »
« Improving Emacs file-name completion
Related Posts
A quick guide to directory-local (or project-specific) variables in convenience
Fill and unfill paragraphs with a single key in convenience
Commands to thread and unwind code in Emacs-Lisp in convenience
Content © 2019, All rights reserved. Icons under CC3.0.