From 3f60ed45288efe75142cdc8959909c42e8d8ee3c Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 25 Nov 2022 16:39:09 +0200 Subject: [PATCH] Recognize and highlight XPCE string comments as docstrings * sweeprolog.el (sweeprolog-analyze-fragment-to-faces): recognize string comments. --- sweeprolog.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sweeprolog.el b/sweeprolog.el index d9bce9b..d5ecf6e 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -1761,6 +1761,13 @@ resulting list even when found in the current clause." (:inherit default) "Directives.") +(sweeprolog-defface + string-comment + (:inherit font-lock-doc-face) + (:inherit font-lock-doc-face :foreground "darkgreen") + (:inherit font-lock-doc-face :foreground "green") + "String comments.") + (sweeprolog-defface structured-comment (:inherit font-lock-doc-face) @@ -1804,6 +1811,9 @@ resulting list even when found in the current clause." (`("comment" . "structured") (list (list beg end nil) (list beg end (sweeprolog-structured-comment-face)))) + (`("comment" . "string") + (list (list beg end nil) + (list beg end (sweeprolog-string-comment-face)))) (`("comment" . ,_) (list (list beg end nil) (list beg end (sweeprolog-comment-face)))) @@ -2019,7 +2029,7 @@ resulting list even when found in the current clause." ("grammar_rule" (list (list beg end nil) (list beg end (sweeprolog-grammar-rule-face)))) ("method" - (list (list beg end (sweeprolog-method-face)))) + (list (list beg end nil) (list beg end (sweeprolog-method-face)))) ("class" (list (list beg end (sweeprolog-class-face)))))) -- 2.39.2