branch: elpa/sweeprolog
commit 61d5576e4b61b546697297e071be775e70a2325c
Author: Eshel Yaron <m...@eshelyaron.com>
Commit: Eshel Yaron <m...@eshelyaron.com>

    Do not highlight other occurrences of anonymous variables
    
    * sweeprolog.el (sweeprolog-analyze-fragment-variable): check for
    anonymous variables ("_").
---
 sweeprolog.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sweeprolog.el b/sweeprolog.el
index 32642997af..94ccb26072 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -2089,9 +2089,11 @@ resulting list even when found in the current clause."
     ((or "var"
          `("goal_term" "meta" variable 0))
      (let ((var (buffer-substring-no-properties beg end)))
-       (with-silent-modifications
-         (put-text-property beg end 'cursor-sensor-functions
-                            (sweeprolog-cursor-sensor-functions var)))))))
+       (unless (string= var "_")
+         (with-silent-modifications
+           (put-text-property beg end 'cursor-sensor-functions
+                              (sweeprolog-cursor-sensor-functions
+                               var))))))))
 
 (defvar sweeprolog-analyze-region-start-hook
   '(sweeprolog-analyze-start-font-lock))

Reply via email to