(defun ocaml-lookup-module ()
(interactive) ;; to run from keybinding
(let ((sym (thing-at-point 'symbol)))
(if sym
(shell-command
(concat "firefox http://caml.inria.fr/pub/docs/manual-ocaml/libref/"
(concat sym ".html")))
)))
then add the binding w/ something like this:
(add-hook 'tuareg-mode-hook
(lambda ()
(define-key tuareg-mode-map (kbd "M-?") 'ocaml-lookup-module)))
To use it from tuareg (or ocaml) mode, put your cursor over the name of an Ocaml standard library module (e.g. "Set" if you have the text "Set.union ..." in your source) and hit "M-?"
No comments:
Post a Comment