]> git.eshelyaron.com Git - sweep.git/commitdiff
* (sweeprolog-maybe-syntax-error-face): don't error in top-level
authorEshel Yaron <me@eshelyaron.com>
Sat, 19 Nov 2022 19:19:38 +0000 (21:19 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 19 Nov 2022 19:19:38 +0000 (21:19 +0200)
sweeprolog.el

index 74af0879cdc6f37441140fd823cf43003f7d1c58..92cc38d8e4adf1f4425b9cdfebc5560f65c0ad2c 100644 (file)
@@ -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))