!,
Kind0 =.. [Kind1|_],
atom_string(Kind1, Kind).
+sweep_color_normalized_(_, macro, [String|_], ["macro"|String]) :-
+ !.
sweep_color_normalized_(_, Nom0, _, Nom) :-
atom_string(Nom0, Nom).
(sweeprolog-defface
expanded
- (:inherit font-lock-function-name-face)
+ (:inherit font-lock-preprocessor-face)
(:foreground "blue" :underline t)
(:foreground "cyan" :underline t)
"Expanded predicate calls.")
(:box t)
"Holes.")
+(sweeprolog-defface
+ macro
+ (:inherit font-lock-preprocessor-face)
+ (:foreground "blue" :underline t)
+ (:foreground "cyan" :underline t)
+ "Macros.")
+
;;;; Font-lock
(defun sweeprolog-analyze-start-font-lock (beg end)
(list (list beg end (sweeprolog-local-face))))
(`("goal" "constraint" . ,_)
(list (list beg end (sweeprolog-constraint-face))))
+ (`("macro" . ,_)
+ (list (list beg end (sweeprolog-macro-face))))
+ ("expanded"
+ (list (list beg end (sweeprolog-expanded-face))))
("instantiation_error"
(list (list beg end (sweeprolog-instantiation-error-face))))
(`("type_error" . ,_)
functor arity))
("not_callable" "Call to a non-callable term")))
+(defun sweeprolog--help-echo-for-macro (expansion)
+ (format "Macro indicator, expands to (%s)" expansion))
+
(defun sweeprolog-analyze-fragment-help-echo (beg end arg)
(when-let
(help-echo
("chars" "Chars")
(`("module" . ,module)
(sweeprolog--help-echo-for-module module))
+ (`("macro" . ,expansion)
+ (sweeprolog--help-echo-for-macro expansion))
("neck" "Neck")
(`("hook" . ,_) "Hook")
("hook" "Hook")