emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 8a0ca12bba: ENHANCED: conditional syntax error


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 8a0ca12bba: ENHANCED: conditional syntax error highlighting
Date: Thu, 17 Nov 2022 05:59:28 -0500 (EST)

branch: elpa/sweeprolog
commit 8a0ca12bbada5c44ac5c820aa217f09327b1f30a
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ENHANCED: conditional syntax error highlighting
---
 sweeprolog.el | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/sweeprolog.el b/sweeprolog.el
index 58279bd5c1..8e25b30b96 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -1719,6 +1719,23 @@ resulting list even when found in the current clause."
   (with-silent-modifications
     (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))
+               (< (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)))
+           (sweeprolog-syntax-error-face))
+      (sweeprolog-around-syntax-error-face)))
+
 (defun sweeprolog-analyze-fragment-to-faces (beg end arg)
   (pcase arg
     (`("comment" . "structured")
@@ -1795,13 +1812,7 @@ resulting list even when found in the current clause."
            (setq cur (point)))
          (skip-chars-forward " \t\n")
          (push (list cur (point) nil) ws)
-         (let ((face (or (and (or (and sweeprolog--analyze-point
-                                       (<= end sweeprolog--analyze-point))
-                                  (< (save-excursion
-                                       (sweeprolog-end-of-top-term) (point))
-                                     (point-max)))
-                              (sweeprolog-syntax-error-face))
-                         (sweeprolog-around-syntax-error-face))))
+         (let ((face (sweeprolog-maybe-syntax-error-face end)))
            (cons (list beg (point) nil)
                  (append (list (list eb ee nil)
                                (list eb ee 
(sweeprolog-around-syntax-error-face))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]