设置byte-compile-dest-file-function [英] Setting byte-compile-dest-file-function
问题描述
我想使用相对路径(如 ../ foo
)设置emacs lisp字节编译的目标目录。我想我应该使用 byte-compile-dest-file-function
,但不知道如何设置它。如何设置?
I want to set the destination directory for emacs lisp byte compilation using relative path such as ../foo
. I figured out I should use byte-compile-dest-file-function
, but do not know how to set it. How can I set it?
推荐答案
设置 byte-compile-dest-function
变量,您可以在init文件中交互使用 customize-variable
或 setq
。由于你必须以任何方式写一个函数做这个工作,所以我会建议后者,这样一来你的init文件就在同一个位置。
To set the byte-compile-dest-function
variable, you can use either customize-variable
interactively, or setq
in your init file. Since you'll have to write a function doing the job either way, I would recommand the latter, so that everything is in the same place in your init file.
例如:
(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)
这篇关于设置byte-compile-dest-file-function的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!