pat)))))))
(completing-read sweep-read-module-prompt col)))
+
+(defun sweep--set-buffer-module ()
+ (sweep-open-query "user" "sweep" "sweep_path_module" (buffer-file-name))
+ (let ((sol (sweep-next-solution)))
+ (sweep-close-query)
+ (when (sweep-true-p sol)
+ (setq sweep-buffer-module (cdr sol)))))
+
;;;###autoload
(defun sweep-find-module (mod)
"Jump to the source file of the Prolog module MOD."
nil
nil
(font-lock-fontify-region-function . sweep-colourise-some-terms)))
- (sweep-colourise-buffer))
+ (sweep-colourise-buffer)
+ (sweep--set-buffer-module))
;;;; Testing:
sweep_colourise_some_terms/2,
sweep_documentation/2,
sweep_expand_file_name/2,
+ sweep_path_module/2,
sweep_predicate_location/2,
sweep_predicates_collection/2,
sweep_modules_collection/2,
relative_to(Dir),
solutions(all),
extensions(['', '.pl'])]).
+
+sweep_path_module([], "user") :- !.
+sweep_path_module(Path0, Module) :-
+ atom_string(Path, Path0),
+ xref_module(Path, Module0),
+ atom_string(Module0, Module).