all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: xdg-open and start-process-shell-command: Unable to open files in external apps
Date: Sat, 28 Aug 2021 10:26:33 +0300	[thread overview]
Message-ID: <831r6eowra.fsf@gnu.org> (raw)
In-Reply-To: <87k0k6p1dw.fsf@debian-BULLSEYE-live-builder-AMD64> (message from Chandan Babu R on Sat, 28 Aug 2021 11:16:35 +0530)

> From: Chandan Babu R <chandanrlinux@gmail.com>
> Date: Sat, 28 Aug 2021 11:16:35 +0530
> 
> The above code was originally obtained from
> http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html.
> 
> After moving to (via a fresh install) Debian 11 (which ships Emacs 27.1) the
> code snippet has stopped working.
> 
> However, the command "xdg-open /home/chandan/2016-2017.pdf" when invoked from the
> shell command line opens the pdf application viewer (i.e. Okular)
> correctly.
> 
> The failure occurs only when start-process-shell-command procedure is invoked
> from within Emacs. The failure can also be recreated when
> start-process-shell-command is invoked from ielm buffer as shown below,
> 
> (start-process-shell-command
> 	"Opening file"
>         "sjihs async processes"
>         (concat "xdg-open "
>         	(shell-quote-argument "/home/chandan/2016-2017.pdf")))
> 
> I wrote the following trivial script ...
> 
> 	#!/usr/bin/zsh -f
> 
> 	echo "\$0 = $0; \$1 = $1" > /tmp/debug.log
> 
> and associated the script with application/pdf MIME type.
> 
> debug.log file contains the following string,
> 	$0 = /home/chandan/bin/open-pdf.sh; $1 = /home/chandan/2016-2017.pdf
> ... when xdg-open is invoked either from the command line or through Emacs'
> start-process-shell-command procedure. However, Okular does not get spawned
> only when trying to open the pdf file from within Emacs.
> 
> Any solutions or pointers to debugging this problem is very much appreciated.

I believe the reason for this was recently found and resolved in Git
on the master branch.



  reply	other threads:[~2021-08-28  7:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28  5:46 xdg-open and start-process-shell-command: Unable to open files in external apps Chandan Babu R
2021-08-28  7:26 ` Eli Zaretskii [this message]
2021-08-28 13:42   ` Chandan Babu R
2021-08-28 13:51     ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831r6eowra.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.