; xref-matches-in-files: Fix the previous change (bug#70813)
authorDmitry Gutov <dmitry@gutov.dev>
Tue, 7 May 2024 16:09:28 +0000 (19:09 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Tue, 7 May 2024 16:18:47 +0000 (19:18 +0300)
lisp/progmodes/xref.el

index 29fc6cd560f16cc307a0d1f6f3b37d0c90bbcf25..9fa8383ef1019e070c738406e177965059994f5d 100644 (file)
@@ -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.