ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.57k stars 233 forks source link

emacs: auto-complete mode is not working after upgrading from 4.1-412 to 4.2-412 #1320

Open kit-ty-kate opened 3 years ago

kit-ty-kate commented 3 years ago

Here is the part of my config related to merlin:

;; autocomplete
(require 'auto-complete)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)

;; Merlin
(let ((opam-share (ignore-errors (car (process-lines "opam" "var" "share")))))
 (when (and opam-share (file-directory-p opam-share))
  (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
  (autoload 'merlin-mode "merlin" nil t nil)
  (autoload 'merlin-iedit "merlin-iedit" nil t nil)
  (require 'merlin)
  (require 'merlin-iedit)
  (add-hook 'tuareg-mode-hook 'merlin-mode t)
  (add-hook 'caml-mode-hook 'merlin-mode t)
  (defun evil-custom-merlin-iedit ()
   (interactive)
   (if iedit-mode (iedit-mode)
    (merlin-iedit-occurrences)))
  (define-key merlin-mode-map (kbd "M-r") 'evil-custom-merlin-iedit)
  (setq merlin-use-auto-complete-mode 'easy)
  (setq merlin-command 'opam)))

I upgraded from 4.1-412 to 4.2-412 and now M-TAB does not show the auto-complete side-tab anymore but only the *Completion* buffer from the bottom of the screen.

Before: scrn-2021-04-16-22-43-23 After: scrn-2021-04-16-22-41-45

kit-ty-kate commented 3 years ago

ok after reading the diff and the changes to the README I realised that the auto-complete mode had been moved to a different module. However such a change should have been added to the post-message in the opam file on opam-repository so that users get notified about this change.

samoht commented 3 years ago

@kit-ty-kate I think I've just hit this issue ; what fix did you apply to recover auto-completion in emacs?

samoht commented 3 years ago

So apparently the right runes to add to .emacs are now:

(require 'merlin-ac)
(setq merlin-ac-setup 'easy)