From 1772d88c1fa811eee235ba9b8b7584bb000ac293 Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Wed, 16 Nov 2022 09:52:09 -0800 Subject: [PATCH] Call xref--analyze with correct project * lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom): Call xref--analyze with correct project. --- lisp/progmodes/xref.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index bb36688ef85..89a090ae932 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1237,16 +1237,21 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." (max-height (/ (window-height) 2)) (size-fun (lambda (window) (fit-window-to-buffer window max-height))) + xref-alist buf) (cond ((not (cdr xrefs)) (xref-pop-to-location (car xrefs) (assoc-default 'display-action alist))) (t + ;; Call it here because it can call (project-current), and that + ;; might depend on individual buffer, not just directory. + (setq xref-alist (xref--analyze xrefs)) + (with-current-buffer (get-buffer-create xref-buffer-name) (xref--ensure-default-directory dd (current-buffer)) (xref--transient-buffer-mode) - (xref--show-common-initialize (xref--analyze xrefs) fetcher alist) + (xref--show-common-initialize xref-alist fetcher alist) (pop-to-buffer (current-buffer) `(display-buffer-in-direction . ((direction . below) (window-height . ,size-fun)))) -- 2.39.5