3

英語が下手でごめんなさい。

私はerlangflymakeで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
4

2 に答える 2

2

2つのerlang-flymake変数(erlang-flymake-get-include-dirs-functionerlang-flymake-get-code-path-dirs-function)があり、include&ebinディレクトリを検索する関数を指定します。現在、それらは関数erlang-flymake-get-include-dirsを指しており、それに応じて現在のdir+をerlang-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")))

PSプロジェクトを維持するために鉄筋を使用していますか?

于 2012-12-18T07:21:33.507 に答える
1

erlang-flymakeを使用する場合は、https://github.com/ten0s/syntaxerlを参照してください。これはErlangの構文チェッカーです。内部ではerlang-flymakeを使用しますが、 `erlc'の代わりに、.erl、.hrl、.config、.rel、.app、.app.src、.escriptファイルを評価できるカスタム構文チェッカーを使用します。構文チェッカーは鉄筋を認識しますが、標準のErlang/OTPディレクトリ構造でも機能します。Emacsのセットアップもあります。

于 2012-12-21T08:47:36.033 に答える