From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#33006: 27.0.50; `dired-do-find-regexp' doesn't work for remote directories Date: Fri, 12 Oct 2018 14:52:48 +0200 Message-ID: <87woqnba3j.fsf@gmx.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1539348667 9348 195.159.176.226 (12 Oct 2018 12:51:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 12:51:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33006@debbugs.gnu.org To: Philipp Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 12 14:51:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAwuE-0002Iv-A4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Oct 2018 14:51:02 +0200 Original-Received: from localhost ([::1]:40420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAwwK-0006tk-Ug for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Oct 2018 08:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAwwE-0006tf-Ho for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 08:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAwwA-0006gW-H6 for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 08:53:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAwwA-0006gH-BF for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 08:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gAwwA-0008Dd-Ac for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 08:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Oct 2018 12:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33006 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33006-submit@debbugs.gnu.org id=B33006.153934877931584 (code B ref 33006); Fri, 12 Oct 2018 12:53:02 +0000 Original-Received: (at 33006) by debbugs.gnu.org; 12 Oct 2018 12:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:46010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAww6-0008DM-S8 for submit@debbugs.gnu.org; Fri, 12 Oct 2018 08:52:59 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:43407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAww4-0008D6-Bn for 33006@debbugs.gnu.org; Fri, 12 Oct 2018 08:52:56 -0400 Original-Received: from detlef.gmx.de ([212.91.243.207]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MVvB2-1g8pLt2YbA-00X4Jy; Fri, 12 Oct 2018 14:52:49 +0200 Original-Received: from detlef.gmx.de ([212.91.243.207]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MVvB2-1g8pLt2YbA-00X4Jy; Fri, 12 Oct 2018 14:52:49 +0200 In-Reply-To: (Philipp's message of "W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W0t8GTV8XgSeIrMKt2ZVWp3WOqUPyQcgw18/QkKxA5HsmI+MYb05rS5Ua0Lpd2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151173 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Philipp writes: Hi Philipp, > 1. emacs -Q > 2. C-x d /ssh:some-remote-host:/some/dir RET > 3. Mark any file with `m' > 4. A . RET > > Expected: File is searched for regex `.' > Actual: user-error: Search failed with status 1: find: =E2=80=98/ssh:some= -remote-host:/some/dir/file=E2=80=99: No such file or directory Yep, same behaviour here. > This is probably because `xref-collect-matches' calls > `call-process-shell-command', which doesn't work remotely. It should > call `process-file-shell-command' instead. Yes, this must be changed. But the file name needs some massage, too. The appended patch fixes this for me. But since I don't know xref.el in detail, I fear I introduce collateral damages. At least a second opinion about the patch would be welcome, before I commit it to master. Best regards, Michael. --=-=-= Content-Type: text/plain Content-Disposition: attachment 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))) --=-=-=--