unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Philipp <p.stephani2@gmail.com>
Cc: 33006@debbugs.gnu.org
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	[thread overview]
Message-ID: <87woqnba3j.fsf@gmx.de> (raw)
In-Reply-To: <wvr4bm81y6g3.fsf@gmail.com> (Philipp's message of "Wed, 10 Oct 2018 20:58:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

Philipp <p.stephani2@gmail.com> 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: ‘/ssh:some-remote-host:/some/dir/file’: 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.


[-- Attachment #2: Type: text/plain, Size: 1607 bytes --]

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)))

  reply	other threads:[~2018-10-12 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 18:58 bug#33006: 27.0.50; `dired-do-find-regexp' doesn't work for remote directories Philipp
2018-10-12 12:52 ` Michael Albinus [this message]
2018-10-21 11:56   ` Michael Albinus
2018-10-21 23:34     ` Dmitry Gutov
2018-10-26 15:18       ` Michael Albinus
2018-10-28 13:14         ` Dmitry Gutov
2018-10-29 13:12           ` Michael Albinus
2018-11-08 10:00             ` Michael Albinus
2019-01-04 13:01               ` Michael Albinus
2019-01-06  0:39             ` Philipp Stephani
2019-01-06  8:57               ` Michael Albinus
2019-01-06 18:20               ` Philipp Stephani
2019-01-06 18:31                 ` Eli Zaretskii
2019-01-07  7:46                   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woqnba3j.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33006@debbugs.gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).