From f60e5f18745fc73fb0c71ecaeba2f3e52f323805 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) --- 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 29fc6cd560f..9fa8383ef10 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1922,8 +1922,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.30.2