unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Michael Albinus <michael.albinus@gmx.de>, 53644@debbugs.gnu.org
Subject: bug#53644: 29.0.50; xref-search-program breaks if programm not installed on a remote host
Date: Tue, 15 Feb 2022 03:27:48 +0200	[thread overview]
Message-ID: <e7db2a4b-bf2b-c819-5098-190d917ec29c@yandex.ru> (raw)
In-Reply-To: <877d9xxsjd.fsf@posteo.net>

On 14.02.2022 19:32, Philip Kaludercic wrote:
> Dmitry Gutov <dgutov@yandex.ru> writes:
> 
>> On 14.02.2022 15:57, Philip Kaludercic wrote:
>>>> And use a simpler test: (only when the host is remote) write some text
>>>> to a file in the temp dir, then search through it. Only doing it once,
>>>> of course, when the connection-local value is initialized.
>>> I am afraid I don't understand what you mean here, specifically "some
>>> text".
>>>
>>
>> Well, we need some file to search and some knowledge about its
>> contents in advance (so the search can succeed).
> 
> I guess this is what confuses me, what about the contents is relevant to
> the query?  `xref-matches-in-files' is already passed a list of files
> that can be concatenated into the input for xargs.  The current version
> already works and is reasonably fast, so I don't recognise the
> improvement.

Sorry, I guess I wasn't clear enough.

When I said "extract the detection logic", I meant implement something 
similar to 'grep-compute-defaults' where there is a bunch of "probing" 
code which detects which commands work on the given system (and which 
arguments, etc). But a shorter function, of course, since it would only 
need to choose between two alternatives -- and return it.

And it seems to be it would be simpler (conceptually) if the said 
function didn't itself depend on xref-matches-in-files (the 
implementation or the return type). Though it's certainly possible to 
use it as well.

...so that function (let's call it xref--choose-search-program, perhaps) 
would write to a file in the temporary directory on the remote system, 
and then search in it using the configured search program, and then fall 
back to the default one if the first one fails.

WDYT?

>> Since we don't know anything about the remote system, we probably have
>> to create the file ourselves. Put something like "aaa\nbbb\nccc" in
>> it, and then search for "bbb".
> 
> My apologies, I feel stupid for not understanding, but what would aaa,
> bbb and ccc be?

Those are characters. "aaa\nbbb\nccc" would be the temporary file's 
contents, verbatim.

To clarify, I think your code quality is just fine, but the way the main 
function gets two responsibilities intertwined (both program detection 
and the actual search) seems a bit too much for me, clarity-wise.





  reply	other threads:[~2022-02-15  1:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 23:38 bug#53644: 29.0.50; xref-search-program breaks if programm not installed on a remote host Philip Kaludercic
2022-02-04  2:00 ` Dmitry Gutov
2022-02-04  8:15   ` Michael Albinus
2022-02-04 19:45     ` Dmitry Gutov
2022-02-05 14:38       ` Michael Albinus
2022-02-07  2:57         ` Dmitry Gutov
2022-02-07  9:18           ` Michael Albinus
2022-02-07 18:34             ` Michael Albinus
2022-02-08 11:15           ` Philip Kaludercic
2022-02-08 14:59             ` Michael Albinus
2022-02-08 17:12               ` Philip Kaludercic
2022-02-08 18:30                 ` Michael Albinus
2022-02-08 21:16                   ` Philip Kaludercic
2022-02-09  7:55                     ` Michael Albinus
2022-02-09  9:17                       ` Philip Kaludercic
2022-02-12  1:04                         ` Dmitry Gutov
2022-02-14 13:57                           ` Philip Kaludercic
2022-02-14 14:40                             ` Dmitry Gutov
2022-02-14 17:32                               ` Philip Kaludercic
2022-02-15  1:27                                 ` Dmitry Gutov [this message]
2022-02-15 16:32                                   ` Philip Kaludercic
2022-02-15 16:33                                     ` Dmitry Gutov
2022-02-15 16:37                                     ` Dmitry Gutov

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=e7db2a4b-bf2b-c819-5098-190d917ec29c@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=53644@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=philipk@posteo.net \
    /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).