From: Eshel Yaron Date: Sat, 19 Nov 2022 20:29:17 +0000 (+0200) Subject: * (sweeprolog-analyze-fragment-flymake): restrict syntax errors X-Git-Tag: V8.5.20-sweep-0.8.9~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5399f38aa2e2fce75944f7a9efbaa5a96d3826d9;p=sweep.git * (sweeprolog-analyze-fragment-flymake): restrict syntax errors --- 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"