Fix utop-eval-phrase on recent tuareg-mode
tuareg-next-phrase was moved to tuareg_indent.el in ocaml/tuareg@b40e733c1 and removed entirely in ocaml/tuareg@b2ad75f3d5 (September 2017). As a result, utop-eval-phrase crashes due to the missing function. Instead, write a small function to move to the next phrase, similar to the movement logic in tuareg-eval-phrase.
This commit is contained in:
parent
0bee8c9297
commit
2d358b2d9c
|
@ -272,9 +272,19 @@ modes you need to set these variables:
|
||||||
" major-mode))))
|
" major-mode))))
|
||||||
choices))
|
choices))
|
||||||
|
|
||||||
|
(defun utop-tuareg-next-phrase ()
|
||||||
|
"Move to the next phrase after point."
|
||||||
|
(let* ((pos (tuareg--after-double-colon))
|
||||||
|
(pos (if pos pos (point)))
|
||||||
|
(phrase (tuareg-discover-phrase pos)))
|
||||||
|
(when phrase
|
||||||
|
(goto-char (caddr phrase))
|
||||||
|
(tuareg--skip-double-colon)
|
||||||
|
(tuareg-skip-blank-and-comments))))
|
||||||
|
|
||||||
(defun utop-compat-next-phrase-beginning ()
|
(defun utop-compat-next-phrase-beginning ()
|
||||||
(funcall
|
(funcall
|
||||||
(utop-compat-resolve '(tuareg-next-phrase
|
(utop-compat-resolve '(utop-tuareg-next-phrase
|
||||||
typerex-skip-to-end-of-phrase
|
typerex-skip-to-end-of-phrase
|
||||||
caml-skip-to-end-of-phrase
|
caml-skip-to-end-of-phrase
|
||||||
reason-next-phrase))))
|
reason-next-phrase))))
|
||||||
|
|
Loading…
Reference in New Issue