Emacs:搜索空间查找函数 [英] Emacs: Search-Space for Find-Function
问题描述
在 slime 模式下,我的第一个 sbcl 项目工作,正确设置emacs在我的代码中导航有困难:通常,我想跳转到函数定义(到我的源代码中的任何自定义函数)。因此, find-function 似乎是一个很好的起点。不幸的是, find-function 永远不会发现我的任何功能:[无匹配]!我的源代码位于一个简单的文件,如 geometry.lisp ,其功能定义如下:
Working on my first sbcl project in slime mode, I have trouble with setting up emacs properly for navigating within my code: Often, I would like to jump to the function definition (to any custom function within my source code) of a function. Therefore find-function seems to be a good starting point. Unfortunately, find-function never finds any of my functions: [No match]! My source code is located in a simple file like geometry.lisp with function definitions like:
(defun get-right-normal(vector)
"Computes right-normal of given vector"
(make-2d-vector :x (* -1 (2d-vector-y vector)) :y (2d-vector-x vector)))
我将源文件的路径添加到'load -path变量:
I added the path of the source file to the 'load-path variable:
(add-to-list 'load-path "/path/to/src")
find-function 的描述说
The library where FUNCTION is defined is searched for in
`find-function-source-path', if non-nil, otherwise in `load-path'.
但是尝试将`find-function-source-path / p>
But trying to set `find-function-source-path by
(add-to-list 'find-function-source-path "/path/to/src")
返回
Symbol's value as variable is void: find-function-source-path
如何设置这个变量?我做错了什么?
How can I set the value of this variable? What am I doing wrong?
推荐答案
您必须先定义事物才能要求他们的价值观。错误消息告诉您,变量 find-functions-source-path
未定义。为什么?因为你没有加载定义它的库。您需要加载库 find-func.el [c]
: (require'find-func)
。
You must define things before you can ask for their values. The error message tells you that variable find-functions-source-path
is not defined. Why? Because you have not loaded the library that defines it. You need to load library find-func.el[c]
: (require 'find-func)
.
这篇关于Emacs:搜索空间查找函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!