]> git.eshelyaron.com Git - emacs.git/commitdiff
Call xref--analyze with correct project
authorStephen Leake <stephen_leake@stephe-leake.org>
Wed, 16 Nov 2022 17:52:09 +0000 (09:52 -0800)
committerStephen Leake <stephen_leake@stephe-leake.org>
Wed, 16 Nov 2022 17:52:09 +0000 (09:52 -0800)
* lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom):
Call xref--analyze with correct project.

lisp/progmodes/xref.el

index bb36688ef856b09469636f4ff37d1200e66ffc12..89a090ae932509a0e1e3aef82cbfd7074bca6ae2 100644 (file)
@@ -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))))