;; find . -type f -print0 | xargs -0 -e grep -nH -e
;; Note : I removed -e as it is not posix, nor necessary it seems.
- (let ((cmd (concat "find " default-directory " -type f " filepattern " -print0 "
+ (let ((cmd (concat "find " (file-local-name rootdir)
+ " -type f " filepattern " -print0 "
"| xargs -0 grep -H " grepflags "-e " greppat)))
;;(message "Old command: %s" cmd)
- (call-process semantic-symref-grep-shell nil b nil
+ (process-file semantic-symref-grep-shell nil b nil
shell-command-switch cmd)
)
- (let ((cmd (semantic-symref-grep-use-template rootdir filepattern grepflags greppat)))
- (call-process semantic-symref-grep-shell nil b nil
+ (let ((cmd (semantic-symref-grep-use-template
+ (file-local-name rootdir) filepattern grepflags greppat)))
+ (process-file semantic-symref-grep-shell nil b nil
shell-command-switch cmd))
))
(setq ans (semantic-symref-parse-tool-output tool b))
;; 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*"))
(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
(defun xref--collect-matches (hit regexp tmp-buffer)
(pcase-let* ((`(,line ,file ,text) hit)
+ (file (and file (concat (file-remote-p default-directory) file)))
(buf (xref--find-buffer-visiting file))
(syntax-needed (xref--regexp-syntax-dependent-p regexp)))
(if buf