gpt4 book ai didi

emacs - 在 src 中带有嵌套文件夹的 Erlang flymake 找不到包含文件夹

转载 作者:行者123 更新时间:2023-12-02 00:14:32 25 4
gpt4 key购买 nike

抱歉我的英语不好。

我正在使用 erlang flymake 配置我的 emacs。 src 的嵌套文件夹中的源文件报告“找不到包含文件”,但 src/ 文件夹中的文件可以找到包含文件。

我的 erlang emacs 设置:

;; erlang-mode
(setq load-path (cons "/usr/local/Cellar/erlang/R15B02/lib/erlang/lib/tools-2.6.8/emacs" load-path))
(setq erlang-root-dir "/usr/local/Cellar/erlang/R15B02/lib/erlang")
(setq exec-path (cons "/usr/local/Cellar/erlang/R15B02/lib/erlang/bin" exec-path))
(require 'erlang-start)

;; distel
(add-to-list 'load-path "/usr/local/share/distel/elisp/")
(require 'distel)
(distel-setup)

;; erlang-flymake
(require 'erlang-flymake)
(erlang-flymake-only-on-save)

我的 erlang 应用程序文件夹如下所示:

app/src/      (source code)
src/mod
src/lib

app/include/ (hrls)
app/ebin/ (compiled code)

...etc

最佳答案

erlang-flymake 中有两个变量(erlang-flymake-get-include-dirs-functionerlang-flymake-get-code-path -dirs-function),它指定要搜索的函数包括 & ebin 目录。现在,他们指向函数 erlang-flymake-get-include-dirserlang-flymake-get-code-path-dirs 只是返回当前目录+ includeebin 对应。例如,您可以使用以下代码来执行此操作:

(defun get-erlang-app-dir ()
(let* ((src-path (file-name-directory (buffer-file-name)))
(pos (string-match "/src/" src-path)))
(if pos
(substring src-path 0 (+ 1 pos))
src-path)))

(setq erlang-flymake-get-code-path-dirs-function
(lambda ()
(concat (get-erlang-app-dir) "ebin")))

(setq erlang-flymake-get-code-include-dirs-function
(lambda ()
(concat (get-erlang-app-dir) "include")))

附言您是否使用钢筋来维护您的项目?

关于emacs - 在 src 中带有嵌套文件夹的 Erlang flymake 找不到包含文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13927247/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com