我想使用相对路径设置emacs lisp字节编译的目标目录,比如../foo。我想我应该使用byte-compile-dest-file-function,但不知道如何设置它。如何设置?
发布于 2012-12-20 02:38:12
要设置byte-compile-dest-function变量,可以交互地使用customize-variable,或者在初始化文件中使用setq。由于您必须以任何一种方式编写一个函数来完成此工作,因此我建议使用后者,以便所有内容都在init文件中的相同位置。
例如:
(defun my-dest-function (filename)
(concat (file-name-directory filename)
"../"
(file-name-sans-extension (file-name-nondirectory filename))
".elc"))
(setq byte-compile-dest-file-function 'my-dest-function)发布于 2012-12-20 01:27:28
您可以使用C-h v后跟该变量名来找到它。
(defcustom byte-compile-dest-file-function nil
"Function for the function `byte-compile-dest-file' to call.
It should take one argument, the name of an Emacs Lisp source
file name, and return the name of the compiled file."
:group 'bytecomp
:type '(choice (const nil) function)
:version "23.2")你可以看到它是一个可定制的变量,所以你可以将它的值改为"function“。
编辑:我不太确定这是你想要改变的变量。事实上,你可以看到它经常处理变量目录,我不知道如何设置一个特定的目录,所有的.elc都应该放在那里。
https://stackoverflow.com/questions/13957049
复制相似问题