ocaml / tuareg

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

"Mismatched parentheses" when closing comment #269

Closed mattiase closed 3 years ago

mattiase commented 3 years ago

Often but not always, typing the closing *) of a comment elicits a "Mismatched parentheses" message in the minibuffer. It incorrectly leads the user to believe that something is wrong. The most useful behaviour would be: no message, but a blink to the start of the comment.

I managed to suppress the message by installing a shim around the SMIE-installed blink-matching-check-function, but it doesn't give the desired blink. It's perhaps good enough, but maybe this should be handled directly in blink-matching-open in Emacs and thus provide both an accurate warning and a blink.

mattiase commented 3 years ago

Still undecided whether to recommend PR #270 or attempt fixing it in Emacs – the latter would (it is believed) give a nice matching blink and potentially fix it for other modes, but only helps users with Emacs 28. What do you think?