From: Dmitry Gutov Date: Thu, 16 May 2024 22:05:17 +0000 (+0300) Subject: ; Fix search in remote project with relative file names X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79ca6021e71af0500cbdc5c010b381f65f4c6998;p=emacs.git ; Fix search in remote project with relative file names (cherry picked from commit 113bd2082c982df933df9b12c3994d6d582c8268) --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3b3318afc65..df95e517a40 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2242,7 +2242,10 @@ Such as the current syntax table and the applied syntax properties." (defun xref--convert-hits (hits regexp) (let (xref--last-file-buffer (tmp-buffer (generate-new-buffer " *xref-temp*")) - (xref--hits-remote-id (file-remote-p default-directory)) + (xref--hits-remote-id (if (file-name-absolute-p (cadar hits)) + ;; TODO: Add some test for this. + (file-remote-p default-directory) + default-directory)) (syntax-needed (xref--regexp-syntax-dependent-p regexp))) (unwind-protect (mapcan (lambda (hit)