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

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

[nongnu] elpa/caml a95aaca 03/10: [fix] Update the regexp for OCaml erro


From: ELPA Syncer
Subject: [nongnu] elpa/caml a95aaca 03/10: [fix] Update the regexp for OCaml errors
Date: Wed, 25 Aug 2021 02:57:18 -0400 (EDT)

branch: elpa/caml
commit a95aaca42e86473cc3aae9dc90f763251e38ab90
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    [fix] Update the regexp for OCaml errors
---
 caml.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/caml.el b/caml.el
index b8f1196..30451e6 100644
--- a/caml.el
+++ b/caml.el
@@ -796,8 +796,17 @@ variable `caml-mode-indentation'."
   "Regular expression matching the error messages produced by ocamlc/ocamlopt.
 Also matches source references in exception backtraces.")
 
+(defun caml--end-column ()
+  "Return the end-column number in a parsed OCaml message.
+OCaml uses exclusive end-columns but Emacs wants them to be inclusive."
+  (and (match-beginning 7)
+       (+ (string-to-number (match-string 7))
+          ;; Prior to Emacs 28, the end-column function value was incorrectly
+          ;; off by one.
+          (if (>= emacs-major-version 28) -1 0))))
+
 (when (boundp 'compilation-error-regexp-alist-alist)
-  (push `(ocaml ,caml--error-regexp 3 (4 . 5) (6 . tuareg--end-column) (8) 1
+  (push `(ocaml ,caml--error-regexp 3 (4 . 5) (6 . caml--end-column) (8) 1
                 (8 font-lock-function-name-face))
         compilation-error-regexp-alist-alist))
 



reply via email to

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