From: Eshel Yaron Date: Sun, 4 Sep 2022 20:11:27 +0000 (+0300) Subject: ENHANCED: also complete predicate names from xref X-Git-Tag: v0.2.0~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ac0e7afb90c6f50b6849c0d92ff394c42b94c90;p=dict.git ENHANCED: also complete predicate names from xref --- diff --git a/sweep.el b/sweep.el index b522dd1..d081839 100644 --- a/sweep.el +++ b/sweep.el @@ -199,7 +199,7 @@ (when (eq sts 'finished) (let ((opoint (point))) (save-match-data - (with-silent-modifications + (combine-after-change-calls (skip-chars-backward "1234567890") (when (= ?/ (preceding-char)) (backward-char) diff --git a/sweep.pl b/sweep.pl index c24bae8..a856240 100644 --- a/sweep.pl +++ b/sweep.pl @@ -210,8 +210,16 @@ sweep_local_predicate_completion([Mod|Sub], Preds) :- atom_string(M, Mod), findall(F/N, @(current_predicate(F/N), M), - Preds0), - convlist(sweep_predicate_completion_annotated(Sub, M), Preds0, Preds). + Preds0, + Tail), + findall(XF/XN, + ( xref_defined(SourceId, H, _), + H \= _:_, + pi_head(XF/XN, H) + ), + Tail), + list_to_set(Preds0, Preds1), + convlist(sweep_predicate_completion_annotated(Sub, M), Preds1, Preds). sweep_predicate_completion_annotated(Sub, M, F/N, [S|A]) :- format(string(S), '~W/~w', [F, [quoted(true), character_escapes(true)], N]),