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

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

[nongnu] elpa/sweeprolog f887a4b3f0 085/166: ENHANCED: provide caller pr


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog f887a4b3f0 085/166: ENHANCED: provide caller predicate in xref-find-references
Date: Fri, 30 Sep 2022 04:59:28 -0400 (EDT)

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

    ENHANCED: provide caller predicate in xref-find-references
---
 sweep.el |  7 ++++---
 sweep.pl | 13 ++++++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/sweep.el b/sweep.el
index f996831067..932eec322e 100644
--- a/sweep.el
+++ b/sweep.el
@@ -1201,9 +1201,10 @@ Interactively, a prefix arg means to prompt for BUFFER."
 (cl-defmethod xref-backend-references ((_backend (eql 'sweep)) mfn)
   (let ((refs (sweep-predicate-references mfn)))
     (seq-map (lambda (loc)
-               (let ((path (car loc))
-                     (line (or (cdr loc) 1)))
-                 (xref-make (concat path ":" (number-to-string line)) 
(xref-make-file-location path line 0))))
+               (let ((by (car loc))
+                     (path (cadr loc))
+                     (line (or (cddr loc) 1)))
+                 (xref-make by (xref-make-file-location path line 0))))
              refs)))
 
 (cl-defmethod xref-backend-apropos ((_backend (eql 'sweep)) pattern)
diff --git a/sweep.pl b/sweep.pl
index bdbebf9fea..1c90e853c9 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -139,7 +139,6 @@ sweep_identifier_at_point([Contents0, Path, Point], 
Identifier) :-
 
 :- dynamic sweep_current_identifier_at_point/1.
 
-
 sweep_identifier_at_point_(Path0, Point, Contents, Identifier) :-
     atom_string(Path, Path0),
     (   xref_module(Path, M)
@@ -360,13 +359,17 @@ sweep_module_description([M0|P], [M|[P]]) :- 
atom_string(M0, M).
 sweep_predicate_references(MFN, Refs) :-
     term_string(M:F/N, MFN),
     pi_head(F/N, H),
-    findall([Path|Line],
-            (xref_called(Path0, H, _, _, Line),
+    findall([B,Path|Line],
+            (xref_called(Path0, H, B0, _, Line),
+             pi_head(B1, B0),
+             term_string(B1, B),
              atom_string(Path0, Path)),
             Refs,
             Tail),
-    findall([Path|Line],
-            (xref_called(Path0, M:H, _, _, Line),
+    findall([B,Path|Line],
+            (xref_called(Path0, M:H, B0, _, Line),
+             pi_head(B1, B0),
+             term_string(B1, B),
              atom_string(Path0, Path)),
             Tail).
 



reply via email to

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