Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump back from find-tag in Emacs

Tags:

emacs

etags

I'm using find-tag function M-. to jump to function definition, how can I jump back to previous location?

like image 451
jcubic Avatar asked Mar 23 '14 09:03

jcubic


People also ask

How do you get to the top of a file in emacs?

Ctrl-O is its complement, moving forward through the jumplist. gg jumps to the top of the file, so Ctrl-I then jumps back. The equivalent to Ctrl-I in Emacs would be C-u C-space .

What are emacs tags?

The emacs editors can use the index file(s) produced by etags to search for a requested function name, defined name, or global variable, etc. Each of these search names are referred to as a tag. If the tag is found in the index, it will open the file containing the searched for tag in a new buffer.

How do I use Ctags in emacs?

To use ctags with emacs, you must supply the '-e' parameter to instruct ctags to generate an emacs tag file. The commands below are often sourced into a Makefile and then run with a CompileCommand. Ctags also has a recursive option, '-R' . This is the most common (and simple) usage.


1 Answers

M-. calls xref-find-definitions in recent versions of Emacs. I use M-,, which is bound to xref-pop-marker-stack, to return back. You can even use it to recursivelly return from a deeper search.

In older Emacs versions, M-. was bound to find-tag which worked similarly. The inverse function was pop-tag-mark by default bound to M-*.

like image 129
choroba Avatar answered Oct 20 '22 20:10

choroba