From 2c99b60683640db3fbc2ec9944768105e84ca14b Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 19 Nov 2022 21:20:24 +0200 Subject: [PATCH] * (sweeprolog-identifier-at-point): fix module qualification --- sweep.pl | 8 ++++---- sweeprolog-tests.el | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sweep.pl b/sweep.pl index ec1be7a..7645e55 100644 --- a/sweep.pl +++ b/sweep.pl @@ -706,12 +706,12 @@ sweep_functor_arity_pi([F0,A], PI) :- sweep_current_module(M0), ( @(predicate_property(M:Head, visible), M0), \+ @(predicate_property(M:Head, imported_from(_)), M0) - -> true + -> T = M:F/A ; xref_defined(_, Head, imported(Other)), xref_module(Other, M) - -> true - ; M = M0 + -> T = M:F/A + ; T = F/A ), - term_string(M:F/A, PI). + term_string(T, PI). sweep_functor_arity_pi([M,F0,A], PI) :- atom_string(F, F0), term_string(M:F/A, PI). diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el index 9bc0ad8..59af86f 100644 --- a/sweeprolog-tests.el +++ b/sweeprolog-tests.el @@ -313,7 +313,7 @@ foo(Bar). (goto-char (point-max)) (backward-word) (should (equal (sweeprolog-identifier-at-point) - "user:bar/1")))) + "bar/1")))) (ert-deftest definition-at-point () "Test recognizing predicate defintions." -- 2.39.2