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

Even though 'denote' itself does not require external programs, some
of Emacs' features require external programs.  The 'xref' package is
one of those features.

While some of xref's features do not need any external applications,
the function 'xref-matches-in-files' used in 'denote-retrieve--xrefs'
will use 'xref-search-program' and by that also the associative list
'xref-search-program-alist' to find the actual shell command.  As
`-in-files` the suffix implies, the shell command needs to understand
multiple file names, which is the reason for 'xargs' in the pipe.

Since there is no Windows native alternative for 'xargs', the user
needs to install one of the many packages like msys64, MinGW, or Git,
that provide the necessary tools within their installation.
Afterwards, the path has to be added to the ~%PATH%~ environment
variable.  Note that 'exec-path' is not enough, since the shell proxy
on Windows, 'cmdproxy.exe', does not know about that Lisp-only
variable.

Either setting the PATH variable within Emacs as shown in the
changeset or setting the PATH variable within Windows' settings should
suffice and therefore get rid of this issue.
This commit is contained in:
Benjamin Kästner 2022-07-09 08:29:08 +02:00 committed by Protesilaos Stavrou
parent 39d85280ee
commit 3c295fc162
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -1630,6 +1630,21 @@ the file manager organise and provide access to files, search programs
deal with searching and narrowing, and version control software handle
the tracking of changes.
** Why do I get "Search failed with status 1" when I search for backlinks?
Denote uses [[info:emacs#Xref][Emacs' Xref]] to find backlinks. Xref requires ~xargs~ and
one of ~grep~ or ~ripgrep~, depending on your configuration.
This is usually not an issue on *nix systems, but the necessary
executables are not available on Windows Emacs distributions. Please
ensure that you have both ~xargs~ and either ~grep~ or ~ripgrep~
available within your ~PATH~ environment variable.
If you have ~git~ on Windows installed, then you may use the following
code (adjust the git's installation path if necessary):
#+begin_src emacs-lisp
(setenv "PATH" (concat (getenv "PATH") ";" "C:\\Program Files\\Git\\usr\\bin"))
#+end_src
* Acknowledgements
:PROPERTIES:
:CUSTOM_ID: h:f8126820-3b59-49fa-bcc2-73bd60132bb9