atom_string(Kind1, Kind).
sweep_color_normalized_(_, macro, [String|_], ["macro"|String]) :-
!.
+sweep_color_normalized_(_, decl_option, [Opt0|_], ["decl_option"|Opt]) :-
+ !,
+ term_string(Opt0, Opt).
sweep_color_normalized_(_, Nom0, _, Nom) :-
atom_string(Nom0, Nom).
(:foreground "cyan" :underline t)
"Macros.")
+(sweeprolog-defface
+ declaration-option
+ (:weight bold)
+ (:weight bold)
+ (:weight bold)
+ "Declaration options.")
+
;;;; Font-lock
(defun sweeprolog-analyze-start-font-lock (beg end)
("method"
(list (list beg end nil) (list beg end (sweeprolog-method-face))))
("class"
- (list (list beg end (sweeprolog-class-face))))))
+ (list (list beg end (sweeprolog-class-face))))
+ (`("decl_option" . ,_)
+ (list (list beg end (sweeprolog-declaration-option-face))))))
(defun sweeprolog-analyze-fragment-font-lock (beg end arg)
(when-let ((face-fragments (sweeprolog-analyze-fragment-to-faces
(defun sweeprolog--help-echo-for-macro (expansion)
(format "Macro indicator, expands to (%s)" expansion))
+(defun sweeprolog--help-echo-for-declaration-option (option)
+ (pcase option
+ ("incremental"
+ (concat
+ "Incremental declaration "
+ "(tables that depend on this predicate are updated it changes)"))
+ ("volatile"
+ (concat
+ "Volatile declaration "
+ "(predicate excluded from saved program)"))
+ (_ (format "%s predicate property declaration" option))))
+
(defun sweeprolog-analyze-fragment-help-echo (beg end arg)
(when-let
(help-echo
("rational" "Rational")
("dict_function" "Dict function")
("dict_return_op" "Dict return operator")
- ("func_dot" "Dict function dot")))
+ ("func_dot" "Dict function dot")
+ (`("decl_option" . ,option)
+ (sweeprolog--help-echo-for-declaration-option option))))
(with-silent-modifications
(put-text-property beg end 'help-echo help-echo))))