diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index c7ae40eb34..d3e3fe8da5 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -992,7 +992,7 @@ xref-collect-matches ;; do that reliably enough, without creating false negatives? (command (xref--rgrep-command (xref--regexp-to-extended regexp) files - (expand-file-name dir) + (file-local-name (expand-file-name dir)) ignores)) (def default-directory) (buf (get-buffer-create " *xref-grep*")) @@ -1003,7 +1003,7 @@ xref-collect-matches (erase-buffer) (setq default-directory def) (setq status - (call-process-shell-command command nil t)) + (process-file-shell-command command nil t)) (goto-char (point-min)) ;; Can't use the exit status: Grep exits with 1 to mean "no ;; matches found". Find exits with 1 if any of the invocations @@ -1151,7 +1151,8 @@ xref--collect-matches-1 (or (null matches) (> (point) line-beg)) (re-search-forward regexp line-end t)) - (let* ((beg-column (- (match-beginning 0) line-beg)) + (let* ((file (and file (concat (file-remote-p default-directory) file))) + (beg-column (- (match-beginning 0) line-beg)) (end-column (- (match-end 0) line-beg)) (loc (xref-make-file-location file line beg-column)) (summary (buffer-substring line-beg line-end)))