Subject: Re: bug#44824: 27.1; Org export as pdf and open file does not open it

From: Maxim Nikulin <[email-masked]>
Date: Thu, 28 Jan 2021 23:10:14 +0700

On 28/01/2021 18:31, [email-masked] wrote:
> 
> If I try in eshell buffer 'xdg-open /tmp/test.pdf && sleep 3' my cursor 
> blinks
> with the Okular icon for a few seconds and then nothing happens.

If I correctly get what you describe as "blinks", it could last for some 
time after process failure. On the other hand I am surprised that no 
other diagnostics is shown as a KDE dialog or as an error message in the 
eshell buffer. In the case of eshell, it is likely another problem, not 
killing handler with SIGHUP due to instantly closed pty.

What happens if you run the following commands in the Emacs *eshell 
buffer* (with an existing PDF file, of course)? In particular I am 
interested in output appeared in the buffer.

1. okular /tmp/test.pdf

2. kde-open5 /tmp/test.pdf

3. sh -x /usr/bin/xdg-open /tmp/test.pdf

I'm almost sure that okular is configured as the handler, but just to 
confirm it:

4. xdg-mime query default application/pdf

I assume that PDF file is a valid one (not corrupted, not empty, not 
accessible due to file permissions, etc.) since okular is able to report 
such problems.

You could also attach to emacs process with strace, try to launch 
handler, kill strace, and inspect log file which processes are spawned 
("execve" lines) and their exit codes. Run strace from ordinary terminal 
(not from emacs) with proper process ID:

strace -o /tmp/emacs.strace -f -s 128 -tt -p PID_OF_EMACS_PROCESS