bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53644: 29.0.50; xref-search-program breaks if programm not installed


From: Michael Albinus
Subject: bug#53644: 29.0.50; xref-search-program breaks if programm not installed on a remote host
Date: Sat, 05 Feb 2022 15:38:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> Hi Michael,

Hi Dmitry,

>>>> When invoking a command that respects xref-search-program via TRAMP,
>>>> e.g. on a remote system that doesn't have (in my case ripgrep)
>>>> installed, an error is signalled indicating that the search query
>>>> couldn't be executed.
>>>
>>> One way to work around this will probably involve an addition to
>>> find-file-hook and some code which checks (file-remote-p
>>> buffer-file-name) and sets xref-search-program to a particular value
>>> buffer-locally depending on the result.
>>>
>>> Or an around-advice for xref-matches-in-files.
>> There are connection-local variables exactly for this use case.
>
> Is there a documented way on how to make the variable's value on
> remote hosts customizable for the user too?

Something like

--8<---------------cut here---------------start------------->8---
(connection-local-set-profile-variables
 'remote-xref-variables
 '((xref-search-program . "/bin/grep")))

(with-eval-after-load 'xref
  (connection-local-set-profiles
   '(:application tramp :machine "myhost")
   'remote-xref-variables))
--8<---------------cut here---------------end--------------->8---

> Cheers,
> Dmitry.

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]