GNU bug report logs - #53644
29.0.50; xref-search-program breaks if programm not installed on a remote host

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 30 Jan 2022 23:39:01 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 53644 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#53644: 29.0.50; xref-search-program breaks if programm not installed on a remote host
Date: Tue, 08 Feb 2022 19:30:54 +0100
Philip Kaludercic <philipk <at> posteo.net> writes:

Hi Philip,

> Ok, I missed that.  But the question still remains for versions of Emacs
> prior to 27.1.  What would you advise to do there?
>
> For context: In my specific case, I am using Guix so shell-file-name
> something like
> /gnu/store/87kif0bpf0anwbsaw0jvg8fyciw4sz67-bash-5.0.16/bin/bash.
> Virtually every server I might connect to does not have this path (tough
> "/bin/sh" works in that case (which would break other systems like
> adb)).  So I don't think a version check would suffice.  All it does in
> the patch I provided above is provide a speedup for all greps after the
> first one.

I would do something like this (untested!):

--8<---------------cut here---------------start------------->8---
(defmacro my-with-connection-local-variables (&rest body)
  "Ensure, that `shell-file-name' and `xref-search-program' have proper values."
  (if (bound-and-true-p enable-connection-local-variables)
      `(with-connection-local-variables ,@body)
    `(if (file-remote-p default-directory)
	 (let ((shell-file-name "/bin/sh") ;; Adapt
	       (xref-search-program "/bin/gerep")) ;; Adapt
	   ,@body)
       ,@body)))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




This bug report was last modified 3 years and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.