From d7b3dd6f8707f50ea7538b0ecbe829002d6db8b1 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 19 Nov 2022 21:19:38 +0200 Subject: [PATCH] * (sweeprolog-maybe-syntax-error-face): don't error in top-level --- sweeprolog.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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)) -- 2.39.2