]> git.eshelyaron.com Git - dict.git/commitdiff
FIXED: stale xref data when jumping across files with M-.
authorEshel Yaron <me@eshelyaron.com>
Fri, 20 Jan 2023 11:49:51 +0000 (13:49 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 20 Jan 2023 11:49:51 +0000 (13:49 +0200)
README.org
sweep.pl
sweeprolog.el

index 2d5ebe75289db35bb4b5ca16b2bec6c5420cfda9..8713530ec9c1023621c711669d7d8ec171432d36 100644 (file)
@@ -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:
index 4cf0d4da459d9740249666c1f74f07371b044de4..79c6ffc37c38ecdf746fbd54d74d44c4f90fbdbd 100644 (file)
--- 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) :-
index b4d99d730e6dd74690f6c2fb4c3c1464bcb1183d..f6e8eb24daed5f4658b09229de844cd9f0380a5f 100644 (file)
@@ -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)))