ok, so I found out what I was doing wrong. I had this in my .emacs
:
; huh, C-c C-t is overridden by ocp-index-print-info-at-point,
; which kind of does the same thing but misses some type info.
(global-set-key (kbd "C-c t") 'merlin-type-enclosing)
which is probably wrong in more than one way. The main problem is that it overrides the original “C-c t” shortcut that would let me see the type of a module.
After commenting out the above, “C-c t” shows me the signature of the module under the cursor in another buffer, which is great. And “C-c C-t” is back to calling ocp-index-print-info-at-point
which doesn’t fully work and often blocks for several seconds.
For the record, the problematic behavior happens after leaving just this in my ~/.emacs
:
;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line
(require 'opam-user-setup "~/.emacs.d/opam-user-setup.el")
;; ## end of OPAM user-setup addition for emacs / base ## keep this line
The instructions I think I followed and turned into a script for setting up emacs for OCaml development are:
opam install -y merlin
opam user-setup install
opam install -y ocp-indent ocp-index
# emacs only
opam install -y tuareg
Am I installing too much? Did I start from a dirty state? Maybe. The point is that it’s hard to tell.