我经常遇到被告知将相对路径作为目录局部变量的情况。例如cmake-ide的cmake-ide-project-dir
和cmake-ide-build-dir
。当然,这不是很方便。
所以代替
.dir-locals.el
:
((nil . ((cmake-ide-project-dir . "/home/user/code/project"))))
我想要类似的东西
((nil . ((cmake-ide-project-dir . directory-of-current-dir-locals-file))))
如何定义这样的变量directory-of-current-dir-locals-file
?举例来说cmake-ide-build-dir
,我该如何设置(concat directory-of-current-dir-locals-file "build")
?
(locate-dominating-file default-directory ".dir-local.el")