Closed Fourchaux closed 3 years ago
Yes, I noticed that too and agree it's a bit annoying when evaluating several phrases in a row with C-M-x and suddenly getting stuck because of a ;;
on a line of its own.
From looking at the source it might be intentional – see tuareg--skip-backward-comments-semicolon
and tuareg--skip-forward-comments-semicolon
for example. There could be subtleties involved. Let's hear what the maintainers have to say about it.
I doubt these subtleties in those functions are meant to provide the behavior under discussion.
But FWIW, I'm probably not the right person to answer since I consider double-semi-colons in files to be non-kosher.
I think most people avoid ;;
, but they often remain when they do get inserted for whatever reason – as when the compiler throws a seemingly nonsensical error that needs to be narrowed down. They are also very common in test suites, which can be quite useful to run piecemeal using C-M-x.
Double-semis are also used a lot by students learning the language and we should be nice to them once in a while.
Double-semis are also used a lot by students learning the language and we should be nice to them once in a while.
I'm not arguing in favor of Tuareg misbehaving in the presence of double-semis; I was just pointing out that I never use them so I don't have a reliable intuition for what Tuareg should do with them.
@mattiase Skipping lines that only contain ;; would already be a very big improvement.
BTW, this "style" is used by some big guns: X. Leroy: https://github.com/ocaml/ocaml/blob/trunk/parsing/location.ml or D.Doligez: https://github.com/ocaml/ocaml/blob/trunk/driver/main_args.ml (for the first reason you give - improving the error messages - I suppose).
( tuareg 20210709.321 - OCaml 4.12.0 - Emacs 28.0.50 )
e.g.
After a "tuareg-eval-phrase" the cursor jumps to the beginning of the next phrase. OK.
- Exception 1:
The cursor jumps to ;; and stays there.
- Exception 2:
Idem.
Note:
This is OK. The cursor jumps to the second line.
Do you think it would be possible to correct these movements?