From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help 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 Message-ID: <831r6eowra.fsf@gnu.org> References: <87k0k6p1dw.fsf@debian-BULLSEYE-live-builder-AMD64> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27016"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 28 09:27:24 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJskN-0006oD-VM for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 09:27:23 +0200 Original-Received: from localhost ([::1]:34530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJskL-0006Lc-UV for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 03:27:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJsjo-0006LU-SJ for help-gnu-emacs@gnu.org; Sat, 28 Aug 2021 03:26:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55710) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJsjo-0008Hc-LL for help-gnu-emacs@gnu.org; Sat, 28 Aug 2021 03:26:48 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1397 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJsjo-0006yn-8Q for help-gnu-emacs@gnu.org; Sat, 28 Aug 2021 03:26:48 -0400 In-Reply-To: <87k0k6p1dw.fsf@debian-BULLSEYE-live-builder-AMD64> (message from Chandan Babu R on Sat, 28 Aug 2021 11:16:35 +0530) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132792 Archived-At: > From: Chandan Babu R > 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.