From: Stephen Leake Date: Wed, 16 Nov 2022 17:52:09 +0000 (-0800) Subject: Call xref--analyze with correct project X-Git-Tag: emacs-29.0.90~1616^2~142 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1772d88c1fa811eee235ba9b8b7584bb000ac293;p=emacs.git Call xref--analyze with correct project * lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom): Call xref--analyze with correct project. --- 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))))