我聽說我們可以註釋ocaml編。由他們的類型。在論壇上一位年長的線程使用的 http://cristal.inria.fr/~remy/poly/emacs/index.html天真的問題,如何鍵入註釋我的ocaml編。在emacs
我一直在使用圖阿雷格模式,其中使用的「C-C C-T」檢索類型的建議ocaml的模式建議,比照。這段代碼在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")
這裏是CAML模式的文件(其中包含ocaml.el)
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中,被稱爲 「annot.ml」
let rec f n =
if n = 1 then 0 else n * f(n-1)
--ocamlc -annot annot.ml
通過emacs的,然後按 「CC CT」 而光標下的 「n」--open annot.ml
我在Emacs
c-c c-t undefined
結論,我仍然無法檢索類型的迷你緩衝區了。爲什麼???謝謝你的想法。
更多信息:當我嘗試M-X caml- [標籤]我得到了下面的列表,其中不包含CAML類型秀類型
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
? ['M-x caml-types-show-type'] – Orbling
這確實有用! – zell