From 5399f38aa2e2fce75944f7a9efbaa5a96d3826d9 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 19 Nov 2022 22:29:17 +0200 Subject: [PATCH] * (sweeprolog-analyze-fragment-flymake): restrict syntax errors --- sweeprolog.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sweeprolog.el b/sweeprolog.el index 2ccd786..7ea364a 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -1994,7 +1994,22 @@ resulting list even when found in the current clause." ("type_error" (cons :warning "Type error")) (`("syntax_error" ,message . ,_) - (cons :error message)) + (and (or (and sweeprolog--analyze-point + (<= (save-excursion + (goto-char sweeprolog--analyze-point) + (sweeprolog-beginning-of-top-term) + (1- (point))) + (1+ end) sweeprolog--analyze-point)) + (< (save-excursion + (goto-char sweeprolog--analyze-point) + (sweeprolog-end-of-top-term) + (point)) + (save-excursion + (goto-char sweeprolog--analyze-point) + (sweeprolog-beginning-of-next-top-term) + (point)) + (point-max))) + (cons :error message))) ("unused_import" (cons :note "Unused import")) ("undefined_import" -- 2.39.2