I've run into a problem viewing pdf documentation files with AucTex. I use
pdf-tools to view PDF files from within Emacs, and I've set
emacsclient -n as my default pdf-viewer (via xdg-mime on Debian Linux). This works fine in most circumstances, but it breaks the
(Tex-documentation-texdoc ...) function of Auctex (
I've narrowed the problem down to a single line of code. When I try to view the documentation for the
TeX-documentation-texdoc turns this into the following sexp:
(shell-command-to-string "texdoc --view listings")
texdoc in turn calls
emacsclient to actually open the file (based on how I've configured my desktop via xdg). However, at this point, the Emacs hangs and I need to quit (
C-g) to get control back. After that, no new pdf is opened. The same thing happens if I try to call emacsclient directly:
(shell-command-to-string "emacsclient -n tmp.pdf")
Both commands work at the command line (i.e.,
emacsclient -n tmp.pdf and
texdoc --view listings.
My question is, in an instance like this, how do I call emacsclient from within Emacs? (and I know I could just open the pdf file with
find-file; that's not an option here as I need to call an external process (texdoc) to find the file, and that process then invokes emacsclient).