From: Eshel Yaron Date: Sat, 19 Nov 2022 19:19:38 +0000 (+0200) Subject: * (sweeprolog-maybe-syntax-error-face): don't error in top-level X-Git-Tag: V8.5.20-sweep-0.8.9~7 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d7b3dd6f8707f50ea7538b0ecbe829002d6db8b1;p=sweep.git * (sweeprolog-maybe-syntax-error-face): don't error in top-level --- diff --git a/sweeprolog.el b/sweeprolog.el index 74af087..92cc38d 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -1717,12 +1717,13 @@ resulting list even when found in the current clause." (font-lock-unfontify-region beg end))) (defun sweeprolog-maybe-syntax-error-face (end) - (or (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)) + (or (and (or (derived-mode-p 'sweeprolog-top-level-mode) + (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))