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

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

[nongnu] elpa/sweeprolog 280976cd4b 1/2: * (sweeprolog-identifier-at-poi


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 280976cd4b 1/2: * (sweeprolog-identifier-at-point): reliably qualify local heads
Date: Fri, 2 Dec 2022 05:59:44 -0500 (EST)

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

    * (sweeprolog-identifier-at-point): reliably qualify local heads
---
 sweep.pl      | 11 +++++++----
 sweeprolog.el |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/sweep.pl b/sweep.pl
index 1aaa7558e7..360d9333af 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -719,8 +719,9 @@ strip_det(Mode is _, Mode) :- !.
 strip_det(//(Mode), Mode) :- !.
 strip_det(Mode, Mode).
 
-sweep_functor_arity_pi([F0,A], PI)   :-
-    !,
+sweep_functor_arity_pi([M,F0,A|_], PI) :-
+    !, atom_string(F, F0), term_string(M:F/A, PI).
+sweep_functor_arity_pi([F0,A|Path0], PI) :-
     atom_string(F, F0),
     pi_head(F/A, Head),
     sweep_current_module(M0),
@@ -729,11 +730,13 @@ sweep_functor_arity_pi([F0,A], PI)   :-
     ->  T = M:F/A
     ;   xref_defined(_, Head, imported(Other)), xref_module(Other, M)
     ->  T = M:F/A
+    ;   string(Path0),
+        atom_string(Path, Path0),
+        xref_defined(Path, Head, _)
+    ->  T = M0:F/A
     ;   T = F/A
     ),
     term_string(T, PI).
-sweep_functor_arity_pi([M,F0,A], PI) :-
-    atom_string(F, F0), term_string(M:F/A, PI).
 
 sweep_current_module(Module) :-
     sweep_main_thread,
diff --git a/sweeprolog.el b/sweeprolog.el
index cccd6a3ca9..2f9d9298d7 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -916,7 +916,7 @@ module name, F is a functor name and N is its arity."
         (when (and id-at-point
                    (not (eq (car id-at-point) 'variable)))
           (sweeprolog--query-once "sweep" "sweep_functor_arity_pi"
-                                  id-at-point))))))
+                                  (append id-at-point (buffer-file-name))))))))
 
 
 ;;;; Modules



reply via email to

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