From: Eshel Yaron Date: Tue, 22 Nov 2022 14:24:12 +0000 (+0200) Subject: * (sweeprolog-hole-face): new face for highlighting holes X-Git-Tag: V8.5.20-sweep-0.8.12~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c31bd2bde3b2b233f23052ef95403f22cf86c14;p=sweep.git * (sweeprolog-hole-face): new face for highlighting holes --- diff --git a/sweeprolog.el b/sweeprolog.el index d1c585b..5072cd9 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -1743,6 +1743,12 @@ resulting list even when found in the current clause." (:inherit font-lock-doc-face :foreground "green") "Structured comments.") +(sweeprolog-defface + hole + (:box t) + (:box t) + (:box t) + "Holes.") ;;;; Font-lock @@ -1805,7 +1811,9 @@ resulting list even when found in the current clause." (`("goal" "recursion" . ,_) (list (list beg end (sweeprolog-recursion-face)))) (`("goal" "meta" . ,_) - (list (list beg end (sweeprolog-meta-face)))) + (cons (list beg end (sweeprolog-meta-face)) + (when (get-text-property beg 'sweeprolog-hole) + (list (list beg end (sweeprolog-hole-face)))))) (`("goal" "built_in" . ,_) (list (list beg end (sweeprolog-built-in-face)))) (`("goal" "undefined" . ,_) @@ -1889,7 +1897,9 @@ resulting list even when found in the current clause." ("control" (list (list beg end (sweeprolog-control-face)))) ("var" - (list (list beg end (sweeprolog-variable-face)))) + (cons (list beg end (sweeprolog-variable-face)) + (when (get-text-property beg 'sweeprolog-hole) + (list (list beg end (sweeprolog-hole-face)))))) ("fullstop" (save-excursion (goto-char (min end (point-max)))