unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: "André A. Gomes" <andremegafone@gmail.com>, 57385@debbugs.gnu.org
Subject: bug#57385: 28.1.91; project-find-regexp fails over tramp
Date: Fri, 26 Aug 2022 17:08:39 +0200	[thread overview]
Message-ID: <87edx311qg.fsf@gmx.de> (raw)
In-Reply-To: <13dc47c2-0aa4-ea4e-9ab0-da5abcf363cb@yandex.ru> (Dmitry Gutov's message of "Fri, 26 Aug 2022 17:32:08 +0300")

Dmitry Gutov <dgutov@yandex.ru> writes:

Hi Dmitry,

>> Dmitry, I tested project-find-regexp over Tramp with a "mundane"
>> system
>> and it failed regardless.  It seems I figured out why.  Shell-file-name
>> (in xref-matches-in-files) seems to get its value from the local
>> machine, not from the remote one.  Therefore, it can't possibly start
>> the grep process remotely.  Any on how to fix this?
>
> Right.
>
> Michael, do you perhaps have a suggestion how xref-matches-in-files
> could use connection-local values for shell-file-name and
> shell-command-switch (when available) without losing compatibility
> with Emacs 26.1?

Hmm, the usual recommendation is to take
with-connection-local-variables, like

(with-connection-local-variables
  (xref--process-file-region (point-min)
                             (point-max)
                             shell-file-name
                             output
                             nil
                             shell-command-switch
                             command))

Unfortunately, the macro exists since Emacs 27 only, so you need to test
its availablility, and to use progn instead if it doesn't exist.

There is another trap, Tramp sets already the connection-local variable
shell-file-name to "/bin/sh". The user must overwrite this (or Tramp
must be pimped up to take whatever the user declares as "remote-shell").

Best regards, Michael.





  reply	other threads:[~2022-08-26 15:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 15:17 bug#57385: 28.1.91; project-find-regexp fails over tramp André A. Gomes
2022-08-24 18:11 ` Dmitry Gutov
2022-08-25  6:57   ` André A. Gomes
2022-08-25 11:25     ` Dmitry Gutov
2022-08-25 12:36       ` Dmitry Gutov
2022-08-25 16:24         ` André A. Gomes
2022-08-25 17:44           ` Michael Albinus
2022-08-25 19:51             ` André A. Gomes
2022-08-26 14:32               ` Dmitry Gutov
2022-08-26 15:08                 ` Michael Albinus [this message]
2022-08-26 22:12                   ` Dmitry Gutov
2022-08-27  5:50                     ` Michael Albinus
2022-08-27 10:45                       ` Dmitry Gutov
2022-09-11 15:22                     ` André A. Gomes
2022-09-11 21:46                       ` Dmitry Gutov
2022-09-12  6:26                         ` André A. Gomes
2022-09-12  9:03                           ` Stefan Kangas

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=87edx311qg.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=57385@debbugs.gnu.org \
    --cc=andremegafone@gmail.com \
    --cc=dgutov@yandex.ru \
    /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).