emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog ef28a363df 2/4: FIXED: find user predicate defi


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog ef28a363df 2/4: FIXED: find user predicate definitions more reliably
Date: Thu, 10 Nov 2022 14:59:32 -0500 (EST)

branch: elpa/sweeprolog
commit ef28a363df2eb9521b070150009cbf382b4fb821
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    FIXED: find user predicate definitions more reliably
---
 sweep.pl | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/sweep.pl b/sweep.pl
index 9f42fd0564..ffde94b2b2 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -349,12 +349,12 @@ sweep_predicate_location_(H, Path, Line) :-
     !,
     atom_string(Path0, Path).
 sweep_predicate_location_(H, Path, Line) :-
-    xref_defined(Path0, H, How),
-    atom_string(Path0, Path),
-    (   xref_definition_line(How, Line)
+    (   xref_defined(Path0, H, How),
+        xref_definition_line(How, Line)
     ->  true
-    ;   Line = []
-    ).
+    ;   xref_defined(Path0, H, _), Line = []
+    ),
+    atom_string(Path0, Path).
 
 sweep_predicate_location_(M, H, Path, Line) :-
     predicate_property(M:H, file(Path0)),
@@ -362,12 +362,16 @@ sweep_predicate_location_(M, H, Path, Line) :-
     !,
     atom_string(Path0, Path).
 sweep_predicate_location_(M, H, Path, Line) :-
-    xref_defined(Path0, M:H, How),
-    atom_string(Path0, Path),
-    (   xref_definition_line(How, Line)
+    (   xref_defined(Path0, M:H, How),
+        xref_definition_line(How, Line)
     ->  true
-    ;   Line = []
-    ).
+    ;   xref_defined(Path0, H, How),
+        xref_definition_line(How, Line),
+        xref_module(Path0, M)
+    ->  true
+    ;   xref_defined(Path0, M:H, _), Line = []
+    ),
+    atom_string(Path0, Path).
 
 sweep_local_predicate_completion(Sub, Preds) :-
     sweep_current_module(M),



reply via email to

[Prev in Thread] Current Thread [Next in Thread]