From 65ae01fdc0e2269923fbdbe3b176575e41f6c420 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 7 May 2024 19:09:28 +0300 Subject: [PATCH] ; xref-matches-in-files: Fix the previous change (bug#70813) (cherry picked from commit f60e5f18745fc73fb0c71ecaeba2f3e52f323805) --- lisp/progmodes/xref.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index f1446954c02..a9c42313f12 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2063,8 +2063,9 @@ to control which program to use when looking for matches." (hits nil) ;; Support for remote files. The assumption is that, if the ;; first file is remote, they all are, and on the same host. - (dir (or (file-name-directory (car files)) - default-directory)) + (dir (if (file-name-absolute-p (car files)) + (file-name-directory (car files)) + default-directory)) (remote-id (file-remote-p dir)) ;; The 'auto' default would be fine too, but ripgrep can't handle ;; the options we pass in that case. -- 2.39.5