私はocaml progに注釈を付けることができると聞きました。彼らのタイプによって。フォーラムの古いスレッドはocamlモードの使用を提案しました http://cristal.inria.fr/~remy/poly/emacs/index.html私のocaml progに型名を付ける方法に関する厄介な質問。 emacsで
私はTuaregモードを使用していました。タイプを取得するために "c-c c-t"を使用することを提案しました。 tuareg.el
(when tuareg-with-caml-mode-p
;; Trigger caml-types
(define-key map [?\C-c ?\C-t] 'caml-types-show-type)
;; To prevent misbehavior in case of error during exploration.
(define-key map [(control mouse-2)] 'caml-types-mouse-ignore)
(define-key map [(control down-mouse-2)] 'caml-types-explore)
でコードのこの作品は、私はすべてがうまく構成されているように見えるが、未定義の「C-C、C-T」を得ました。ここで
はの.emacsがここ
(setq auto-mode-alist
(cons '("\\.ml[iyl]?$" . caml-mode) auto-mode-alist))
(autoload 'caml-mode "ocaml"
"Major mode for editing Caml code." t)
(autoload 'camldebug "camldebug"
"Call the camldebugger on FILE" t)
;; adjust paths for emacs source code
(add-to-list 'load-path "~/my-emacs-config/caml-mode")
;; adjust paths for emacs ocaml info sources
(require 'info)
(add-to-list 'Info-directory-list "~/my-emacs-config/caml-mode")
ファイルである(ocaml.el含まれている)CAMLモードでファイルです
bash-3.2$ ls ~/my-emacs-config/caml-mode/
caml-compat.el caml-emacs.el caml-font.el caml-help.el caml-hilit.el caml-types.el caml.el camldebug.el inf-caml.el ocaml.el
私は、次の
--writeをしました階乗関数。 OCamlでは、カーソルが "N" であるとき "annot.ml" Emacsとプレス "CCのCT" によって
let rec f n =
if n = 1 then 0 else n * f(n-1)
--ocamlc -annot annot.ml
--open annot.ml呼ば
私はemacsの
c-c c-t undefined
結論のミニバッファに入った、私はまだ種類を取得することはできません。なぜ???あなたのアイデアをありがとう。
さらに詳しい情報:私がしようとすると、M-X caml- [タブ] I取得CAML-タイプ・ショータイプのあなたはocaml.el
かocaml.elc
からcaml-mode
を自動ロードしている
Possible completions are:
caml-mode camldebug
camldebug-backtrace camldebug-break
camldebug-close camldebug-complete
camldebug-delete camldebug-display-frame
camldebug-down camldebug-finish
camldebug-goto camldebug-kill
camldebug-last camldebug-mode
camldebug-next camldebug-open
camldebug-print camldebug-refresh
camldebug-reverse camldebug-run
camldebug-step camldebug-up
を使用することを正式モード
またはこれを使用するか、これにあなたのautoloadを変更しますか? ['M-x caml-types-show-type'] – Orbling
これは機能します! – zell