Closed dbuenzli closed 9 years ago
That's already the case, in both tuareg-mode and caml-mode, using merlin-type-face
.
What should be done then ? It doesn't work here. I had a look in the customization group and that's what's in there:
((t
(:inherit
(caml-types-expr-face))))
That's the way I invoke caml-mode
and merlin-mode
(i.e. nothing fancy is done):
(autoload 'caml-mode "caml" "Major mode for editing OCaml code." t)
(add-hook 'caml-mode-hook
(lambda ()
; (electric-indent-local-mode -1)
;; Remove trailing white-space
(add-to-list 'write-file-functions
'delete-trailing-whitespace)))
(autoload 'run-caml "inf-caml" "Run an inferior OCaml process." t)
(autoload 'camldebug "camldebug" "Run ocamldebug on program." t)
(add-to-list 'interpreter-mode-alist '("ocamlrun" . caml-mode))
(add-to-list 'interpreter-mode-alist '("ocaml" . caml-mode))
(if window-system (require 'caml-font))
; merlin-iedit
(add-to-list 'load-path "~/.emacs.d/iedit")
(require 'merlin-iedit)
; merlin
(require 'merlin)
(add-to-list 'company-backends 'merlin-company-backend)
(add-hook 'caml-mode-hook 'merlin-mode t)
(setq merlin-use-auto-complete-mode 'easy)
(setq merlin-command 'opam)
(setq merlin-error-on-single-line t)
Perhaps the face you are using happens to have the same background colour as the frame?
You can test this easily:
M-x customize-face merlin-type-face
merlin-type-enclosing
and see whether the typed part of the buffer is fabulous.If it is, you just need to adjust your theme a little for visibility.
Thanks @gsg but that didn't do it. I have no particular theme, everything is "factory" defaults. In fact the problem is this. It seems that caml-types-expr-face
is not defined until the first time you usecaml-mode
's caml-types-show-types
command. If I use it once then merlin highlights correctly. So here's the way I fixed it:
; merlin
(require 'merlin)
(require 'caml-types)
@def-lkb I don't really know how merlin
and the ocaml modes interact, can maybe merlin require the thing for me ?
@dbuenzli done (in merlin-simplify branch, which should become master this week)
Thanks !
Should temporarily highlight the expression whose type is being show. See e.g.
caml-mode
's mode implementation of the feature.