【资料图】
使用emacs内置函数来跳转到变量的源代码函数定义位置。
Emacs有几种方法可以在不安装任何额外包的情况下浏览每种语言的方法和函数定义。
To find the definition of a specific identifier (i.e.: function, method, class, etc) we can use M-. which is bound to xref-find-definitionsand it will look for the identifier at point.
To get back where you previously were, use M-, which invokes xref-pop-marker-stack and pops back to where M-. was last invoked.
The above behaviour is possible due to the Marker stack which pushes each time with xref-find-definitions and pops from the stack with xref-pop-marker-stack.
To look for a regex pattern we use C-M-. which invokes (xref-find-apropos).
This is useful also to look for all the classes defined in the project, or functions, for example in Python: C-M-. class would retrieve all the classes known by the backend.