From: Dmitry Gutov Date: Tue, 7 May 2024 16:09:28 +0000 (+0300) Subject: ; xref-matches-in-files: Fix the previous change (bug#70813) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=65ae01fdc0e2269923fbdbe3b176575e41f6c420;p=emacs.git ; xref-matches-in-files: Fix the previous change (bug#70813) (cherry picked from commit f60e5f18745fc73fb0c71ecaeba2f3e52f323805) --- 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.