ocaml / tuareg

Emacs OCaml mode
GNU General Public License v3.0
360 stars 79 forks source link

Debugger entered--Lisp error: (void-function tuareg--after-double-colon) #228

Closed shakthimaan closed 3 years ago

shakthimaan commented 4 years ago

I am using GNU Emacs 26.3 with opam (2.0.5), utop (2.4.3), merlin (3.3.3), merlin-eldoc and tuareg (2.1.0-1), and I am getting the following error with C-x C-e:

Debugger entered--Lisp error: (void-function tuareg--after-double-colon)
  (tuareg--after-double-colon)
  (let* ((pos (tuareg--after-double-colon)) (pos (if pos pos (point))) (phrase (tuareg-discover-phrase pos))) (if phrase (progn (goto-char (car (cdr (cdr phrase)))) (tuareg--skip-double-colon) (tuareg-skip-blank-and-comments))))
  utop-tuareg-next-phrase()
  funcall(utop-tuareg-next-phrase)
  utop-compat-next-phrase-beginning()
  funcall(utop-compat-next-phrase-beginning)
  (progn (goto-char end) (funcall utop-next-phrase-beginning))
  (if utop-skip-after-eval-phrase (progn (goto-char end) (funcall utop-next-phrase-beginning)))
  (let ((end)) (save-excursion (let ((triple (funcall utop-discover-phrase))) (setq end (nth 2 triple)) (utop-eval (nth 0 triple) (nth 1 triple)))) (if utop-skip-after-eval-phrase (progn (goto-char end) (funcall utop-next-phrase-beginning))))
  utop-eval-phrase()
  funcall-interactively(utop-eval-phrase)
  call-interactively(utop-eval-phrase nil nil)
  command-execute(utop-eval-phrase)

The line in test.ml contains - print_string "Hello, World!" and it executes fine, but, the error message pops up. My Emacs init.el setup for OCaml and RWOv2 is as follows:

  ;; Automatically load utop.el
  (setq utop-command "opam config exec -- utop -emacs")
  (autoload 'utop "utop" "Toplevel for OCaml" t)

  ;; -- opam and utop setup --------------------------------
  ;; Setup environment variables using opam
  (dolist
     (var (car (read-from-string
           (shell-command-to-string "opam config env --sexp"))))
    (setenv (car var) (cadr var)))

  ;; Update the emacs path
  (setq exec-path (split-string (getenv "PATH") path-separator))

  ;; Update the emacs load path
   (push (concat (getenv "OCAML_TOPLEVEL_PATH")
            "/../../share/emacs/site-lisp") load-path)

  (require 'tuareg)
  (setq auto-mode-alist
        (append '(("\\.ml[ily]?$" . tuareg-mode)
                  ("\\.topml$" . tuareg-mode))
                auto-mode-alist))

  (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
  (add-hook 'tuareg-mode-hook 'utop-minor-mode)

  (add-hook 'tuareg-mode-hook 'merlin-mode)
  (setq merlin-use-auto-complete-mode t)
  (setq merlin-error-after-save nil)

  (require 'merlin-eldoc)
  (add-hook 'tuareg-mode-hook 'merlin-eldoc-setup)

Any suggestions?

Chris00 commented 3 years ago

The error comes from utop-eval-phrase that uses an internal function of Tuareg which was removed. Please report the error to utop.