~protesilaos/denote

4 2

Possible FAQ for Windows users: backlinks require xargs and grep

Details
Message ID
<ce117b14-55cf-622e-6cd8-0af698091ae3@gmail.com>
DKIM signature
pass
Download raw message
Hello denoters,

I tried to create a reproducible example for the recent "backlink do not 
work" (CA73E705-1194-4324-9962-70708C4C72E5@zoho.eu) case and realized 
that `denote-link-backlinks' uses `xargs' behind the scenes, which isn't 
available on the Windows specific Emacs distribution.

That's *not* a denote issue. Denote uses `xref' behind the scenes, and 
`xref' uses `xargs' in connection with `grep' or `ripgrep' (see 
`xref-search-program-alist' in `xref.el' and `denote-retrieve--xrefs').

Maybe a short remark in the FAQ could be helpful for future users, e.g.

 > ** Why do I get "Search failed with status 1" when I search for 
backlinks?
 >
 > ~denote~ uses [[info:emacs#Xref][Emacs' ~xref~]] library behind the 
scenes. ~xref~ uses both ~xargs~ and ~grep~ or ~ripgrep~ internally, 
depending on your configuration. This is usually not an issue on *nix 
systems, but the necessary executables are not installed by default on 
Windows or even included in the Windows Emacs distribution.
 >
 > Please ensure that you have both ~xargs~ and either ~grep~ or 
~ripgrep~ available within one of your ~exec-path~'s directories.

I will install msys64 or reuse the git-bash environment to get those 
executable into my `exec-path'.

All the best,
   Benjamin
Details
Message ID
<87o7y0gknc.fsf@protesilaos.com>
In-Reply-To
<ce117b14-55cf-622e-6cd8-0af698091ae3@gmail.com> (view parent)
DKIM signature
pass
Download raw message
> From: "Benjamin Kästner" <benjamin.kaestner@googlemail.com>
> Date: Fri, 08 Jul 2022 08:32:06 +0200
>
> Hello denoters,

Hello Benjamin,

> I tried to create a reproducible example for the recent "backlink do not 
> work" (CA73E705-1194-4324-9962-70708C4C72E5@zoho.eu) case

Adding a link just in case:
<https://lists.sr.ht/~protesilaos/denote/%3CCA73E705-1194-4324-9962-70708C4C72E5%40zoho.eu%3E>

> and realized that `denote-link-backlinks' uses `xargs' behind the
> scenes, which isn't available on the Windows specific Emacs
> distribution.
>
> That's *not* a denote issue. Denote uses `xref' behind the scenes, and
> `xref' uses `xargs' in connection with `grep' or `ripgrep' (see
> `xref-search-program-alist' in `xref.el' and
> `denote-retrieve--xrefs').

Thanks for looking into this!

> Maybe a short remark in the FAQ could be helpful for future users,
> e.g. [...]

Do you want to format it as a patch?  It is below the ~15 line threshold
so you do not need to assign copyright to the Free Software Foundation.

Otherwise, is it okay if I make the commit on your behalf?  I will use
your name and the email you have here.  Just so you are recorded for
your contribution (will update the manual's "Acknowledgements" as well).

> I will install msys64 or reuse the git-bash environment to get those 
> executable into my `exec-path'.

If this can go into the FAQ, please include it.

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<c43a3a08-a4b8-e0c3-6228-2745a81defa6@googlemail.com>
In-Reply-To
<87o7y0gknc.fsf@protesilaos.com> (view parent)
DKIM signature
pass
Download raw message
Hello Prot

> Do you want to format it as a patch?

Yes, but I first need to fix it.  The `cmdproxy.exe' that's being used 
as `shell-file-name' on Windows seems to not care about `exec-path', so 
I need to investigate a little bit more.  I *guess* that `cmdproxy.exe' 
only respects the `%PATH%' environment variable.  I will send a patch as 
soon as I found a proper, reproducible workaround.

All the best,
   Benjamin

[PATCH] Add entry to FAQ about xref's search failures on Windows

Details
Message ID
<2946445c-4bee-86a1-9d00-86ba7bd10297@googlemail.com>
In-Reply-To
<87o7y0gknc.fsf@protesilaos.com> (view parent)
DKIM signature
pass
Download raw message
Hello Prot,

> Do you want to format it as a patch?  It is below the ~15 line threshold > [...]
 >
>> I will install msys64 or reuse the git-bash environment to get those
>> executable into my `exec-path' >
> If this can go into the FAQ, please include it.

I was able to reuse the git-bash environment by setting the PATH 
variable within Emacs (instead of exec-path).  I added the necessary 
Lisp code into the FAQ entry that's attached as a patch (and also tried 
my best to keep it to ~15 lines).

This is my first patch-by-mail instead of a GitHub pull request, so any 
feedback is very welcome!

All the best,
   Benjamin

Re: [PATCH] Add entry to FAQ about xref's search failures on Windows

Details
Message ID
<87zghieehx.fsf@protesilaos.com>
In-Reply-To
<2946445c-4bee-86a1-9d00-86ba7bd10297@googlemail.com> (view parent)
DKIM signature
pass
Download raw message
> From: Benjamin Kästner <benjamin.kaestner@googlemail.com>
> Date: Sat, 09 Jul 2022 08:57:56 +0200
>
> Hello Prot,

Hello Benjamin,

>> Do you want to format it as a patch?  It is below the ~15 line threshold > [...]
>  >
>>> I will install msys64 or reuse the git-bash environment to get those
>>> executable into my `exec-path' >
>> If this can go into the FAQ, please include it.
>
> I was able to reuse the git-bash environment by setting the PATH 
> variable within Emacs (instead of exec-path).  I added the necessary 
> Lisp code into the FAQ entry that's attached as a patch (and also tried 
> my best to keep it to ~15 lines).
>
> This is my first patch-by-mail instead of a GitHub pull request, so any 
> feedback is very welcome!

Thank you for the patch!  (And for participating in the other thread.)
I just applied it.  Everything worked perfectly.

I made some minor subsequent edits to the manual to link to your heading
from the context where the backlinks are first mentioned.

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)