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

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

[nongnu] elpa/sweeprolog 94b5b9b94e 1/2: FIXED: stale xref data when jum


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 94b5b9b94e 1/2: FIXED: stale xref data when jumping across files with M-.
Date: Fri, 20 Jan 2023 07:02:56 -0500 (EST)

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

    FIXED: stale xref data when jumping across files with M-.
---
 README.org    |  2 +-
 sweep.pl      | 14 ++++++++++----
 sweeprolog.el |  1 -
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 2d5ebe7528..8713530ec9 100644
--- a/README.org
+++ b/README.org
@@ -2108,7 +2108,7 @@ mailing list.
 :END:
 
 While Sweep is ready to be used for effective editing of Prolog code,
-there some further improvements that we want to pursue:
+some improvements remain to be pursued:
 
 ** Improvements around editing Prolog
 :PROPERTIES:
diff --git a/sweep.pl b/sweep.pl
index 4cf0d4da45..79c6ffc37c 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -359,6 +359,9 @@ sweep_predicate_apropos(Query0, Matches) :-
             Tail).
 
 sweep_predicate_location_(H, Path, Line) :-
+    xref_defined(Path0, H, How0),
+    xref_definition_line(How0, _),
+    xref_source(Path0, [comments(store)]),
     xref_defined(Path0, H, How),
     xref_definition_line(How, Line),
     !,
@@ -369,13 +372,16 @@ sweep_predicate_location_(H, Path, Line) :-
     atom_string(Path0, Path).
 
 sweep_predicate_location_(M, H, Path, Line) :-
-    (   xref_defined(Path0, M:H, How),
-        xref_definition_line(How, Line)
+    (   xref_defined(Path0, M:H, How0),
+        xref_definition_line(How0, _)
     ->  true
-    ;   xref_defined(Path0, H, How),
-        xref_definition_line(How, Line),
+    ;   xref_defined(Path0, H, How0),
+        xref_definition_line(How0, _),
         xref_module(Path0, M)
     ),
+    xref_source(Path0, [comments(store)]),
+    xref_defined(Path0, H, How),
+    xref_definition_line(How, Line),
     !,
     atom_string(Path0, Path).
 sweep_predicate_location_(M, H, Path, Line) :-
diff --git a/sweeprolog.el b/sweeprolog.el
index b4d99d730e..f6e8eb24da 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -902,7 +902,6 @@ PROJECT (only on Emacs 28 or later)."
 For native built-in predicates, the behavior of this function
 depends on the value of the user option
 `sweeprolog-swipl-sources', which see."
-  (sweeprolog-analyze-buffer)
   (or (sweeprolog--query-once "sweep" "sweep_predicate_location" mfn)
       (sweeprolog-native-predicate-location mfn)))
 



reply via email to

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