From b18515b91c94a7ab21c3e5fc6c7b31b8bf64cc6e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sun, 12 Nov 2023 18:08:00 +0100 Subject: [PATCH] ; Silence syntax errors when rereading predicate modes term --- sweep.pl | 5 +++-- sweeprolog.el | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sweep.pl b/sweep.pl index e5e2049..574da33 100644 --- a/sweep.pl +++ b/sweep.pl @@ -441,7 +441,7 @@ sweep_short_documentation_finalize(M, PI, Index, PIString, Doc, ArgSpan) :- ), term_string(Mode1, S, [module(pldoc_modes), numbervars(true)]), term_string(T , S, [module(pldoc_modes), numbervars(true), - subterm_positions(P)]), + subterm_positions(P), syntax_errors(quiet)]), ( Index == 0 -> ArgSpan = [] ; P = term_position(_, _, _, _, ArgsPos0), @@ -464,7 +464,8 @@ sweep_short_documentation_finalize(M, PI, Index, PIString, Doc, ArgSpan) :- memberchk(element(dt, _, SubDom0), Dom), memberchk(element(a, Att, SubDom), SubDom0), with_output_to(string(S), html_text(element(dt, Att, SubDom))), - term_string(T , S, [module(pldoc_modes), numbervars(true), subterm_positions(P)]), + term_string(T , S, [module(pldoc_modes), numbervars(true), + subterm_positions(P), syntax_errors(quiet)]), ( Index == 0 -> ArgSpan = [] ; P = term_position(_, _, _, _, ArgsPos0), diff --git a/sweeprolog.el b/sweeprolog.el index a5fd702..f8c38ae 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -2556,6 +2556,10 @@ inside a comment, string or quoted atom." :foreground "green" :extend t)) "Face to use for the new term in `sweeprolog-query-replace-term' queries.") +(defface sweeprolog-eldoc-argument-highlight + '((t :inherit eldoc-highlight-function-argument)) + "Face to use for highliting the argument at point in ElDoc messages.") + ;;;; Font-lock (defun sweeprolog-analyze-start-font-lock (beg end) @@ -5309,7 +5313,7 @@ accordingly." (`(,pi ,doc ,span) (when span (add-face-text-property (car span) (cdr span) - 'eldoc-highlight-function-argument nil doc)) + 'sweeprolog-eldoc-argument-highlight nil doc)) (funcall cb doc :thing pi :face 'sweeprolog-predicate-indicator))))) ;;;; Top-level Menu -- 2.39.2