branch: elpa/sweeprolog commit 78b8ceb0fcef5f516913d5868c74966fe06b9d44 Author: Eshel Yaron <m...@eshelyaron.com> Commit: Eshel Yaron <m...@eshelyaron.com>
* (xref-backend-references): report progress while formatting refs --- sweeprolog.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index 1f283d76f0..f8acb87274 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -4514,17 +4514,20 @@ accordingly." (list (xref-make (concat path ":" (number-to-string line)) (xref-make-file-location path line 0))))) (cl-defmethod xref-backend-references ((_backend (eql sweeprolog)) mfn) - (let ((refs (sweeprolog-predicate-references mfn))) - (seq-map (lambda (loc) - (let* ((by (nth 0 loc)) - (file (nth 1 loc)) - (beg (nth 2 loc)) - (buf (find-file-noselect file t))) - (xref-make (format "Call from %s at line %s" by - (with-current-buffer buf - (line-number-at-pos beg t))) - (xref-make-buffer-location buf beg)))) - refs))) + (let ((xref-items nil) + (refs (sweeprolog-predicate-references mfn))) + (dolist-with-progress-reporter (loc refs) + "Formatting cross references... " + (push (let* ((by (nth 0 loc)) + (file (nth 1 loc)) + (beg (nth 2 loc)) + (buf (find-file-noselect file t))) + (xref-make (format "Call from %s at line %s" by + (with-current-buffer buf + (line-number-at-pos beg t))) + (xref-make-buffer-location buf beg))) + xref-items)) + (reverse xref-items))) (cl-defmethod xref-backend-apropos ((_backend (eql sweeprolog)) pattern) (let ((matches (sweeprolog-predicate-apropos pattern)))