emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/tuareg 954ffd3 2/2: Merge "Suppress bogus 'Mismatched pare


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 954ffd3 2/2: Merge "Suppress bogus 'Mismatched parentheses' at end of comment"
Date: Fri, 3 Sep 2021 18:57:44 -0400 (EDT)

branch: elpa/tuareg
commit 954ffd3d40e55f41893839934c18918cf66578a3
Merge: c09b797 862a088
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Merge "Suppress bogus 'Mismatched parentheses' at end of comment"
---
 tuareg.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tuareg.el b/tuareg.el
index 79d68e0..cad2b29 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3065,12 +3065,26 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
     (if (equal "->" (nth 2 (smie-forward-sexp "-dlpd-")))
         (smie-indent-forward-token))))
 
+(defun tuareg--blink-matching-check (start end)
+  (let ((pt (point)))
+    (if (and (> pt (+ (point-min) 3))
+             (eq (char-before) ?\))
+             (eq (char-before (1- pt)) ?*)
+             (save-excursion
+               (and (forward-comment -1)
+                    (forward-comment 1)
+                    (eq (point) pt))))
+        ;; Immediately after a comment-ending "*)" -- no mismatch error.
+        nil
+      (smie-blink-matching-check start end))))
+
 (defun tuareg--common-mode-setup ()
   (setq-local syntax-propertize-function #'tuareg-syntax-propertize)
   (setq-local parse-sexp-ignore-comments t)
   (smie-setup tuareg-smie-grammar #'tuareg-smie-rules
               :forward-token #'tuareg-smie-forward-token
               :backward-token #'tuareg-smie-backward-token)
+  (setq-local blink-matching-check-function #'tuareg--blink-matching-check)
   (tuareg--eval-when-macrop add-function
     (when (boundp 'smie--hanging-eolp-function)
       ;; FIXME: As its name implies, smie--hanging-eolp-function



reply via email to

[Prev in Thread] Current Thread [Next in Thread]